Skip to content

Commit

Permalink
🧹 clean to follow eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
yaf authored Jan 28, 2025
1 parent 8e334f2 commit d93661b
Show file tree
Hide file tree
Showing 39 changed files with 168 additions and 168 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class ActionsOnUsersRoleInOrganization extends Component {
this.args.organizationMembership.organizationRole = this.selectedNewRole;
await this.args.organizationMembership.save();
this.pixToast.sendSuccessNotification({ message: 'Le rôle du membre a été mis à jour avec succès.' });
} catch (e) {
} catch {
this.pixToast.sendErrorNotification({
message: 'Une erreur est survenue lors de la mise à jour du rôle du membre.',
});
Expand Down Expand Up @@ -69,7 +69,7 @@ export default class ActionsOnUsersRoleInOrganization extends Component {
try {
await this.args.organizationMembership.destroyRecord({ adapterOptions: { disable: true } });
this.pixToast.sendSuccessNotification({ message: 'Le membre a été désactivé avec succès.' });
} catch (e) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue lors de la désactivation du membre.' });
} finally {
this.displayConfirm = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class AnonymizeGarImport extends Component {
}

this.errorResponseHandler.notify(await response.json());
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: this.intl.t('common.notifications.generic-error') });
} finally {
this.isLoading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class OidcProvidersImport extends Component {
jsonResponse.errors.forEach((error) => {
this.pixToast.sendErrorNotification({ message: error.detail });
});
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: this.intl.t('common.notifications.generic-error') });
} finally {
this.isLoading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class CertificationScoringConfiguration extends Component {
try {
await adapter.updateCertificationScoringConfiguration(this.certificationScoringConfiguration);
this.pixToast.sendSuccessNotification({ message: 'Configuration enregistrée' });
} catch (_) {
} catch {
this.pixToast.sendErrorNotification({ message: "La config n'a pas pu être ajoutée" });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class CompetenceScoringConfiguration extends Component {
try {
await adapter.updateCompetenceScoringConfiguration(this.competenceScoringConfiguration);
this.pixToast.sendSuccessNotification({ message: 'Configuration enregistrée' });
} catch (_) {
} catch {
this.pixToast.sendErrorNotification({ message: "La config n'a pas pu être ajoutée" });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class FlashAlgorithmConfiguration extends Component {
try {
await adapter.createRecord(this.form);
this.pixToast.sendSuccessNotification({ message: 'La configuration a été créée' });
} catch (errorResponse) {
} catch {
this.pixToast.sendErrorNotification({ message: "La configuration n'a pu être créée" });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class ScoWhitelistConfiguration extends Component {
message: this.intl.t(`pages.administration.certification.sco-whitelist.import.${errorKey}`),
});
}
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({
message: this.intl.t('pages.administration.certification.sco-whitelist.import.error'),
});
Expand All @@ -60,7 +60,7 @@ export default class ScoWhitelistConfiguration extends Component {
const fileName = 'sco-whitelist.csv';
const token = this.session.data.authenticated.access_token;
await this.fileSaver.save({ url, fileName, token });
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({
message: this.intl.t('pages.administration.certification.sco-whitelist.export.error'),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class AddOrganizationFeaturesInBatch extends Component {
} else {
this.errorResponseHandler.notify(await response.json());
}
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: this.intl.t('common.notifications.generic-error') });
} finally {
this.isLoading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class LearningContent extends Component {
this.pixToast.sendSuccessNotification({
message: 'La demande de rechargement du cache a bien été prise en compte.',
});
} catch (_) {
} catch {
const genericErrorMessage = this.intl.t('common.notifications.generic-error');
this.pixToast.sendErrorNotification({ message: genericErrorMessage });
}
Expand All @@ -31,7 +31,7 @@ export default class LearningContent extends Component {
this.pixToast.sendSuccessNotification({
message: 'La création de la version du référentiel et le rechargement du cache a bien été prise en compte.',
});
} catch (_) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class OrganizationTagsImport extends Component {

this.errorResponseHandler.notify(json);
}
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: this.intl.t('common.notifications.generic-error') });
} finally {
this.isLoading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class UpdateOrganizationsInBatch extends Component {
}

this.errorResponseHandler.notify(await response.json());
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: this.intl.t('common.notifications.generic-error') });
} finally {
this.isLoading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default class CandidateEditModal extends Component {
try {
await this.args.onFormSubmit();
this._initForm();
} catch (_) {
} catch {
this.args.candidate.updateInformation(informationBeforeUpdate);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class TargetProfileSelectorComponent extends Component {
label: `${attachableTargetProfile.id} - ${attachableTargetProfile.name}`,
value: attachableTargetProfile,
}));
} catch (e) {
} catch {
this.args.onError('Une erreur est survenue lors de la recherche de profils cibles.');
} finally {
this.isAttachableTargetProfilesLoading = false;
Expand Down
2 changes: 1 addition & 1 deletion admin/app/components/organizations/places/delete-modal.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class DeleteModal extends Component {
message: `Le lot de place ${this.args.organizationPlacesLot.reference} a été supprimé.`,
});
this.args.refreshModel();
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({
message: `Le lot de place ${this.args.organizationPlacesLot.reference} n'a pas été supprimé.`,
});
Expand Down
2 changes: 1 addition & 1 deletion admin/app/components/target-profiles/target-profile.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default class TargetProfile extends Component {
await this.args.model.save({ adapterOptions: { markTargetProfileAsSimplifiedAccess: true } });

this.pixToast.sendSuccessNotification({ message: 'Ce profil cible a bien été marqué comme accès simplifié.' });
} catch (responseError) {
} catch {
const genericErrorMessage = this.intl.t('common.notifications.generic-error');
this.pixToast.sendErrorNotification({ message: genericErrorMessage });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class UserDetailPersonalInformationComponent extends Component {
try {
await this.organizationLearnerToDissociate.destroyRecord();
this.pixToast.sendSuccessNotification({ message: DISSOCIATE_SUCCESS_NOTIFICATION_MESSAGE });
} catch (response) {
} catch {
const errorMessage = 'Une erreur est survenue !';
this.pixToast.sendErrorNotification({ message: errorMessage });
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class CampaignParticipationsController extends Controller {
try {
await campaignParticipation.save();
this.pixToast.sendSuccessNotification({ message: "L'id externe du participant été mis à jour avec succès." });
} catch (_) {
} catch {
this.pixToast.sendErrorNotification({
message: "Une erreur est survenue lors de la mise à jour de l'id externe du participant.",
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class AuthenticatedCertificationCentersGetInvitationsController e
},
});
this.pixToast.sendSuccessNotification({ message: 'Cette invitation a bien été annulée.' });
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur s’est produite, veuillez réessayer.' });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class AuthenticatedCertificationCentersGetTeamController extends
certificationCenterMembership.deleteRecord();
await certificationCenterMembership.save();
this.pixToast.sendSuccessNotification({ message: 'Le membre a correctement été désactivé.' });
} catch (_) {
} catch {
this.pixToast.sendErrorNotification({ message: "Une erreur est survenue, le membre n'a pas été désactivé." });
}
}
Expand All @@ -79,7 +79,7 @@ export default class AuthenticatedCertificationCentersGetTeamController extends
'pages.certification-centers.notifications.success.update-certification-center-membership-role',
),
});
} catch (_) {
} catch {
certificationCenterMembership.rollbackAttributes();
this.pixToast.sendErrorNotification({
message: this.intl.t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class NewController extends Controller {
await certificationCenter.save();
this.pixToast.sendSuccessNotification({ message: 'Le centre de certification a été créé avec succès.' });
this.router.transitionTo('authenticated.certification-centers.get', certificationCenter.id);
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export default class CertificationInformationsController extends Controller {
try {
await this.certification.save({ adapterOptions: { isCertificationCancel: true } });
await this.certification.reload();
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}

Expand All @@ -174,7 +174,7 @@ export default class CertificationInformationsController extends Controller {
try {
await this.certification.save({ adapterOptions: { isCertificationUncancel: true } });
await this.certification.reload();
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}

Expand All @@ -186,7 +186,7 @@ export default class CertificationInformationsController extends Controller {
try {
await this.certification.save({ adapterOptions: { isCertificationReject: true } });
await this.certification.reload();
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}

Expand All @@ -198,7 +198,7 @@ export default class CertificationInformationsController extends Controller {
try {
await this.certification.save({ adapterOptions: { isCertificationUnreject: true } });
await this.certification.reload();
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}

Expand Down Expand Up @@ -229,7 +229,7 @@ export default class CertificationInformationsController extends Controller {
await this.saveAssessmentResult(commentByJury);
this.pixToast.sendSuccessNotification({ message: 'Le commentaire du jury a bien été enregistré.' });
return true;
} catch (_) {
} catch {
this.pixToast.sendErrorNotification({ message: "Le commentaire du jury n'a pas pu être enregistré." });
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class NeutralizationController extends Controller {
return this.pixToast.sendSuccessNotification({
message: `La question n°${questionIndex} a été neutralisée avec succès.`,
});
} catch (_) {
} catch {
return this.pixToast.sendErrorNotification({
message: `Une erreur est survenue lors de la neutralisation de la question n°${questionIndex}.`,
});
Expand All @@ -44,7 +44,7 @@ export default class NeutralizationController extends Controller {
return this.pixToast.sendSuccessNotification({
message: `La question n°${questionIndex} a été dé-neutralisée avec succès.`,
});
} catch (_) {
} catch {
return this.pixToast.sendErrorNotification({
message: `Une erreur est survenue lors de la dé-neutralisation de la question n°${questionIndex}.`,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class InvitationsController extends Controller {
},
});
this.pixToast.sendSuccessNotification({ message: `Cette invitation a bien été annulée.` });
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur s’est produite, veuillez réessayer.' });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class New extends Controller {
try {
this.model.setProperties(attributes);
await this.model.save({ adapterOptions: { organizationId: this.model.organizationId } });
} catch (errorResponse) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Erreur lors de la création du lot de place.' });
this.errors = this.model.errors;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class GetTeamController extends Controller {

this.userEmailToAdd = null;
this.pixToast.sendSuccessNotification({ message: 'Accès attribué avec succès.' });
} catch (_) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}
}
Expand Down
2 changes: 1 addition & 1 deletion admin/app/controllers/authenticated/organizations/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class NewController extends Controller {
await this.model.save();
this.pixToast.sendSuccessNotification({ message: 'L’organisation a été créée avec succès.' });
this.router.transitionTo('authenticated.organizations.get.all-tags', this.model.id);
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class IndexController extends Controller {
await this.sessionModel.save({ adapterOptions: { unfinalize: true } });
await this.sessionModel.reload();
this.pixToast.sendSuccessNotification({ message: 'La session a bien été définalisée' });
} catch (err) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Erreur lors de la définalisation de la session' });
}
this.cancelModal();
Expand Down Expand Up @@ -94,7 +94,7 @@ export default class IndexController extends Controller {
const link = await adapter.getDownloadLink({ id: this.model.id, lang: this.intl.primaryLocale });
await navigator.clipboard.writeText(link.sessionResultsLink);
this._displaySuccessTooltip();
} catch (err) {
} catch {
this._displayErrorTooltip();
}
window.setTimeout(() => this._hideTooltip(), 2000);
Expand All @@ -107,7 +107,7 @@ export default class IndexController extends Controller {
const token = this.session.data.authenticated.access_token;
try {
await this.fileSaver.save({ url, token });
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({
message: "Une erreur est survenue, les attestations n'ont pas pu être téléchargées.",
});
Expand All @@ -119,7 +119,7 @@ export default class IndexController extends Controller {
try {
await this.sessionModel.save({ adapterOptions: { isComment: true, comment } });
this.sessionModel.reload();
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({
message: "Une erreur est survenue pendant l'enregistrement du commentaire. ",
});
Expand Down Expand Up @@ -157,7 +157,7 @@ export default class IndexController extends Controller {
try {
await this.sessionModel.save({ adapterOptions: { certificationOfficerAssignment: true } });
this.pixToast.sendSuccessNotification({ message: 'La session vous a correctement été assignée' });
} catch (_) {
} catch {
this.pixToast.sendErrorNotification({ message: "Erreur lors de l'assignation à la session" });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class TargetProfileOrganizationsController extends Controller {
await this.pixToast.sendSuccessNotification({ message });
this.router.transitionTo('authenticated.target-profiles.target-profile.organizations');
}
} catch (responseError) {
} catch {
return this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}
}
Expand Down
2 changes: 1 addition & 1 deletion admin/app/controllers/authenticated/trainings/training.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class Training extends Controller {
await this.model.save();
this.pixToast.sendSuccessNotification({ message: 'Le contenu formatif a été mis à jour avec succès.' });
this.toggleEditMode();
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class TrainingEditTriggersController extends Controller {
.save({ adapterOptions: { tubes: this.selectedTubes, trainingId: this.model.training.id } });
this.pixToast.sendSuccessNotification({ message: 'Le déclencheur a été créé avec succès.' });
this.goBackToTraining();
} catch (error) {
} catch {
this.pixToast.sendErrorNotification({ message: 'Une erreur est survenue.' });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class UserCampaignParticipationsController extends Controller {
await this.model.reload();
this.send('refreshModel');
this.pixToast.sendSuccessNotification({ message: 'La participation du prescrit a été supprimée avec succès.' });
} catch (_) {
} catch {
this.pixToast.sendErrorNotification({
message: 'Une erreur est survenue lors de la suppression de la participation.',
});
Expand Down
Loading

0 comments on commit d93661b

Please sign in to comment.