Browse Source

Improve constants to match linter

Arnaud Vergnet 3 years ago
parent
commit
7ac62b99f4
3 changed files with 69 additions and 73 deletions
  1. 12
    12
      src/constants/AvailableWebsites.js
  2. 18
    18
      src/constants/ProxiwashConstants.js
  3. 39
    43
      src/constants/Update.js

+ 12
- 12
src/constants/AvailableWebsites.js View File

@@ -1,13 +1,13 @@
1 1
 export default {
2
-    websites: {
3
-        AMICALE: "https://www.amicale-insat.fr/",
4
-        AVAILABLE_ROOMS: "http://planex.insa-toulouse.fr/salles.php",
5
-        BIB: "https://bibbox.insa-toulouse.fr/",
6
-        BLUEMIND: "https://etud-mel.insa-toulouse.fr/webmail/",
7
-        ELUS_ETUDIANTS: "https://etud.insa-toulouse.fr/~eeinsat/",
8
-        ENT: "https://ent.insa-toulouse.fr/",
9
-        INSA_ACCOUNT: "https://moncompte.insa-toulouse.fr/",
10
-        TUTOR_INSA: "https://www.etud.insa-toulouse.fr/~tutorinsa/",
11
-        WIKETUD: "https://wiki.etud.insa-toulouse.fr/",
12
-    },
13
-}
2
+  websites: {
3
+    AMICALE: 'https://www.amicale-insat.fr/',
4
+    AVAILABLE_ROOMS: 'http://planex.insa-toulouse.fr/salles.php',
5
+    BIB: 'https://bibbox.insa-toulouse.fr/',
6
+    BLUEMIND: 'https://etud-mel.insa-toulouse.fr/webmail/',
7
+    ELUS_ETUDIANTS: 'https://etud.insa-toulouse.fr/~eeinsat/',
8
+    ENT: 'https://ent.insa-toulouse.fr/',
9
+    INSA_ACCOUNT: 'https://moncompte.insa-toulouse.fr/',
10
+    TUTOR_INSA: 'https://www.etud.insa-toulouse.fr/~tutorinsa/',
11
+    WIKETUD: 'https://wiki.etud.insa-toulouse.fr/',
12
+  },
13
+};

+ 18
- 18
src/constants/ProxiwashConstants.js View File

@@ -1,20 +1,20 @@
1 1
 export default {
2
-    machineStates: {
3
-        "AVAILABLE": 0,
4
-        "RUNNING": 1,
5
-        "RUNNING_NOT_STARTED": 2,
6
-        "FINISHED": 3,
7
-        "UNAVAILABLE": 4,
8
-        "ERROR": 5,
9
-        "UNKNOWN": 6,
10
-    },
11
-    stateIcons: {
12
-        0: 'radiobox-blank',
13
-        1: 'progress-check',
14
-        2: 'alert-circle-outline',
15
-        3: 'check-circle',
16
-        4: 'alert-octagram-outline',
17
-        5: 'alert',
18
-        6: 'help-circle-outline',
19
-    }
2
+  machineStates: {
3
+    AVAILABLE: 0,
4
+    RUNNING: 1,
5
+    RUNNING_NOT_STARTED: 2,
6
+    FINISHED: 3,
7
+    UNAVAILABLE: 4,
8
+    ERROR: 5,
9
+    UNKNOWN: 6,
10
+  },
11
+  stateIcons: {
12
+    0: 'radiobox-blank',
13
+    1: 'progress-check',
14
+    2: 'alert-circle-outline',
15
+    3: 'check-circle',
16
+    4: 'alert-octagram-outline',
17
+    5: 'alert',
18
+    6: 'help-circle-outline',
19
+  },
20 20
 };

+ 39
- 43
src/constants/Update.js View File

@@ -1,6 +1,6 @@
1 1
 // @flow
2 2
 
3
-import i18n from "i18n-js";
3
+import i18n from 'i18n-js';
4 4
 
5 5
 /**
6 6
  * Singleton used to manage update slides.
@@ -14,51 +14,47 @@ import i18n from "i18n-js";
14 14
  * </ul>
15 15
  */
16 16
 export default class Update {
17
+  // Increment the number to show the update slide
18
+  static number = 6;
17 19
 
18
-    // Increment the number to show the update slide
19
-    static number = 6;
20
-    // Change the number of slides to display
21
-    static slidesNumber = 4;
22
-    // Change the icons to be displayed on the update slide
23
-    static iconList = [
24
-        'star',
25
-        'clock',
26
-        'qrcode-scan',
27
-        'account',
28
-    ];
29
-    static colorsList = [
30
-        ['#e01928', '#be1522'],
31
-        ['#7c33ec', '#5e11d1'],
32
-        ['#337aec', '#114ed1'],
33
-        ['#e01928', '#be1522'],
34
-    ]
20
+  // Change the number of slides to display
21
+  static slidesNumber = 4;
35 22
 
36
-    static instance: Update | null = null;
23
+  // Change the icons to be displayed on the update slide
24
+  static iconList = ['star', 'clock', 'qrcode-scan', 'account'];
37 25
 
38
-    titleList: Array<string>;
39
-    descriptionList: Array<string>;
26
+  static colorsList = [
27
+    ['#e01928', '#be1522'],
28
+    ['#7c33ec', '#5e11d1'],
29
+    ['#337aec', '#114ed1'],
30
+    ['#e01928', '#be1522'],
31
+  ];
40 32
 
41
-    /**
42
-     * Init translations
43
-     */
44
-    constructor() {
45
-        this.titleList = [];
46
-        this.descriptionList = [];
47
-        for (let i = 0; i < Update.slidesNumber; i++) {
48
-            this.titleList.push(i18n.t('intro.updateSlide' + i + '.title'))
49
-            this.descriptionList.push(i18n.t('intro.updateSlide' + i + '.text'))
50
-        }
51
-    }
33
+  static instance: Update | null = null;
52 34
 
53
-    /**
54
-     * Get this class instance or create one if none is found
55
-     *
56
-     * @returns {Update}
57
-     */
58
-    static getInstance(): Update {
59
-        return Update.instance === null ?
60
-            Update.instance = new Update() :
61
-            Update.instance;
62
-    }
35
+  titleList: Array<string>;
63 36
 
64
-};
37
+  descriptionList: Array<string>;
38
+
39
+  /**
40
+   * Init translations
41
+   */
42
+  constructor() {
43
+    this.titleList = [];
44
+    this.descriptionList = [];
45
+    for (let i = 0; i < Update.slidesNumber; i += 1) {
46
+      this.titleList.push(i18n.t(`intro.updateSlide${i}.title`));
47
+      this.descriptionList.push(i18n.t(`intro.updateSlide${i}.text`));
48
+    }
49
+  }
50
+
51
+  /**
52
+   * Get this class instance or create one if none is found
53
+   *
54
+   * @returns {Update}
55
+   */
56
+  static getInstance(): Update {
57
+    if (Update.instance == null) Update.instance = new Update();
58
+    return Update.instance;
59
+  }
60
+}

Loading…
Cancel
Save