Skip to content

Commit ab443f7

Browse files
committed
consistent indentation
1 parent eedf435 commit ab443f7

File tree

16 files changed

+122
-121
lines changed

16 files changed

+122
-121
lines changed

frontend/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"no-trailing-spaces": "error",
1010
"no-multi-spaces": "error",
1111
"no-multiple-empty-lines": ["error", { "max": 8, "maxEOF": 1 }],
12-
"eol-last": ["error", "always"]
12+
"eol-last": ["error", "always"],
13+
"indent": ["error", 2, { "SwitchCase": 1 }]
1314
},
1415
"overrides": [
1516
{

frontend/src/actions/attachmentActions.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ export function updateAttachment(
4040
req.then(res => {
4141
let config: {type: string, key: string};
4242
switch (modelType) {
43-
case 'client':
44-
config = {type: ACTION_TYPES.CLIENT_UPDATE, key: 'client'};
45-
break;
46-
case 'invoice':
47-
case 'quotation':
48-
config = {type: ACTION_TYPES.INVOICE_UPDATED, key: 'invoice'};
49-
break;
43+
case 'client':
44+
config = {type: ACTION_TYPES.CLIENT_UPDATE, key: 'client'};
45+
break;
46+
case 'invoice':
47+
case 'quotation':
48+
config = {type: ACTION_TYPES.INVOICE_UPDATED, key: 'invoice'};
49+
break;
5050
}
5151

5252
const mergedModel = {...model, attachments: res.body.attachments};
@@ -70,15 +70,15 @@ export type AttachmentFormContext = {
7070

7171
function getDispatchConfig(modelType: ModelsWithAttachments, body: any): any {
7272
switch (modelType) {
73-
case 'config':
74-
return {type: ACTION_TYPES.CONFIG_UPDATE, config: body};
73+
case 'config':
74+
return {type: ACTION_TYPES.CONFIG_UPDATE, config: body};
7575

76-
case 'client':
77-
return {type: ACTION_TYPES.CLIENT_UPDATE, client: body};
76+
case 'client':
77+
return {type: ACTION_TYPES.CLIENT_UPDATE, client: body};
7878

79-
case 'invoice':
80-
case 'quotation':
81-
return {type: ACTION_TYPES.INVOICE_UPDATED, invoice: body};
79+
case 'invoice':
80+
case 'quotation':
81+
return {type: ACTION_TYPES.INVOICE_UPDATED, invoice: body};
8282
}
8383
}
8484

frontend/src/actions/configActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export function handleConfigSocketEvents(eventType: SocketEventTypes, eventPaylo
3434
case SocketEventTypes.EntityUpdated:
3535
case SocketEventTypes.EntityCreated:
3636
dispatch({
37-
type: ACTION_TYPES.CONFIG_UPDATE,
38-
config: eventPayload.entity,
37+
type: ACTION_TYPES.CONFIG_UPDATE,
38+
config: eventPayload.entity,
3939
});
4040
break;
4141
default:

frontend/src/components/client/controls/ClientSearch.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ export type ClientSearchProps = {
1818

1919

2020
export const ClientSearch = ({values, options, onChange, ...props}: ClientSearchProps) => {
21-
return (
22-
<BaseSelect
23-
value={values}
24-
onChange={(newOptions: SelectItem[]) => onChange((newOptions || []).map(o => o.value))}
25-
options={options}
26-
isClearable={false}
27-
isMulti
28-
{...props}
21+
return (
22+
<BaseSelect
23+
value={values}
24+
onChange={(newOptions: SelectItem[]) => onChange((newOptions || []).map(o => o.value))}
25+
options={options}
26+
isClearable={false}
27+
isMulti
28+
{...props}
2929
/>
30-
);};
30+
);};

frontend/src/components/client/models/getClientFeature.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ const getFilterOptions = (config: ClientFeatureBuilderConfig): ClientFilterOptio
142142
value: ct,
143143
label: t(`client.clienttypes.${ct}`)
144144
} as ClientFilterOption))
145-
.concat(getInvoiceYears(config.invoices).map(y => ({
146-
value: y,
147-
label: y.toString()
148-
})));
145+
.concat(getInvoiceYears(config.invoices).map(y => ({
146+
value: y,
147+
label: y.toString()
148+
})));
149149
};
150150

151151
export const clientFeature = (config: ClientFeatureBuilderConfig): IFeature<ClientModel, ClientListFilters> => {
@@ -160,10 +160,10 @@ export const clientFeature = (config: ClientFeatureBuilderConfig): IFeature<Clie
160160
value: ct,
161161
label: t(`client.clienttypes.${ct}`)
162162
} as ClientFilterOption))
163-
.concat(config.filters.years.map(y => ({
164-
value: y,
165-
label: y.toString()
166-
})));
163+
.concat(config.filters.years.map(y => ({
164+
value: y,
165+
label: y.toString()
166+
})));
167167

168168
feature.list.filter = {
169169
state: config.filters,

frontend/src/components/controls/attachments/AddAttachmentPopup.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,27 @@ const AddAttachmentPopupComponent = (props: AddAttachmentPopupProps) => {
5353
/>
5454

5555
{isModalOpen && (
56-
<Popup title={t('invoice.attachmentsAdd')} buttons={buttons} onHide={() => setIsModalOpen(false)}>
57-
<Form.Group style={{marginBottom: 12}}>
58-
<Form.Label>{t('attachment.type')}</Form.Label>
59-
<SimpleCreatableSelect
60-
value={type}
61-
options={props.attachmentTypes}
62-
onChange={(text: string) => setType(text)}
63-
/>
64-
</Form.Group>
56+
<Popup title={t('invoice.attachmentsAdd')} buttons={buttons} onHide={() => setIsModalOpen(false)}>
57+
<Form.Group style={{marginBottom: 12}}>
58+
<Form.Label>{t('attachment.type')}</Form.Label>
59+
<SimpleCreatableSelect
60+
value={type}
61+
options={props.attachmentTypes}
62+
onChange={(text: string) => setType(text)}
63+
/>
64+
</Form.Group>
6565

66-
{!canAddFile && type ? (
67-
<Alert variant="danger">{t('attachment.typeExists')}</Alert>
68-
) : null}
66+
{!canAddFile && type ? (
67+
<Alert variant="danger">{t('attachment.typeExists')}</Alert>
68+
) : null}
6969

70-
{canAddFile && type
70+
{canAddFile && type
7171
&& (
72-
<div style={{maxWidth: '50%'}}>
73-
<AttachmentDropzone onUpload={(f: File) => setFile(f)} fileType={type} />
74-
</div>
72+
<div style={{maxWidth: '50%'}}>
73+
<AttachmentDropzone onUpload={(f: File) => setFile(f)} fileType={type} />
74+
</div>
7575
)}
76-
</Popup>
76+
</Popup>
7777
)}
7878
</>
7979
);

frontend/src/components/controls/form-controls/inputs/PhoneInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const PhoneInput = ({value, onChange, ...props}: PhoneInputProps) => (
1616
<Icon fa="fa fa-phone" size={1} />
1717
</a>
1818
</InputGroup.Text>
19-
)}
19+
)}
2020
suffixOptions={{type: 'button'}}
2121
/>
2222
);

frontend/src/components/enhancers/EnhanceInputWithAddons.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ export const EnhanceInputWithAddons = <P extends object>(ComposedComponent: Reac
1414
({prefix, prefixOptions, suffix, suffixOptions, addOnMinWidth, ...props}: EnhanceInputWithAddonsProps & P) => {
1515
// ATTN: window.outerWidth is not part of the state, so a
1616
// rerender does not happen when the user resizes the window
17-
if ((!addOnMinWidth || addOnMinWidth < window.outerWidth) && (prefix || suffix)) {
18-
return (
19-
<InputGroup>
20-
{prefix ? <Addon add={prefix} options={prefixOptions} /> : null}
21-
<ComposedComponent {...props as P} />
22-
{suffix ? <Addon add={suffix} options={suffixOptions} /> : null}
23-
</InputGroup>
24-
);
25-
}
26-
return <ComposedComponent {...props as P} />;
27-
};
17+
if ((!addOnMinWidth || addOnMinWidth < window.outerWidth) && (prefix || suffix)) {
18+
return (
19+
<InputGroup>
20+
{prefix ? <Addon add={prefix} options={prefixOptions} /> : null}
21+
<ComposedComponent {...props as P} />
22+
{suffix ? <Addon add={suffix} options={suffixOptions} /> : null}
23+
</InputGroup>
24+
);
25+
}
26+
return <ComposedComponent {...props as P} />;
27+
};
2828

2929

3030
const Addon = ({add, options}) => {

frontend/src/components/home/sections/ProjectSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ConsultantContractsList } from "../measurements/project/ConsultantContr
33
export const ProjectSection = () => {
44
return (
55
<>
6-
<ConsultantContractsList />
6+
<ConsultantContractsList />
77
</>
88
);
99
};

frontend/src/components/invoice/controls/InvoiceReplacementsInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const InvoiceReplacementsInput = ({value, onChange, ...props}: InvoiceRep
1818
<Icon fa="fa fa-file-invoice" size={1} />
1919
</InputGroup.Text>
2020
</OverlayTrigger>
21-
)}
21+
)}
2222
suffixOptions={{type: 'button'}}
2323
/>
2424
);

frontend/src/components/invoice/invoice-edit/invoice-lines/EditInvoiceLines.tsx

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -38,51 +38,51 @@ export const EditInvoiceLines = (
3838
const nrOfColumns = 6;
3939
return (
4040
<div className="edit-invoice-lines">
41-
<Table size="sm">
42-
<thead>
43-
<tr>
44-
<th style={{width: '1%'}}>&nbsp;</th>
45-
<th style={{width: '30%'}}>{t('client.projectDesc')}</th>
46-
<th style={{width: '10%'}}>{t('rates.type')}</th>
47-
<th style={{width: '10%'}}>{t('rates.value')}</th>
48-
<th style={{width: '10%'}}>{t('rates.rate')}</th>
49-
<th style={{width: '10%'}}>{t('config.company.btw')}</th>
50-
<th style={{width: '1%'}}>&nbsp;</th>
51-
</tr>
52-
</thead>
53-
<DragDropContext onDragEnd={drag => onDragEnd(drag)}>
54-
<Droppable droppableId="droppable">
55-
{(provided, snapshot) => (
56-
<tbody ref={provided.innerRef}>
57-
{(value || []).map((item, index) => (
58-
<Draggable key={item.sort} draggableId={(typeof item.sort === 'number' ? item.sort : index).toString()} index={index}>
59-
{(providedInner, snapshotInner) => {
60-
const EditInvoiceLine = createEditInvoiceLine(item);
61-
return (
62-
<tr ref={providedInner.innerRef} {...providedInner.draggableProps} {...providedInner.dragHandleProps}>
63-
<td><DragAndDropIcon claim={claim} /></td>
64-
<EditInvoiceLine lines={value} index={index} onChange={onChange} line={item} invoice={invoice} />
65-
<EditInvoiceLineIcons claim={claim} lines={value} index={index} allowEmpty={allowEmpty} onChange={onChange} />
66-
</tr>
67-
);
68-
}}
69-
</Draggable>
70-
))}
71-
{provided.placeholder}
72-
</tbody>
73-
)}
74-
</Droppable>
75-
</DragDropContext>
76-
<ClaimGuard claim={claim}>
77-
<tbody>
41+
<Table size="sm">
42+
<thead>
7843
<tr>
79-
<td colSpan={nrOfColumns}>
80-
<AddIcon onClick={() => onChange(InvoiceLineActions.addEmptyLine(value))} label={tp('.addLine')} size={1} />
81-
</td>
44+
<th style={{width: '1%'}}>&nbsp;</th>
45+
<th style={{width: '30%'}}>{t('client.projectDesc')}</th>
46+
<th style={{width: '10%'}}>{t('rates.type')}</th>
47+
<th style={{width: '10%'}}>{t('rates.value')}</th>
48+
<th style={{width: '10%'}}>{t('rates.rate')}</th>
49+
<th style={{width: '10%'}}>{t('config.company.btw')}</th>
50+
<th style={{width: '1%'}}>&nbsp;</th>
8251
</tr>
83-
</tbody>
84-
</ClaimGuard>
85-
</Table>
52+
</thead>
53+
<DragDropContext onDragEnd={drag => onDragEnd(drag)}>
54+
<Droppable droppableId="droppable">
55+
{(provided, snapshot) => (
56+
<tbody ref={provided.innerRef}>
57+
{(value || []).map((item, index) => (
58+
<Draggable key={item.sort} draggableId={(typeof item.sort === 'number' ? item.sort : index).toString()} index={index}>
59+
{(providedInner, snapshotInner) => {
60+
const EditInvoiceLine = createEditInvoiceLine(item);
61+
return (
62+
<tr ref={providedInner.innerRef} {...providedInner.draggableProps} {...providedInner.dragHandleProps}>
63+
<td><DragAndDropIcon claim={claim} /></td>
64+
<EditInvoiceLine lines={value} index={index} onChange={onChange} line={item} invoice={invoice} />
65+
<EditInvoiceLineIcons claim={claim} lines={value} index={index} allowEmpty={allowEmpty} onChange={onChange} />
66+
</tr>
67+
);
68+
}}
69+
</Draggable>
70+
))}
71+
{provided.placeholder}
72+
</tbody>
73+
)}
74+
</Droppable>
75+
</DragDropContext>
76+
<ClaimGuard claim={claim}>
77+
<tbody>
78+
<tr>
79+
<td colSpan={nrOfColumns}>
80+
<AddIcon onClick={() => onChange(InvoiceLineActions.addEmptyLine(value))} label={tp('.addLine')} size={1} />
81+
</td>
82+
</tr>
83+
</tbody>
84+
</ClaimGuard>
85+
</Table>
8686
</div>
8787
);
8888
};

frontend/src/components/invoice/models/getInvoiceFeature.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ export function getInvoiceColumns(config: InvoiceFeatureBuilderConfig): IListCel
202202
header: '',
203203
className: 'icons-cell',
204204
value: (i: InvoiceModel) =>
205-
<InvoiceListRowActions
206-
invoice={i}
207-
buttons={config.buttons}
208-
hideEdit={config.currentInvoice?.number === i.number}
209-
/>,
205+
<InvoiceListRowActions
206+
invoice={i}
207+
buttons={config.buttons}
208+
hideEdit={config.currentInvoice?.number === i.number}
209+
/>,
210210
}];
211211

212212
const result = columns.filter(col => includedFields.includes(col.key));

frontend/src/components/pages/user/LogoutButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const LogoutButton = () => {
2424
<Button
2525
variant="danger"
2626
onClick={logout}>
27-
<Icon className="tst-logout" fa="fab fa-google" size={1} style={{paddingRight: 8}} />
28-
{t('user.logout')}
27+
<Icon className="tst-logout" fa="fab fa-google" size={1} style={{paddingRight: 8}} />
28+
{t('user.logout')}
2929
</Button>
3030
);
3131
};

frontend/src/components/project/project-month-list/closed-list/badges/InboundBadge.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const InboundBadge = ({pending, totals}: TimesheetBadgeProps) => {
2222
<span className="badge rounded-pill bg-warning inbound-badges">
2323
<Tooltip title={totals.inboundNew && `<b>${t('projectMonth.inboundNew')}</b><br>${totals.inboundNew}`}>
2424
<i className="fa fa-inbox fa-1x">
25-
<span>{totals.inboundNewCount}</span>
25+
<span>{totals.inboundNewCount}</span>
2626
</i>
2727
</Tooltip>
2828

@@ -35,8 +35,8 @@ export const InboundBadge = ({pending, totals}: TimesheetBadgeProps) => {
3535

3636
<Tooltip
3737
title={totals.inboundPaid && `<b>${t('projectMonth.inboundPaid')}</b><br>${totals.inboundPaid}`}>
38-
<i className="fa fa-coins fa-1x">
39-
<span>{totals.inboundPaidCount}</span>
38+
<i className="fa fa-coins fa-1x">
39+
<span>{totals.inboundPaidCount}</span>
4040
</i>
4141
</Tooltip>
4242
</span>

frontend/src/components/project/project-month-list/closed-list/badges/TimesheetBadge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const TimesheetBadge = ({ pending, totals }: TimesheetBadgeProps) => {
2525
<Tooltip title={`<b>${t('projectMonth.timesheetValidated')}</b><br>` + totals.timesheetPending}>
2626
<span className="badge rounded-pill bg-warning">
2727
<i className="fa fa-clock fa-1x" />
28-
{t('projectMonth.list.timesheetPending', {timesheetPendingCount: totals.timesheetPendingCount})}
28+
{t('projectMonth.list.timesheetPending', {timesheetPendingCount: totals.timesheetPendingCount})}
2929
</span>
3030
</Tooltip>
3131
);

frontend/src/components/users/EditUser.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ export const EditUser = () => {
6262
</Form>
6363
<StickyFooter claim={Claim.ManageUsers}>
6464
<BusyButton
65-
className="tst-save-user"
66-
onClick={() => dispatch(saveUser(user, undefined, navigate) as any)}
65+
className="tst-save-user"
66+
onClick={() => dispatch(saveUser(user, undefined, navigate) as any)}
6767
disabled={isButtonDisabled()}
6868
>
6969
{t('save')}

0 commit comments

Comments
 (0)