Improve constants to match linter

This commit is contained in:
Arnaud Vergnet 2020-08-04 23:51:32 +02:00
parent aa992d20b2
commit 7ac62b99f4
3 changed files with 69 additions and 73 deletions

View file

@ -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/",
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/',
},
}
};

View file

@ -1,12 +1,12 @@
export default {
machineStates: {
"AVAILABLE": 0,
"RUNNING": 1,
"RUNNING_NOT_STARTED": 2,
"FINISHED": 3,
"UNAVAILABLE": 4,
"ERROR": 5,
"UNKNOWN": 6,
AVAILABLE: 0,
RUNNING: 1,
RUNNING_NOT_STARTED: 2,
FINISHED: 3,
UNAVAILABLE: 4,
ERROR: 5,
UNKNOWN: 6,
},
stateIcons: {
0: 'radiobox-blank',
@ -16,5 +16,5 @@ export default {
4: 'alert-octagram-outline',
5: 'alert',
6: 'help-circle-outline',
}
},
};

View file

@ -1,6 +1,6 @@
// @flow
import i18n from "i18n-js";
import i18n from 'i18n-js';
/**
* Singleton used to manage update slides.
@ -14,28 +14,26 @@ import i18n from "i18n-js";
* </ul>
*/
export default class Update {
// 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 iconList = ['star', 'clock', 'qrcode-scan', 'account'];
static colorsList = [
['#e01928', '#be1522'],
['#7c33ec', '#5e11d1'],
['#337aec', '#114ed1'],
['#e01928', '#be1522'],
]
];
static instance: Update | null = null;
titleList: Array<string>;
descriptionList: Array<string>;
/**
@ -44,9 +42,9 @@ export default class Update {
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'))
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`));
}
}
@ -56,9 +54,7 @@ export default class Update {
* @returns {Update}
*/
static getInstance(): Update {
return Update.instance === null ?
Update.instance = new Update() :
Update.instance;
if (Update.instance == null) Update.instance = new Update();
return Update.instance;
}
}
};