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

View file

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

View file

@ -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";
* </ul>
*/
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<string>;
descriptionList: Array<string>;
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<string>;
descriptionList: Array<string>;
/**
* 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;
}
}