Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Mon 15036 remove comma dangle in prettiers config 23 04 #12033

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
trailingComma: 'es5',
trailingComma: 'none',
arrowParens: 'always',
singleQuote: true,
}
2 changes: 1 addition & 1 deletion www/front_src/src/App/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export {
externalTranslationEndpoint,
internalTranslationEndpoint,
aclEndpoint,
userEndpoint,
userEndpoint
};
12 changes: 6 additions & 6 deletions www/front_src/src/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ const useStyles = makeStyles((theme) => ({
overflow: 'hidden',
position: 'relative',
transition: 'all 0.3s',
width: '100%',
width: '100%'
},
fullScreenWrapper: {
flexGrow: 1,
height: '100%',
overflow: 'hidden',
width: '100%',
width: '100%'
},
fullscreenButton: {
bottom: '10px',
position: 'absolute',
right: '20px',
zIndex: 1500,
zIndex: 1500
},
mainContent: {
height: `calc(100vh - ${theme.spacing(headerHeight)})`,
width: '100%',
width: '100%'
},
wrapper: {
alignItems: 'stretch',
backgroundColor: theme.palette.background.paper,
display: 'flex',
fontFamily: theme.typography.fontFamily,
height: '100%',
overflow: 'hidden',
},
overflow: 'hidden'
}
}));

const MainRouter = lazy(() => import('../components/mainRouter'));
Expand Down
30 changes: 15 additions & 15 deletions www/front_src/src/App/useApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
aclAtom,
Actions,
downtimeAtom,
refreshIntervalAtom,
refreshIntervalAtom
} from '@centreon/ui-context';
import { getData, useRequest, useSnackbar, postData } from '@centreon/ui';

Expand Down Expand Up @@ -44,17 +44,17 @@ const useApp = (): UseAppState => {

const { sendRequest: keepAliveRequest } = useRequest({
httpCodesBypassErrorSnackbar: [401],
request: getData,
request: getData
});
const { sendRequest: getParameters } = useRequest<DefaultParameters>({
request: getData,
request: getData
});
const { sendRequest: getAcl } = useRequest<Actions>({
request: getData,
request: getData
});

const { sendRequest: logoutRequest } = useRequest({
request: postData,
request: postData
});

const setDowntime = useUpdateAtom(downtimeAtom);
Expand All @@ -69,7 +69,7 @@ const useApp = (): UseAppState => {
setAreUserParametersLoaded(false);
logoutRequest({
data: {},
endpoint: logoutEndpoint,
endpoint: logoutEndpoint
}).then(() => {
showErrorMessage(t(labelYouAreDisconnected));
navigate(reactRoutes.login);
Expand All @@ -81,24 +81,24 @@ const useApp = (): UseAppState => {

Promise.all([
getParameters({
endpoint: parametersEndpoint,
endpoint: parametersEndpoint
}),
getAcl({
endpoint: aclEndpoint,
}),
endpoint: aclEndpoint
})
])
.then(([retrievedParameters, retrievedAcl]) => {
setDowntime({
duration: parseInt(
retrievedParameters.monitoring_default_downtime_duration,
10,
10
),
fixed: retrievedParameters.monitoring_default_downtime_fixed,
with_services:
retrievedParameters.monitoring_default_downtime_with_services,
retrievedParameters.monitoring_default_downtime_with_services
});
setRefreshInterval(
parseInt(retrievedParameters.monitoring_default_refresh_interval, 10),
parseInt(retrievedParameters.monitoring_default_refresh_interval, 10)
);
setAcl({ actions: retrievedAcl });
setAcknowledgement({
Expand All @@ -109,7 +109,7 @@ const useApp = (): UseAppState => {
retrievedParameters.monitoring_default_acknowledgement_persistent,
sticky: retrievedParameters.monitoring_default_acknowledgement_sticky,
with_services:
retrievedParameters.monitoring_default_acknowledgement_with_services,
retrievedParameters.monitoring_default_acknowledgement_with_services
});
})
.catch((error) => {
Expand All @@ -123,7 +123,7 @@ const useApp = (): UseAppState => {

const keepAlive = (): void => {
keepAliveRequest({
endpoint: keepAliveEndpoint,
endpoint: keepAliveEndpoint
}).catch((error) => {
if (not(pathEq(['response', 'status'], 401, error))) {
return;
Expand All @@ -145,7 +145,7 @@ const useApp = (): UseAppState => {
}, []);

return {
hasMinArgument,
hasMinArgument
};
};

Expand Down
12 changes: 6 additions & 6 deletions www/front_src/src/App/usePendo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ const oneDayInMs = 24 * 60 * 60 * 1000;

const centreonPlatformDataAtom = atomWithStorage<CeipData | null>(
'centreonPlatformData',
null,
null
);

const usePendo = (): void => {
const [isCeipEnabled, setIsCeipEnabled] = useState(false);
const { sendRequest } = useRequest<CeipData>({
request: getData,
request: getData
});

const [centreonPlatformData, setCentreonPlatformData] = useAtom(
centreonPlatformDataAtom,
centreonPlatformDataAtom
);

const sendCeipInfo = (isOnline: boolean): void => {
Expand All @@ -32,7 +32,7 @@ const usePendo = (): void => {
}

sendRequest({
endpoint: './api/internal.php?object=centreon_ceip&action=ceipInfo',
endpoint: './api/internal.php?object=centreon_ceip&action=ceipInfo'
}).then((data) => {
if (not(data?.ceip)) {
setCentreonPlatformData({ ceip: false });
Expand All @@ -47,7 +47,7 @@ const usePendo = (): void => {
cacheGenerationDate: Date.now(),
ceip: true,
excludeAllText: data.excludeAllText,
visitor: data.visitor,
visitor: data.visitor
};
setCentreonPlatformData(platformData);
});
Expand All @@ -63,7 +63,7 @@ const usePendo = (): void => {
try {
const isCacheOutdated = gte(
(centreonPlatformData?.cacheGenerationDate || 0) + oneDayInMs,
Date.now(),
Date.now()
);

if (not(isCacheOutdated)) {
Expand Down
12 changes: 6 additions & 6 deletions www/front_src/src/Authentication/FormButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ConfirmDialog,
SaveButton,
useMemoComponent,
UnsavedChangesDialog,
UnsavedChangesDialog
} from '@centreon/ui';

import {
Expand All @@ -22,7 +22,7 @@ import {
labelResetTheForm,
labelSave,
labelSaved,
labelSaving,
labelSaving
} from './Local/translatedLabels';
import { tabAtom, appliedTabAtom } from './tabAtoms';

Expand All @@ -33,8 +33,8 @@ const useStyles = makeStyles((theme) => ({
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end',
marginTop: theme.spacing(2),
},
marginTop: theme.spacing(2)
}
}));

const FormButtons = (): JSX.Element => {
Expand Down Expand Up @@ -148,8 +148,8 @@ const FormButtons = (): JSX.Element => {
askingBeforeReset,
tab,
unsavedDialogOpened,
classes,
],
classes
]
});
};

Expand Down
22 changes: 11 additions & 11 deletions www/front_src/src/Authentication/Local/Form/Attempts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
labelNumberOfAttemptsBeforeUserIsBlocked,
labelStrong,
labelUnknown,
labelWeak,
labelWeak
} from '../translatedLabels';
import StrengthProgress from '../StrengthProgress';

Expand All @@ -24,8 +24,8 @@ export const attemptsFieldName = 'attempts';

const useStyles = makeStyles((theme) => ({
input: {
maxWidth: theme.spacing(43),
},
maxWidth: theme.spacing(43)
}
}));

const Attempts = (): JSX.Element => {
Expand All @@ -46,32 +46,32 @@ const Attempts = (): JSX.Element => {

setFieldValue(attemptsFieldName, parseInt(value, 10));
},
[attemptsFieldName],
[attemptsFieldName]
);

const attemptsError = getField<string | undefined>({
field: attemptsFieldName,
object: errors,
object: errors
});

const attemptsValue = getField<number>({
field: attemptsFieldName,
object: values,
object: values
});

const thresholds = useMemo(
() => [
{ color: theme.palette.success.main, label: labelStrong, value: 0 },
{ color: theme.palette.warning.main, label: labelGood, value: 3 },
{ color: theme.palette.error.main, label: labelWeak, value: 6 },
{ color: theme.palette.grey[500], label: labelUnknown, value: 11 },
{ color: theme.palette.grey[500], label: labelUnknown, value: 11 }
],
[],
[]
);

const displayStrengthProgress = useMemo(
() => isNil(attemptsError) && not(isNil(attemptsValue)),
[attemptsError, attemptsValue],
[attemptsError, attemptsValue]
);

return useMemoComponent({
Expand All @@ -83,7 +83,7 @@ const Attempts = (): JSX.Element => {
helperText={attemptsError}
inputProps={{
'aria-label': t(labelNumberOfAttemptsBeforeUserIsBlocked),
min: 1,
min: 1
}}
label={t(labelNumberOfAttemptsBeforeUserIsBlocked)}
name={attemptsFieldName}
Expand All @@ -101,7 +101,7 @@ const Attempts = (): JSX.Element => {
)}
</div>
),
memoProps: [attemptsError, attemptsValue],
memoProps: [attemptsError, attemptsValue]
});
};

Expand Down
Loading