From 7ac62b99f49f6c3a7117fcf7b702d5d1ea0288a4 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Tue, 4 Aug 2020 23:51:32 +0200 Subject: [PATCH] Improve constants to match linter --- src/constants/AvailableWebsites.js | 24 ++++----- src/constants/ProxiwashConstants.js | 36 ++++++------- src/constants/Update.js | 82 ++++++++++++++--------------- 3 files changed, 69 insertions(+), 73 deletions(-) diff --git a/src/constants/AvailableWebsites.js b/src/constants/AvailableWebsites.js index 602742a..f87f05d 100644 --- a/src/constants/AvailableWebsites.js +++ b/src/constants/AvailableWebsites.js @@ -1,13 +1,13 @@ export default { - websites: { - AMICALE: "https://www.amicale-insat.fr/", - AVAILABLE_ROOMS: "http://planex.insa-toulouse.fr/salles.php", - BIB: "https://bibbox.insa-toulouse.fr/", - BLUEMIND: "https://etud-mel.insa-toulouse.fr/webmail/", - ELUS_ETUDIANTS: "https://etud.insa-toulouse.fr/~eeinsat/", - ENT: "https://ent.insa-toulouse.fr/", - INSA_ACCOUNT: "https://moncompte.insa-toulouse.fr/", - TUTOR_INSA: "https://www.etud.insa-toulouse.fr/~tutorinsa/", - WIKETUD: "https://wiki.etud.insa-toulouse.fr/", - }, -} + websites: { + AMICALE: 'https://www.amicale-insat.fr/', + AVAILABLE_ROOMS: 'http://planex.insa-toulouse.fr/salles.php', + BIB: 'https://bibbox.insa-toulouse.fr/', + BLUEMIND: 'https://etud-mel.insa-toulouse.fr/webmail/', + ELUS_ETUDIANTS: 'https://etud.insa-toulouse.fr/~eeinsat/', + ENT: 'https://ent.insa-toulouse.fr/', + INSA_ACCOUNT: 'https://moncompte.insa-toulouse.fr/', + TUTOR_INSA: 'https://www.etud.insa-toulouse.fr/~tutorinsa/', + WIKETUD: 'https://wiki.etud.insa-toulouse.fr/', + }, +}; diff --git a/src/constants/ProxiwashConstants.js b/src/constants/ProxiwashConstants.js index 5a07206..809936a 100644 --- a/src/constants/ProxiwashConstants.js +++ b/src/constants/ProxiwashConstants.js @@ -1,20 +1,20 @@ export default { - machineStates: { - "AVAILABLE": 0, - "RUNNING": 1, - "RUNNING_NOT_STARTED": 2, - "FINISHED": 3, - "UNAVAILABLE": 4, - "ERROR": 5, - "UNKNOWN": 6, - }, - stateIcons: { - 0: 'radiobox-blank', - 1: 'progress-check', - 2: 'alert-circle-outline', - 3: 'check-circle', - 4: 'alert-octagram-outline', - 5: 'alert', - 6: 'help-circle-outline', - } + machineStates: { + AVAILABLE: 0, + RUNNING: 1, + RUNNING_NOT_STARTED: 2, + FINISHED: 3, + UNAVAILABLE: 4, + ERROR: 5, + UNKNOWN: 6, + }, + stateIcons: { + 0: 'radiobox-blank', + 1: 'progress-check', + 2: 'alert-circle-outline', + 3: 'check-circle', + 4: 'alert-octagram-outline', + 5: 'alert', + 6: 'help-circle-outline', + }, }; diff --git a/src/constants/Update.js b/src/constants/Update.js index ce38d7a..7becdb5 100644 --- a/src/constants/Update.js +++ b/src/constants/Update.js @@ -1,6 +1,6 @@ // @flow -import i18n from "i18n-js"; +import i18n from 'i18n-js'; /** * Singleton used to manage update slides. @@ -14,51 +14,47 @@ import i18n from "i18n-js"; * */ export default class Update { + // Increment the number to show the update slide + static number = 6; - // Increment the number to show the update slide - static number = 6; - // Change the number of slides to display - static slidesNumber = 4; - // Change the icons to be displayed on the update slide - static iconList = [ - 'star', - 'clock', - 'qrcode-scan', - 'account', - ]; - static colorsList = [ - ['#e01928', '#be1522'], - ['#7c33ec', '#5e11d1'], - ['#337aec', '#114ed1'], - ['#e01928', '#be1522'], - ] + // Change the number of slides to display + static slidesNumber = 4; - static instance: Update | null = null; + // Change the icons to be displayed on the update slide + static iconList = ['star', 'clock', 'qrcode-scan', 'account']; - titleList: Array; - descriptionList: Array; + static colorsList = [ + ['#e01928', '#be1522'], + ['#7c33ec', '#5e11d1'], + ['#337aec', '#114ed1'], + ['#e01928', '#be1522'], + ]; - /** - * Init translations - */ - constructor() { - this.titleList = []; - this.descriptionList = []; - for (let i = 0; i < Update.slidesNumber; i++) { - this.titleList.push(i18n.t('intro.updateSlide' + i + '.title')) - this.descriptionList.push(i18n.t('intro.updateSlide' + i + '.text')) - } + static instance: Update | null = null; + + titleList: Array; + + descriptionList: Array; + + /** + * Init translations + */ + constructor() { + this.titleList = []; + this.descriptionList = []; + for (let i = 0; i < Update.slidesNumber; i += 1) { + this.titleList.push(i18n.t(`intro.updateSlide${i}.title`)); + this.descriptionList.push(i18n.t(`intro.updateSlide${i}.text`)); } + } - /** - * Get this class instance or create one if none is found - * - * @returns {Update} - */ - static getInstance(): Update { - return Update.instance === null ? - Update.instance = new Update() : - Update.instance; - } - -}; + /** + * Get this class instance or create one if none is found + * + * @returns {Update} + */ + static getInstance(): Update { + if (Update.instance == null) Update.instance = new Update(); + return Update.instance; + } +}