Browse Source

Improved website handling

Arnaud Vergnet 1 year ago
parent
commit
d622a2f77a

+ 13
- 0
src/constants/AvailableWebsites.js View File

@@ -0,0 +1,13 @@
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
+}

+ 4
- 21
src/navigation/MainNavigator.js View File

@@ -12,24 +12,17 @@ import TetrisScreen from "../screens/Tetris/TetrisScreen";
12 12
 import VoteScreen from "../screens/Amicale/VoteScreen";
13 13
 import LoginScreen from "../screens/Amicale/LoginScreen";
14 14
 import {Platform} from "react-native";
15
-import AvailableRoomScreen from "../screens/Services/Websites/AvailableRoomScreen";
16
-import BibScreen from "../screens/Services/Websites/BibScreen";
17 15
 import SelfMenuScreen from "../screens/Services/SelfMenuScreen";
18 16
 import ProximoMainScreen from "../screens/Services/Proximo/ProximoMainScreen";
19 17
 import ProximoListScreen from "../screens/Services/Proximo/ProximoListScreen";
20 18
 import ProximoAboutScreen from "../screens/Services/Proximo/ProximoAboutScreen";
21
-import {AmicaleWebsiteScreen} from "../screens/Services/Websites/AmicaleWebsiteScreen";
22
-import {ElusEtudiantsWebsiteScreen} from "../screens/Services/Websites/ElusEtudiantsWebsiteScreen";
23
-import {WiketudWebsiteScreen} from "../screens/Services/Websites/WiketudWebsiteScreen";
24
-import {TutorInsaWebsiteScreen} from "../screens/Services/Websites/TutorInsaWebsiteScreen";
25
-import {ENTWebsiteScreen} from "../screens/Services/Websites/ENTWebsiteScreen";
26
-import {BlueMindWebsiteScreen} from "../screens/Services/Websites/BlueMindWebsiteScreen";
27 19
 import ProfileScreen from "../screens/Amicale/ProfileScreen";
28 20
 import ClubListScreen from "../screens/Amicale/Clubs/ClubListScreen";
29 21
 import ClubAboutScreen from "../screens/Amicale/Clubs/ClubAboutScreen";
30 22
 import ClubDisplayScreen from "../screens/Amicale/Clubs/ClubDisplayScreen";
31 23
 import {createScreenCollapsibleStack, getWebsiteStack} from "../utils/CollapsibleUtils";
32 24
 import BugReportScreen from "../screens/Other/FeedbackScreen";
25
+import WebsiteScreen from "../screens/Services/WebsiteScreen";
33 26
 
34 27
 const modalTransition = Platform.OS === 'ios' ? TransitionPresets.ModalPresentationIOS : TransitionPresets.ModalSlideFromBottomIOS;
35 28
 
@@ -102,12 +95,10 @@ function MainStackComponent(props: { createTabNavigator: () => React.Node }) {
102 95
                 }}
103 96
             />
104 97
 
105
-            {/*     INSA        */}
106
-            {getWebsiteStack("available-rooms", MainStack, AvailableRoomScreen, i18n.t('screens.availableRooms'))}
107
-            {getWebsiteStack("bib", MainStack, BibScreen, i18n.t('screens.bib'))}
108
-            {createScreenCollapsibleStack("self-menu", MainStack, SelfMenuScreen, i18n.t('screens.menuSelf'))}
98
+            {getWebsiteStack("website", MainStack, WebsiteScreen, "")}
99
+
109 100
 
110
-            {/*     STUDENTS     */}
101
+            {createScreenCollapsibleStack("self-menu", MainStack, SelfMenuScreen, i18n.t('screens.menuSelf'))}
111 102
             {createScreenCollapsibleStack("proximo", MainStack, ProximoMainScreen, i18n.t('screens.proximo'))}
112 103
             {createScreenCollapsibleStack(
113 104
                 "proximo-list",
@@ -125,15 +116,7 @@ function MainStackComponent(props: { createTabNavigator: () => React.Node }) {
125 116
                     ...modalTransition,
126 117
                 }}
127 118
             />
128
-            {getWebsiteStack("amicale-website", MainStack, AmicaleWebsiteScreen, i18n.t('screens.amicaleWebsite'))}
129
-            {getWebsiteStack("elus-etudiants", MainStack, ElusEtudiantsWebsiteScreen, "Élus Étudiants")}
130
-            {getWebsiteStack("wiketud", MainStack, WiketudWebsiteScreen, "Wiketud")}
131
-            {getWebsiteStack("tutorinsa", MainStack, TutorInsaWebsiteScreen, "Tutor'INSA")}
132
-            {getWebsiteStack("ent", MainStack, ENTWebsiteScreen, i18n.t('screens.ent'))}
133
-            {getWebsiteStack("bluemind", MainStack, BlueMindWebsiteScreen, i18n.t('screens.bluemind'))}
134
-
135 119
 
136
-            {/*     AMICALE     */}
137 120
             {createScreenCollapsibleStack("profile", MainStack, ProfileScreen, i18n.t('screens.profile'))}
138 121
             {createScreenCollapsibleStack("club-list", MainStack, ClubListScreen, i18n.t('clubs.clubList'))}
139 122
             <MainStack.Screen

+ 2
- 1
src/screens/Amicale/LoginScreen.js View File

@@ -12,6 +12,7 @@ import CustomTabBar from "../../components/Tabbar/CustomTabBar";
12 12
 import type {CustomTheme} from "../../managers/ThemeManager";
13 13
 import AsyncStorageManager from "../../managers/AsyncStorageManager";
14 14
 import {StackNavigationProp} from "@react-navigation/stack";
15
+import AvailableWebsites from "../../constants/AvailableWebsites";
15 16
 
16 17
 type Props = {
17 18
     navigation: StackNavigationProp,
@@ -110,7 +111,7 @@ class LoginScreen extends React.Component<Props, State> {
110 111
     /**
111 112
      * Navigates to the Amicale website screen with the reset password link as navigation parameters
112 113
      */
113
-    onResetPasswordClick = () => this.props.navigation.navigate('amicale-website', {path: RESET_PASSWORD_PATH});
114
+    onResetPasswordClick = () => this.props.navigation.navigate("website", {host: AvailableWebsites.websites.AMICALE, path: RESET_PASSWORD_PATH, title: i18n.t('screens.amicaleWebsite')});
114 115
 
115 116
     /**
116 117
      * The user has unfocused the input, his email is ready to be validated

+ 3
- 2
src/screens/Amicale/ProfileScreen.js View File

@@ -14,6 +14,7 @@ import type {cardList} from "../../components/Lists/CardList/CardList";
14 14
 import CardList from "../../components/Lists/CardList/CardList";
15 15
 import {StackNavigationProp} from "@react-navigation/stack";
16 16
 import type {CustomTheme} from "../../managers/ThemeManager";
17
+import AvailableWebsites from "../../constants/AvailableWebsites";
17 18
 
18 19
 type Props = {
19 20
     navigation: StackNavigationProp,
@@ -83,7 +84,7 @@ class ProfileScreen extends React.Component<Props, State> {
83 84
                 title: i18n.t('screens.amicaleWebsite'),
84 85
                 subtitle: i18n.t('servicesScreen.descriptions.amicaleWebsite'),
85 86
                 image: ICON_AMICALE,
86
-                onPress: () => this.props.navigation.navigate("amicale-website"),
87
+                onPress: () => this.props.navigation.navigate("website", {host: AvailableWebsites.websites.AMICALE, title: i18n.t('screens.amicaleWebsite')}),
87 88
             },
88 89
         ];
89 90
     }
@@ -287,7 +288,7 @@ class ProfileScreen extends React.Component<Props, State> {
287 288
                         <Button
288 289
                             icon="account-edit"
289 290
                             mode="contained"
290
-                            onPress={() => this.props.navigation.navigate('amicale-website', {path: this.data.link})}
291
+                            onPress={() => this.props.navigation.navigate("website", {host: AvailableWebsites.websites.AMICALE, path: this.data.link, title: i18n.t('screens.amicaleWebsite')})}
291 292
                             style={styles.editButton}>
292 293
                             {i18n.t("profileScreen.editInformation")}
293 294
                         </Button>

+ 2
- 1
src/screens/Home/HomeScreen.js View File

@@ -22,6 +22,7 @@ import LogoutDialog from "../../components/Amicale/LogoutDialog";
22 22
 import {withCollapsible} from "../../utils/withCollapsible";
23 23
 import {Collapsible} from "react-navigation-collapsible";
24 24
 import AsyncStorageManager from "../../managers/AsyncStorageManager";
25
+import AvailableWebsites from "../../constants/AvailableWebsites";
25 26
 // import DATA from "../dashboard_data.json";
26 27
 
27 28
 
@@ -217,7 +218,7 @@ class HomeScreen extends React.Component<Props, State> {
217 218
     };
218 219
 
219 220
     onTutorInsaClick = () => {
220
-        this.props.navigation.navigate("tutorinsa");
221
+        this.props.navigation.navigate("website", {host: AvailableWebsites.websites.TUTOR_INSA, title: "Tutor'INSA"});
221 222
     };
222 223
 
223 224
     onMenuClick = () => {

+ 16
- 8
src/screens/Services/ServicesScreen.js View File

@@ -13,6 +13,7 @@ import i18n from 'i18n-js';
13 13
 import MaterialHeaderButtons, {Item} from "../../components/Overrides/CustomHeaderButton";
14 14
 import ConnectionManager from "../../managers/ConnectionManager";
15 15
 import {StackNavigationProp} from "@react-navigation/stack";
16
+import AvailableWebsites from "../../constants/AvailableWebsites";
16 17
 
17 18
 type Props = {
18 19
     navigation: StackNavigationProp,
@@ -43,6 +44,7 @@ const RU_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/RU.png";
43 44
 const ROOM_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Salles.png";
44 45
 const EMAIL_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Bluemind.png";
45 46
 const ENT_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/ENT.png";
47
+const ACCOUNT_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Account.png";
46 48
 
47 49
 class ServicesScreen extends React.Component<Props> {
48 50
 
@@ -72,7 +74,7 @@ class ServicesScreen extends React.Component<Props> {
72 74
                 title: i18n.t('screens.amicaleWebsite'),
73 75
                 subtitle: i18n.t('servicesScreen.descriptions.amicaleWebsite'),
74 76
                 image: AMICALE_IMAGE,
75
-                onPress: () => nav.navigate("amicale-website"),
77
+                onPress: () => nav.navigate("website", {host: AvailableWebsites.websites.AMICALE, title: i18n.t('screens.amicaleWebsite')}),
76 78
             },
77 79
             {
78 80
                 title: i18n.t('screens.vote'),
@@ -92,19 +94,19 @@ class ServicesScreen extends React.Component<Props> {
92 94
                 title: "Wiketud",
93 95
                 subtitle: i18n.t('servicesScreen.descriptions.wiketud'),
94 96
                 image: WIKETUD_IMAGE,
95
-                onPress: () => nav.navigate("wiketud"),
97
+                onPress: () => nav.navigate("website", {host: AvailableWebsites.websites.WIKETUD, title: "Wiketud"}),
96 98
             },
97 99
             {
98 100
                 title: "Élus Étudiants",
99 101
                 subtitle: i18n.t('servicesScreen.descriptions.elusEtudiants'),
100 102
                 image: EE_IMAGE,
101
-                onPress: () => nav.navigate("elus-etudiants"),
103
+                onPress: () => nav.navigate("website", {host: AvailableWebsites.websites.ELUS_ETUDIANTS, title: "Élus Étudiants"}),
102 104
             },
103 105
             {
104 106
                 title: "Tutor'INSA",
105 107
                 subtitle: i18n.t('servicesScreen.descriptions.tutorInsa'),
106 108
                 image: TUTORINSA_IMAGE,
107
-                onPress: () => nav.navigate("tutorinsa"),
109
+                onPress: () => nav.navigate("website", {host: AvailableWebsites.websites.TUTOR_INSA, title: "Tutor'INSA"})
108 110
             },
109 111
         ];
110 112
         this.insaDataset = [
@@ -118,25 +120,31 @@ class ServicesScreen extends React.Component<Props> {
118 120
                 title: i18n.t('screens.availableRooms'),
119 121
                 subtitle: i18n.t('servicesScreen.descriptions.availableRooms'),
120 122
                 image: ROOM_IMAGE,
121
-                onPress: () => nav.navigate("available-rooms"),
123
+                onPress: () => nav.navigate("website", {host: AvailableWebsites.websites.AVAILABLE_ROOMS, title: i18n.t('screens.availableRooms')}),
122 124
             },
123 125
             {
124 126
                 title: i18n.t('screens.bib'),
125 127
                 subtitle: i18n.t('servicesScreen.descriptions.bib'),
126 128
                 image: BIB_IMAGE,
127
-                onPress: () => nav.navigate("bib"),
129
+                onPress: () => nav.navigate("website", {host: AvailableWebsites.websites.BIB, title: i18n.t('screens.bib')}),
128 130
             },
129 131
             {
130 132
                 title: i18n.t('screens.bluemind'),
131 133
                 subtitle: i18n.t('servicesScreen.descriptions.mails'),
132 134
                 image: EMAIL_IMAGE,
133
-                onPress: () => nav.navigate("bluemind"),
135
+                onPress: () => nav.navigate("website", {host: AvailableWebsites.websites.BLUEMIND, title: i18n.t('screens.bluemind')}),
134 136
             },
135 137
             {
136 138
                 title: i18n.t('screens.ent'),
137 139
                 subtitle: i18n.t('servicesScreen.descriptions.ent'),
138 140
                 image: ENT_IMAGE,
139
-                onPress: () => nav.navigate("ent"),
141
+                onPress: () => nav.navigate("website", {host: AvailableWebsites.websites.ENT, title: i18n.t('screens.ent')}),
142
+            },
143
+            {
144
+                title: i18n.t('screens.insaAccount'),
145
+                subtitle: i18n.t('servicesScreen.descriptions.insaAccount'),
146
+                image: ACCOUNT_IMAGE,
147
+                onPress: () => nav.navigate("website", {host: AvailableWebsites.websites.INSA_ACCOUNT, title: i18n.t('screens.insaAccount')}),
140 148
             },
141 149
         ];
142 150
         this.finalDataset = [

+ 109
- 0
src/screens/Services/WebsiteScreen.js View File

@@ -0,0 +1,109 @@
1
+// @flow
2
+
3
+
4
+import * as React from 'react';
5
+import {StackNavigationProp} from "@react-navigation/stack";
6
+import WebViewScreen from "../../components/Screens/WebViewScreen";
7
+import AvailableWebsites from "../../constants/AvailableWebsites";
8
+import BasicLoadingScreen from "../../components/Screens/BasicLoadingScreen";
9
+
10
+type Props = {
11
+    navigation: StackNavigationProp,
12
+    route: { params: { host: string, path: string | null, title: string } },
13
+}
14
+
15
+class WebsiteScreen extends React.Component<Props> {
16
+
17
+    fullUrl: string;
18
+    injectedJS: { [key: string]: string };
19
+    customPaddingFunctions: {[key: string]: (padding: string) => string}
20
+
21
+    host: string;
22
+
23
+    constructor(props: Props) {
24
+        super(props);
25
+        this.props.navigation.addListener('focus', this.onScreenFocus);
26
+        this.injectedJS = {};
27
+        this.customPaddingFunctions = {};
28
+        this.injectedJS[AvailableWebsites.websites.AVAILABLE_ROOMS] =
29
+            'document.querySelector(\'head\').innerHTML += \'<meta name="viewport" content="width=device-width, initial-scale=1.0">\';' +
30
+            'document.querySelector(\'head\').innerHTML += \'<style>body,body>.container2{padding-top:0;width:100%}b,body>.container2>h1,body>.container2>h3,br,header{display:none}.table-bordered td,.table-bordered th{border:none;border-right:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.table{padding:0;margin:0;width:200%;max-width:200%;display:block}tbody{display:block;width:100%}thead{display:block;width:100%}.table tbody tr,tbody tr[bgcolor],thead tr{width:100%;display:inline-flex}.table tbody td,.table thead td[colspan]{padding:0;flex:1;height:50px;margin:0}.table tbody td[bgcolor=white],.table thead td,.table>tbody>tr>td:nth-child(1){flex:0 0 150px;height:50px}</style>\'; true;';
31
+
32
+        this.injectedJS[AvailableWebsites.websites.BIB] =
33
+            'document.querySelector(\'head\').innerHTML += \'<meta name="viewport" content="width=device-width, initial-scale=1.0">\';' +
34
+            'document.querySelector(\'head\').innerHTML += \'<style>.hero-unit,.navbar,footer{display:none}.hero-unit-form,.hero-unit2,.hero-unit3{background-color:#fff;box-shadow:none;padding:0;margin:0}.hero-unit-form h4{font-size:2rem;line-height:2rem}.btn{font-size:1.5rem;line-height:1.5rem;padding:20px}.btn-danger{background-image:none;background-color:#be1522}.table{font-size:.8rem}.table td{padding:0;height:18.2333px;border:none;border-bottom:1px solid #c1c1c1}.table td[style="max-width:55px;"]{max-width:110px!important}.table-bordered{min-width:50px}th{height:50px}.table-bordered{border-collapse:collapse}</style>\';' +
35
+            'if ($(".hero-unit-form").length > 0 && $("#customBackButton").length === 0)' +
36
+            '$(".hero-unit-form").append("' +
37
+            '<div style=\'width: 100%; display: flex\'>' +
38
+            '<a style=\'margin: auto\' href=\'' + AvailableWebsites.websites.BIB + '\'>' +
39
+            '<button id=\'customBackButton\' class=\'btn btn-primary\'>Retour</button>' +
40
+            '</a>' +
41
+            '</div>");true;';
42
+
43
+        this.customPaddingFunctions[AvailableWebsites.websites.BLUEMIND] = (padding: string) => {
44
+            return (
45
+                "$('head').append('<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">');" +
46
+                "$('.minwidth').css('top', " + padding + ");" +
47
+                "$('#mailview-bottom').css('min-height', 500);"
48
+            );
49
+        };
50
+        this.customPaddingFunctions[AvailableWebsites.websites.WIKETUD] = (padding: string) => {
51
+            return (
52
+                "$('#p-logo-text').css('top', 10 + " + padding + ");" +
53
+                "$('#site-navigation h2').css('top', 10 + " + padding + ");" +
54
+                "$('#site-tools h2').css('top', 10 + " + padding + ");" +
55
+                "$('#user-tools h2').css('top', 10 + " + padding + ");"
56
+            );
57
+        }
58
+    }
59
+
60
+    onScreenFocus = () => {
61
+        this.handleNavigationParams();
62
+    };
63
+
64
+    /**
65
+     *
66
+     */
67
+    handleNavigationParams() {
68
+        if (this.props.route.params != null) {
69
+            this.host = this.props.route.params.host;
70
+            let path = this.props.route.params.path;
71
+            const title = this.props.route.params.title;
72
+            if (this.host != null && path != null) {
73
+                path = path.replace(this.host, "");
74
+                this.fullUrl = this.host + path;
75
+            }else
76
+                this.fullUrl = this.host;
77
+
78
+            if (title != null)
79
+                this.props.navigation.setOptions({title: title});
80
+        }
81
+    }
82
+
83
+    render() {
84
+        let injectedJavascript = "";
85
+        let customPadding = null;
86
+        if (this.host != null && this.injectedJS[this.host] != null)
87
+            injectedJavascript = this.injectedJS[this.host];
88
+        if (this.host != null && this.customPaddingFunctions[this.host] != null)
89
+            customPadding = this.customPaddingFunctions[this.host];
90
+
91
+        if (this.fullUrl != null) {
92
+            return (
93
+                <WebViewScreen
94
+                    {...this.props}
95
+                    url={this.fullUrl}
96
+                    customJS={injectedJavascript}
97
+                    customPaddingFunction={customPadding}
98
+                />
99
+            );
100
+        } else {
101
+            return (
102
+                <BasicLoadingScreen/>
103
+            );
104
+        }
105
+
106
+    }
107
+}
108
+
109
+export default WebsiteScreen;

+ 0
- 25
src/screens/Services/Websites/AmicaleWebsiteScreen.js View File

@@ -1,25 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import WebViewScreen from "../../../components/Screens/WebViewScreen";
5
-
6
-const URL = 'https://www.amicale-insat.fr/';
7
-/**
8
- * Class defining the app's available rooms screen.
9
- * This screen uses a webview to render the page
10
- */
11
-export const AmicaleWebsiteScreen = (props: Object) => {
12
-    let path = '';
13
-    if (props.route.params !== undefined) {
14
-        if (props.route.params.path !== undefined && props.route.params.path !== null) {
15
-            path = props.route.params.path;
16
-            path = path.replace(URL, '');
17
-        }
18
-    }
19
-    return (
20
-        <WebViewScreen
21
-            {...props}
22
-            url={URL + path}/>
23
-    );
24
-};
25
-

+ 0
- 45
src/screens/Services/Websites/AvailableRoomScreen.js View File

@@ -1,45 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import WebViewScreen from "../../../components/Screens/WebViewScreen";
5
-
6
-type Props = {
7
-    navigation: Object,
8
-}
9
-
10
-
11
-const ROOM_URL = 'http://planex.insa-toulouse.fr/salles.php';
12
-const CUSTOM_CSS_GENERAL = 'https://etud.insa-toulouse.fr/~amicale_app/custom_css/rooms/customMobile2.css';
13
-
14
-/**
15
- * Class defining the app's available rooms screen.
16
- * This screen uses a webview to render the page
17
- */
18
-export default class AvailableRoomScreen extends React.Component<Props> {
19
-
20
-    customInjectedJS: string;
21
-
22
-    /**
23
-     * Defines custom injected JavaScript to improve the page display on mobile
24
-     */
25
-    constructor() {
26
-        super();
27
-        this.customInjectedJS =
28
-            'document.querySelector(\'head\').innerHTML += \'<meta name="viewport" content="width=device-width, initial-scale=1.0">\';' +
29
-            'document.querySelector(\'head\').innerHTML += \'<link rel="stylesheet" href="' + CUSTOM_CSS_GENERAL + '" type="text/css"/>\';' +
30
-            'let header = $(".table tbody tr:first");' +
31
-            '$("table").prepend("<thead></thead>");true;' + // Fix for crash on ios
32
-            '$("thead").append(header);true;';
33
-    }
34
-
35
-    render() {
36
-        const nav = this.props.navigation;
37
-        return (
38
-            <WebViewScreen
39
-                navigation={nav}
40
-                url={ROOM_URL}
41
-                customJS={this.customInjectedJS}/>
42
-        );
43
-    }
44
-}
45
-

+ 0
- 57
src/screens/Services/Websites/BibScreen.js View File

@@ -1,57 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import WebViewScreen from "../../../components/Screens/WebViewScreen";
5
-
6
-type Props = {
7
-    navigation: Object,
8
-}
9
-
10
-const BIB_URL = 'https://bibbox.insa-toulouse.fr/';
11
-const CUSTOM_CSS_GENERAL = 'https://etud.insa-toulouse.fr/~amicale_app/custom_css/rooms/customMobile.css';
12
-const CUSTOM_CSS_Bib = 'https://etud.insa-toulouse.fr/~amicale_app/custom_css/rooms/customBibMobile.css';
13
-
14
-/**
15
- * Class defining the app's Bib screen.
16
- * This screen uses a webview to render the page
17
- */
18
-export default class AvailableRoomScreen extends React.Component<Props> {
19
-
20
-    customInjectedJS: string;
21
-    customBibInjectedJS: string;
22
-
23
-    /**
24
-     * Defines custom injected JavaScript to improve the page display on mobile
25
-     */
26
-    constructor() {
27
-        super();
28
-        this.customInjectedJS =
29
-            'document.querySelector(\'head\').innerHTML += \'<meta name="viewport" content="width=device-width, initial-scale=1.0">\';' +
30
-            'document.querySelector(\'head\').innerHTML += \'<link rel="stylesheet" href="' + CUSTOM_CSS_GENERAL + '" type="text/css"/>\';' +
31
-            'let header = $(".table tbody tr:first");' +
32
-            '$("table").prepend("<thead></thead>");true;' + // Fix for crash on ios
33
-            '$("thead").append(header);true;';
34
-
35
-        this.customBibInjectedJS =
36
-            'document.querySelector(\'head\').innerHTML += \'<meta name="viewport" content="width=device-width, initial-scale=1.0">\';' +
37
-            'document.querySelector(\'head\').innerHTML += \'<link rel="stylesheet" href="' + CUSTOM_CSS_Bib + '" type="text/css"/>\';' +
38
-            'if ($(".hero-unit-form").length > 0 && $("#customBackButton").length === 0)' +
39
-            '$(".hero-unit-form").append("' +
40
-            '<div style=\'width: 100%; display: flex\'>' +
41
-            '<a style=\'margin: auto\' href=\'' + BIB_URL + '\'>' +
42
-            '<button id=\'customBackButton\' class=\'btn btn-primary\'>Retour</button>' +
43
-            '</a>' +
44
-            '</div>");true;';
45
-    }
46
-
47
-    render() {
48
-        const nav = this.props.navigation;
49
-        return (
50
-            <WebViewScreen
51
-                navigation={nav}
52
-                url={BIB_URL}
53
-                customJS={this.customBibInjectedJS}/>
54
-        );
55
-    }
56
-}
57
-

+ 0
- 28
src/screens/Services/Websites/BlueMindWebsiteScreen.js View File

@@ -1,28 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import WebViewScreen from "../../../components/Screens/WebViewScreen";
5
-
6
-const URL = 'https://etud-mel.insa-toulouse.fr/webmail/';
7
-
8
-const customPadding = (padding: string) => {
9
-    return (
10
-        "$('head').append('<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">');" +
11
-        "$('.minwidth').css('top', " + padding + ");" +
12
-        "$('#mailview-bottom').css('min-height', 500);"
13
-    );
14
-}
15
-
16
-/**
17
- * Class defining the app's available rooms screen.
18
- * This screen uses a webview to render the page
19
- */
20
-export const BlueMindWebsiteScreen = (props: Object) => {
21
-    return (
22
-        <WebViewScreen
23
-            {...props}
24
-            customPaddingFunction={customPadding}
25
-            url={URL}/>
26
-    );
27
-};
28
-

+ 0
- 18
src/screens/Services/Websites/ENTWebsiteScreen.js View File

@@ -1,18 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import WebViewScreen from "../../../components/Screens/WebViewScreen";
5
-
6
-const URL = 'https://ent.insa-toulouse.fr/';
7
-/**
8
- * Class defining the app's available rooms screen.
9
- * This screen uses a webview to render the page
10
- */
11
-export const ENTWebsiteScreen = (props: Object) => {
12
-    return (
13
-        <WebViewScreen
14
-            {...props}
15
-            url={URL}/>
16
-    );
17
-};
18
-

+ 0
- 18
src/screens/Services/Websites/ElusEtudiantsWebsiteScreen.js View File

@@ -1,18 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import WebViewScreen from "../../../components/Screens/WebViewScreen";
5
-
6
-const URL = 'https://etud.insa-toulouse.fr/~eeinsat/';
7
-/**
8
- * Class defining the app's available rooms screen.
9
- * This screen uses a webview to render the page
10
- */
11
-export const ElusEtudiantsWebsiteScreen = (props: Object) => {
12
-    return (
13
-        <WebViewScreen
14
-            {...props}
15
-            url={URL}/>
16
-    );
17
-};
18
-

+ 0
- 18
src/screens/Services/Websites/TutorInsaWebsiteScreen.js View File

@@ -1,18 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import WebViewScreen from "../../../components/Screens/WebViewScreen";
5
-
6
-const URL = 'https://www.etud.insa-toulouse.fr/~tutorinsa/';
7
-/**
8
- * Class defining the app's available rooms screen.
9
- * This screen uses a webview to render the page
10
- */
11
-export const TutorInsaWebsiteScreen = (props: Object) => {
12
-    return (
13
-        <WebViewScreen
14
-            {...props}
15
-            url={URL}/>
16
-    );
17
-};
18
-

+ 0
- 30
src/screens/Services/Websites/WiketudWebsiteScreen.js View File

@@ -1,30 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import WebViewScreen from "../../../components/Screens/WebViewScreen";
5
-
6
-const URL = 'https://wiki.etud.insa-toulouse.fr/';
7
-
8
-const customPadding = (padding: string) => {
9
-    return (
10
-        "$('#p-logo-text').css('top', 10 + " + padding + ");" +
11
-        "$('#site-navigation h2').css('top', 10 + " + padding + ");" +
12
-        "$('#site-tools h2').css('top', 10 + " + padding + ");" +
13
-        "$('#user-tools h2').css('top', 10 + " + padding + ");"
14
-    );
15
-}
16
-
17
-
18
-/**
19
- * Class defining the app's available rooms screen.
20
- * This screen uses a webview to render the page
21
- */
22
-export const WiketudWebsiteScreen = (props: Object) => {
23
-    return (
24
-        <WebViewScreen
25
-            {...props}
26
-            customPaddingFunction={customPadding}
27
-            url={URL}/>
28
-    );
29
-};
30
-

+ 3
- 2
translations/en.json View File

@@ -26,7 +26,7 @@
26 26
     "vote": "Elections",
27 27
     "scanner": "Scanotron 3000",
28 28
     "feedback": "Feedback",
29
-    "map": "Campus Map"
29
+    "insaAccount": "INSA Account"
30 30
   },
31 31
   "intro": {
32 32
     "slideMain": {
@@ -427,7 +427,8 @@
427 427
       "availableRooms": "See how many rooms are free",
428 428
       "bib": "Book a Bib'Box for project work",
429 429
       "mails": "Check your INSA mails",
430
-      "ent": "See your grades"
430
+      "ent": "See your grades",
431
+      "insaAccount": "See your information and change your password"
431 432
     }
432 433
   },
433 434
   "planningScreen": {

+ 3
- 2
translations/fr.json View File

@@ -26,7 +26,7 @@
26 26
     "vote": "Élections",
27 27
     "scanner": "Scanotron 3000",
28 28
     "feedback": "Votre avis",
29
-    "map": "Carte du campus"
29
+    "insaAccount": "Compte INSA"
30 30
   },
31 31
   "intro": {
32 32
     "slideMain": {
@@ -429,7 +429,8 @@
429 429
       "availableRooms": "Vérifiez les salles disponibles",
430 430
       "bib": "Réservez une Bib'Box pour les travaux de groupe",
431 431
       "mails": "Vérifiez vos mails INSA",
432
-      "ent": "Retrouvez vos notes"
432
+      "ent": "Retrouvez vos notes",
433
+      "insaAccount": "Accédez à vos informations et modifiez votre mot de passe"
433 434
     }
434 435
   },
435 436
   "planningScreen": {

Loading…
Cancel
Save