@equinor/mad-core 0.0.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/chunk-3XUVY5MJ.js +16 -0
- package/dist/chunk-4RNGXNYB.js +61 -0
- package/dist/chunk-5IIGFQQJ.js +44 -0
- package/dist/chunk-6GFARWDK.js +30 -0
- package/dist/chunk-6SBQOSWK.js +355 -0
- package/dist/chunk-AEGDSD6N.js +10 -0
- package/dist/{chunk-PEFOX6JA.js → chunk-AM5E5CYS.js} +7 -19
- package/dist/chunk-BIMOM43W.js +9 -0
- package/dist/chunk-DCUF7ZWX.js +15 -0
- package/dist/chunk-DQ6CWJSW.js +53 -0
- package/dist/{chunk-HOPDSUAE.js → chunk-DTXV5LS2.js} +5 -3
- package/dist/{chunk-E36MLVBD.js → chunk-DWAJZVKH.js} +1 -1
- package/dist/{chunk-FQWPBBPB.js → chunk-GSC3O7TW.js} +1 -1
- package/dist/chunk-HGT5ZUYL.js +25 -0
- package/dist/chunk-JPK5SCA5.js +19 -0
- package/dist/{chunk-KXAIAYE4.js → chunk-LSEPBTCQ.js} +17 -11
- package/dist/chunk-MDOJ2W2G.js +23 -0
- package/dist/chunk-N4V52CSH.js +43 -0
- package/dist/{chunk-TLJLKQRN.js → chunk-NLLLEXHT.js} +42 -41
- package/dist/{chunk-3LDWV3SJ.js → chunk-P636GRYJ.js} +18 -18
- package/dist/chunk-PBCPR4ZO.js +8 -0
- package/dist/{chunk-AGAXO3NW.js → chunk-QXK5OE27.js} +5 -1
- package/dist/chunk-T3WC3PE2.js +23 -0
- package/dist/{chunk-FIFUL4JE.js → chunk-V4QL2TIA.js} +20 -4
- package/dist/{chunk-FUGJZRIR.js → chunk-VXUERD3Z.js} +5 -5
- package/dist/{chunk-5QALP2TZ.js → chunk-XR6K2TU2.js} +31 -17
- package/dist/chunk-YY3XXUD6.js +23 -0
- package/dist/components/AnnouncementsProvider.js +2 -2
- package/dist/components/ErrorBoundary.d.ts +3 -0
- package/dist/components/ErrorBoundary.js +7 -0
- package/dist/components/NavigationContainer.d.ts +3 -0
- package/dist/components/NavigationContainer.js +7 -0
- package/dist/components/createCoreStackNavigator.d.ts +1 -1
- package/dist/components/createCoreStackNavigator.js +28 -16
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +46 -23
- package/dist/components/navigation/MadCoreSubHeader.d.ts +2 -0
- package/dist/components/navigation/MadCoreSubHeader.js +7 -0
- package/dist/components/navigation/index.d.ts +1 -0
- package/dist/components/navigation/index.js +11 -0
- package/dist/components/navigation/navigation-creators.d.ts +30 -0
- package/dist/components/navigation/navigation-creators.js +10 -0
- package/dist/components/screens/AboutScreen.js +1 -1
- package/dist/components/screens/CreateIncidentScreen.js +1 -1
- package/dist/components/screens/LoginScreen.js +10 -9
- package/dist/components/screens/language/SelectLanguageScreen.d.ts +2 -0
- package/dist/components/screens/language/SelectLanguageScreen.js +20 -0
- package/dist/components/screens/language/components/SelectLanguageCellGroup.d.ts +7 -0
- package/dist/components/screens/language/components/SelectLanguageCellGroup.js +12 -0
- package/dist/components/screens/release-notes/ChangeLog.js +2 -3
- package/dist/components/screens/release-notes/ReleaseNotesScreen.js +17 -2
- package/dist/components/screens/release-notes/WhatsNewScreen.js +14 -10
- package/dist/components/screens/release-notes/fetchReleaseNotes.d.ts +1 -0
- package/dist/components/screens/release-notes/fetchReleaseNotes.js +4 -2
- package/dist/components/screens/settings/Section.js +3 -3
- package/dist/components/screens/settings/SettingsScreen.js +11 -9
- package/dist/components/screens/settings/index.js +12 -10
- package/dist/components/screens/settings/renderCell.js +1 -1
- package/dist/components/screens/settings/useSignOut.js +3 -3
- package/dist/hooks/UseReleaseNotes.d.ts +6 -0
- package/dist/hooks/UseReleaseNotes.js +17 -0
- package/dist/hooks/index.js +7 -5
- package/dist/hooks/useAccountOrDemoAccount.js +1 -1
- package/dist/hooks/useCoreStackNavigation.d.ts +2 -1
- package/dist/hooks/useCoreStackNavigation.js +6 -4
- package/dist/hooks/useScreenTitleFromDictionary.d.ts +2 -0
- package/dist/hooks/useScreenTitleFromDictionary.js +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +55 -25
- package/dist/language/types.d.ts +2 -0
- package/dist/language/types.js +0 -0
- package/dist/language/useDictionary.d.ts +2 -0
- package/dist/language/useDictionary.js +11 -0
- package/dist/store/demo-mode/demo-mode.js +1 -1
- package/dist/store/demo-mode/index.js +1 -1
- package/dist/store/language/index.d.ts +0 -1
- package/dist/store/language/index.js +6 -9
- package/dist/store/language/language.d.ts +3 -2
- package/dist/store/language/language.js +6 -5
- package/dist/store/mad-config/hooks.d.ts +9 -3
- package/dist/store/mad-config/hooks.js +5 -3
- package/dist/store/mad-config/index.js +5 -4
- package/dist/store/mad-config/mad-config.js +1 -1
- package/dist/store/release-notes/index.js +1 -1
- package/dist/store/release-notes/release-notes.js +1 -1
- package/dist/store/storage.js +1 -1
- package/dist/types.d.ts +19 -1
- package/dist/utils/createMadCoreNavigator.d.ts +2 -2
- package/dist/utils/createMadCoreNavigator.js +24 -15
- package/dist/utils/dateUtils.js +1 -1
- package/dist/utils/getFinalSettingsConfig.js +1 -1
- package/dist/utils/getNavigationRouteForLoginScreen.d.ts +2 -1
- package/dist/utils/getNavigationRouteForLoginScreen.js +8 -2
- package/dist/utils/getNavigationRouteForSelectLanguageScreen.d.ts +2 -0
- package/dist/utils/getNavigationRouteForSelectLanguageScreen.js +7 -0
- package/dist/utils/getNavigationRouteForWhatsNewScreen.d.ts +2 -0
- package/dist/utils/getNavigationRouteForWhatsNewScreen.js +12 -0
- package/dist/utils/getPremadeSettings.d.ts +2 -1
- package/dist/utils/getPremadeSettings.js +2 -2
- package/dist/utils/getRedirectUriFromAuthConfig.d.ts +2 -0
- package/dist/utils/getRedirectUriFromAuthConfig.js +7 -0
- package/dist/utils/madCommonUtils.js +1 -1
- package/package.json +13 -12
- package/dist/chunk-35THIGVH.js +0 -42
- package/dist/chunk-4VKFRNU7.js +0 -10
- package/dist/chunk-CXOQFGMM.js +0 -50
- package/dist/chunk-J53YLHKZ.js +0 -15
- package/dist/chunk-K2H37TUR.js +0 -7
- package/dist/chunk-XYNA7G2L.js +0 -62
- package/dist/store/language/supported-languages.d.ts +0 -11
- package/dist/store/language/supported-languages.js +0 -7
- /package/dist/{chunk-635YONGY.js → chunk-2GCLIPZP.js} +0 -0
- /package/dist/{chunk-USETLDR7.js → chunk-5LTGZQUP.js} +0 -0
- /package/dist/{chunk-UTXWRAEE.js → chunk-BZK6J33D.js} +0 -0
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createNativeStackNavigator
|
|
3
|
+
} from "./chunk-3XUVY5MJ.js";
|
|
1
4
|
import {
|
|
2
5
|
createMadCoreNavigator
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DQ6CWJSW.js";
|
|
4
7
|
import {
|
|
5
8
|
setConfig
|
|
6
9
|
} from "./chunk-ZSTTHIEF.js";
|
|
7
10
|
import {
|
|
8
11
|
__spreadProps,
|
|
9
12
|
__spreadValues
|
|
10
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BZK6J33D.js";
|
|
11
14
|
|
|
12
15
|
// src/components/createCoreStackNavigator.tsx
|
|
13
|
-
import { createNativeStackNavigator } from "@equinor/mad-navigation";
|
|
14
16
|
var createCoreStackNavigator = (config) => {
|
|
15
17
|
setConfig(config);
|
|
16
18
|
const Stack = createNativeStackNavigator();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "./chunk-BZK6J33D.js";
|
|
5
|
+
|
|
6
|
+
// src/components/NavigationContainer.tsx
|
|
7
|
+
import React from "react";
|
|
8
|
+
import {
|
|
9
|
+
NavigationContainer as MadNavigationContainer
|
|
10
|
+
} from "@equinor/mad-navigation";
|
|
11
|
+
import { trackNavigation } from "@equinor/mad-insights";
|
|
12
|
+
var NavigationContainer = (props) => /* @__PURE__ */ React.createElement(
|
|
13
|
+
MadNavigationContainer,
|
|
14
|
+
__spreadProps(__spreadValues({}, props), {
|
|
15
|
+
onRouteChange: (current, prevRoute) => {
|
|
16
|
+
var _a;
|
|
17
|
+
trackNavigation(current);
|
|
18
|
+
(_a = props.onRouteChange) == null ? void 0 : _a.call(props, current, prevRoute);
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
NavigationContainer
|
|
25
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useLanguage
|
|
3
|
+
} from "./chunk-6SBQOSWK.js";
|
|
4
|
+
|
|
5
|
+
// src/components/screens/language/components/SelectLanguageCellGroup.tsx
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { Cell, Typography, Radio } from "@equinor/mad-components";
|
|
8
|
+
var SelectLanguageCellGroup = ({ selectedLanguageCodeDraft, setSelectedLanguageCodeDraft }) => {
|
|
9
|
+
const language = useLanguage();
|
|
10
|
+
const supportedLanguages = language.getSupportedLanguages();
|
|
11
|
+
const onPress = (code) => () => setSelectedLanguageCodeDraft(code);
|
|
12
|
+
return /* @__PURE__ */ React.createElement(Cell.Group, null, supportedLanguages.map(
|
|
13
|
+
(language2) => /* @__PURE__ */ React.createElement(Cell, { key: language2.code, rightAdornment: /* @__PURE__ */ React.createElement(Radio, { checked: language2.code === selectedLanguageCodeDraft }), onPress: onPress(language2.code) }, /* @__PURE__ */ React.createElement(Typography, null, language2.name))
|
|
14
|
+
));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
SelectLanguageCellGroup
|
|
19
|
+
};
|
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SettingsSection
|
|
3
|
-
} from "./chunk-E36MLVBD.js";
|
|
4
1
|
import {
|
|
5
2
|
useSignOut
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VXUERD3Z.js";
|
|
4
|
+
import {
|
|
5
|
+
SettingsSection
|
|
6
|
+
} from "./chunk-DWAJZVKH.js";
|
|
7
7
|
import {
|
|
8
8
|
getFinalSettingsConfig
|
|
9
9
|
} from "./chunk-7SJM4NDH.js";
|
|
10
|
-
import {
|
|
11
|
-
useSettingsScreenPremadeConfig
|
|
12
|
-
} from "./chunk-35THIGVH.js";
|
|
13
10
|
import {
|
|
14
11
|
useAccountOrDemoAccount
|
|
15
12
|
} from "./chunk-EQYL7INQ.js";
|
|
13
|
+
import {
|
|
14
|
+
useScreenTitleFromDictionary
|
|
15
|
+
} from "./chunk-MDOJ2W2G.js";
|
|
16
|
+
import {
|
|
17
|
+
useDictionary,
|
|
18
|
+
useSettingsScreenPremadeConfig
|
|
19
|
+
} from "./chunk-6SBQOSWK.js";
|
|
16
20
|
import {
|
|
17
21
|
__spreadValues
|
|
18
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-BZK6J33D.js";
|
|
19
23
|
|
|
20
24
|
// src/components/screens/settings/SettingsScreen.tsx
|
|
21
25
|
import React from "react";
|
|
22
26
|
import { Button, Spacer, Typography } from "@equinor/mad-components";
|
|
23
27
|
import { View, ScrollView } from "react-native";
|
|
24
28
|
var SettingsScreen = ({ config = [], clean = false }) => {
|
|
29
|
+
useScreenTitleFromDictionary((dic) => dic.settings.title);
|
|
30
|
+
const dictionary = useDictionary();
|
|
25
31
|
const signOut = useSignOut();
|
|
26
32
|
const premadeConfig = useSettingsScreenPremadeConfig();
|
|
27
33
|
const account = useAccountOrDemoAccount();
|
|
28
34
|
const finalSettingsConfig = getFinalSettingsConfig(config, premadeConfig, clean);
|
|
29
|
-
return /* @__PURE__ */ React.createElement(ScrollView, { contentInsetAdjustmentBehavior: "automatic" }, /* @__PURE__ */ React.createElement(Spacer, null), finalSettingsConfig.map((section, index) => /* @__PURE__ */ React.createElement(SettingsSection, __spreadValues({ key: index }, section))), /* @__PURE__ */ React.createElement(View, { style: { padding: 30 } }, /* @__PURE__ */ React.createElement(Typography, { bold: true },
|
|
35
|
+
return /* @__PURE__ */ React.createElement(ScrollView, { contentInsetAdjustmentBehavior: "automatic" }, /* @__PURE__ */ React.createElement(Spacer, null), finalSettingsConfig.map((section, index) => /* @__PURE__ */ React.createElement(SettingsSection, __spreadValues({ key: index }, section))), /* @__PURE__ */ React.createElement(View, { style: { padding: 30 } }, /* @__PURE__ */ React.createElement(Typography, { bold: true }, dictionary.settings.loggedInAs), /* @__PURE__ */ React.createElement(Typography, null, account == null ? void 0 : account.username)), /* @__PURE__ */ React.createElement(View, { style: { flexDirection: "row-reverse" } }, /* @__PURE__ */ React.createElement(
|
|
30
36
|
Button,
|
|
31
37
|
{
|
|
32
|
-
title:
|
|
33
|
-
onPress: signOut,
|
|
38
|
+
title: dictionary.settings.logOut,
|
|
39
|
+
onPress: () => void signOut(),
|
|
34
40
|
style: {
|
|
35
41
|
marginHorizontal: 30,
|
|
36
42
|
width: 100
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCoreStackNavigation
|
|
3
|
+
} from "./chunk-BIMOM43W.js";
|
|
4
|
+
import {
|
|
5
|
+
useDictionary
|
|
6
|
+
} from "./chunk-6SBQOSWK.js";
|
|
7
|
+
|
|
8
|
+
// src/hooks/useScreenTitleFromDictionary.ts
|
|
9
|
+
import { useLayoutEffect } from "react";
|
|
10
|
+
var useScreenTitleFromDictionary = (pickFn) => {
|
|
11
|
+
const dictionary = useDictionary();
|
|
12
|
+
useScreenTitle(pickFn(dictionary));
|
|
13
|
+
};
|
|
14
|
+
var useScreenTitle = (title) => {
|
|
15
|
+
const navigation = useCoreStackNavigation();
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
navigation.setOptions({ title });
|
|
18
|
+
}, [title, navigation]);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
useScreenTitleFromDictionary
|
|
23
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SelectLanguageCellGroup
|
|
3
|
+
} from "./chunk-JPK5SCA5.js";
|
|
4
|
+
import {
|
|
5
|
+
getNavigationRouteForLanguageSelectScreen
|
|
6
|
+
} from "./chunk-AEGDSD6N.js";
|
|
7
|
+
import {
|
|
8
|
+
useScreenTitleFromDictionary
|
|
9
|
+
} from "./chunk-MDOJ2W2G.js";
|
|
10
|
+
import {
|
|
11
|
+
useCoreStackNavigation,
|
|
12
|
+
useCoreStackRoute
|
|
13
|
+
} from "./chunk-BIMOM43W.js";
|
|
14
|
+
import {
|
|
15
|
+
useDictionary,
|
|
16
|
+
useLanguage
|
|
17
|
+
} from "./chunk-6SBQOSWK.js";
|
|
18
|
+
|
|
19
|
+
// src/components/screens/language/SelectLanguageScreen.tsx
|
|
20
|
+
import React, { useState } from "react";
|
|
21
|
+
import { ScrollView, View } from "react-native";
|
|
22
|
+
import { Button, EDSStyleSheet, Spacer, useStyles } from "@equinor/mad-components";
|
|
23
|
+
var SelectLanguageScreen = () => {
|
|
24
|
+
useScreenTitleFromDictionary((dic) => dic.language.language);
|
|
25
|
+
const styles = useStyles(themeStyles);
|
|
26
|
+
const dictionary = useDictionary();
|
|
27
|
+
const language = useLanguage();
|
|
28
|
+
const navigation = useCoreStackNavigation();
|
|
29
|
+
const route = useCoreStackRoute();
|
|
30
|
+
const [selectedLanguageCodeDraft, setSelectedLanguageCodeDraft] = useState(language.language.code);
|
|
31
|
+
const isOnboarding = route.name === "SelectLanguageOnboarding";
|
|
32
|
+
const onPressSubmit = () => {
|
|
33
|
+
language.setSelectedLanguage(selectedLanguageCodeDraft);
|
|
34
|
+
const route2 = getNavigationRouteForLanguageSelectScreen(isOnboarding);
|
|
35
|
+
navigation.navigate(route2);
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ React.createElement(ScrollView, { contentInsetAdjustmentBehavior: "automatic" }, /* @__PURE__ */ React.createElement(Spacer, null), /* @__PURE__ */ React.createElement(SelectLanguageCellGroup, { selectedLanguageCodeDraft, setSelectedLanguageCodeDraft }), /* @__PURE__ */ React.createElement(View, { style: styles.submitButtonContainer }, /* @__PURE__ */ React.createElement(Button, { title: dictionary.common.save, onPress: onPressSubmit })));
|
|
38
|
+
};
|
|
39
|
+
var themeStyles = EDSStyleSheet.create((theme) => ({ submitButtonContainer: { flexDirection: "column", alignItems: "flex-end", paddingVertical: theme.spacing.container.paddingVertical, paddingHorizontal: theme.spacing.container.paddingHorizontal } }));
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
SelectLanguageScreen
|
|
43
|
+
};
|
|
@@ -1,57 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
fetchReleaseNotes
|
|
3
|
-
} from "./chunk-FIFUL4JE.js";
|
|
4
1
|
import {
|
|
5
2
|
ChangeLog
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AM5E5CYS.js";
|
|
7
4
|
import {
|
|
8
5
|
useReleaseNotesVersion
|
|
9
6
|
} from "./chunk-5BVQKJQB.js";
|
|
10
7
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
getShortDate
|
|
9
|
+
} from "./chunk-OCWASWDK.js";
|
|
10
|
+
import {
|
|
11
|
+
useScreenTitleFromDictionary
|
|
12
|
+
} from "./chunk-MDOJ2W2G.js";
|
|
13
|
+
import {
|
|
14
|
+
useCoreStackNavigation
|
|
15
|
+
} from "./chunk-BIMOM43W.js";
|
|
16
|
+
import {
|
|
17
|
+
whats_new_exports
|
|
18
|
+
} from "./chunk-6GFARWDK.js";
|
|
19
|
+
import {
|
|
20
|
+
fetchReleaseNotes
|
|
21
|
+
} from "./chunk-V4QL2TIA.js";
|
|
15
22
|
import {
|
|
16
23
|
useDemoMode
|
|
17
24
|
} from "./chunk-UZ6YMQV2.js";
|
|
18
25
|
import {
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
useAppVersion,
|
|
27
|
+
useEnvironment,
|
|
28
|
+
useServicePortalName
|
|
29
|
+
} from "./chunk-6SBQOSWK.js";
|
|
21
30
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
__spreadProps,
|
|
32
|
+
__spreadValues
|
|
33
|
+
} from "./chunk-BZK6J33D.js";
|
|
24
34
|
|
|
25
35
|
// src/components/screens/release-notes/WhatsNewScreen.tsx
|
|
26
36
|
import React, { useEffect, useState } from "react";
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
version: () => version
|
|
37
|
-
});
|
|
38
|
-
var app = "App name";
|
|
39
|
-
var version = "1.1.0";
|
|
40
|
-
var modified = "2022-12-09T07:04:55+0000";
|
|
41
|
-
var releaseNote = "- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n";
|
|
42
|
-
var releaseDate = "2022-12-09T07:04:55+0000";
|
|
43
|
-
var whats_new_default = {
|
|
44
|
-
app,
|
|
45
|
-
version,
|
|
46
|
-
modified,
|
|
47
|
-
releaseNote,
|
|
48
|
-
releaseDate
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// src/components/screens/release-notes/WhatsNewScreen.tsx
|
|
52
|
-
import { Button, CircularProgress, EDSStyleSheet, useStyles } from "@equinor/mad-components";
|
|
53
|
-
import { View } from "react-native";
|
|
37
|
+
import {
|
|
38
|
+
Button,
|
|
39
|
+
Cell,
|
|
40
|
+
CircularProgress,
|
|
41
|
+
EDSStyleSheet,
|
|
42
|
+
Typography,
|
|
43
|
+
useStyles
|
|
44
|
+
} from "@equinor/mad-components";
|
|
45
|
+
import { ScrollView, View } from "react-native";
|
|
54
46
|
var WhatsNewScreen = () => {
|
|
47
|
+
useScreenTitleFromDictionary((dic) => dic.releaseNotes.whatsNew);
|
|
55
48
|
const styles = useStyles(whatsNewStyles);
|
|
56
49
|
const environment = useEnvironment();
|
|
57
50
|
const releaseNotesVersion = useReleaseNotesVersion();
|
|
@@ -80,7 +73,7 @@ var WhatsNewScreen = () => {
|
|
|
80
73
|
if (!release) {
|
|
81
74
|
return /* @__PURE__ */ React.createElement(View, { style: styles.spinnerContainer }, /* @__PURE__ */ React.createElement(CircularProgress, null));
|
|
82
75
|
}
|
|
83
|
-
return /* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(ChangeLog, { release }), /* @__PURE__ */ React.createElement(View, { style: styles.footer }, /* @__PURE__ */ React.createElement(
|
|
76
|
+
return /* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(ScrollView, null, /* @__PURE__ */ React.createElement(Cell, { style: styles.scrollContainer }, /* @__PURE__ */ React.createElement(Typography, { style: styles.versionHeader }, release.version), /* @__PURE__ */ React.createElement(Typography, { style: styles.subtitleHeader }, getShortDate(new Date(release.releaseDate))), /* @__PURE__ */ React.createElement(ChangeLog, { release }))), /* @__PURE__ */ React.createElement(View, { style: styles.footer }, /* @__PURE__ */ React.createElement(
|
|
84
77
|
Button,
|
|
85
78
|
{
|
|
86
79
|
title: "OK",
|
|
@@ -102,9 +95,17 @@ var whatsNewStyles = EDSStyleSheet.create((theme) => ({
|
|
|
102
95
|
container: {
|
|
103
96
|
display: "flex",
|
|
104
97
|
paddingTop: theme.geometry.dimension.cell.minHeight,
|
|
105
|
-
height: "100%",
|
|
106
98
|
justifyContent: "space-between"
|
|
107
99
|
},
|
|
100
|
+
scrollContainer: {
|
|
101
|
+
justifyContent: "center",
|
|
102
|
+
borderTopWidth: 0,
|
|
103
|
+
borderBottomWidth: 0
|
|
104
|
+
},
|
|
105
|
+
versionHeader: theme.typography.basic.h1,
|
|
106
|
+
subtitleHeader: __spreadProps(__spreadValues({}, theme.typography.basic.h4), {
|
|
107
|
+
marginVertical: theme.spacing.container.paddingVertical
|
|
108
|
+
}),
|
|
108
109
|
footer: {
|
|
109
110
|
alignItems: "flex-end",
|
|
110
111
|
marginHorizontal: theme.spacing.container.paddingHorizontal,
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
// src/utils/getPremadeSettings.ts
|
|
2
|
-
var
|
|
2
|
+
var getReleaseNotesConfig = (dictionary) => ({
|
|
3
3
|
name: "navigation",
|
|
4
4
|
iconName: "format-list-bulleted",
|
|
5
|
-
title:
|
|
5
|
+
title: dictionary.releaseNotes.releaseNotes,
|
|
6
6
|
onPress: (navigation) => navigation.navigate("ReleaseNotes")
|
|
7
|
-
};
|
|
8
|
-
var
|
|
7
|
+
});
|
|
8
|
+
var getAboutConfig = (dictionary) => ({
|
|
9
9
|
name: "navigation",
|
|
10
10
|
iconName: "information-outline",
|
|
11
|
-
title:
|
|
11
|
+
title: dictionary.settings.aboutApp,
|
|
12
12
|
onPress: (navigation) => navigation.navigate("About")
|
|
13
|
-
};
|
|
14
|
-
var
|
|
13
|
+
});
|
|
14
|
+
var getServiceNowConfig = (dictionary) => ({
|
|
15
15
|
name: "navigation",
|
|
16
16
|
iconName: "chat-alert-outline",
|
|
17
|
-
title:
|
|
17
|
+
title: dictionary.settings.feedback,
|
|
18
18
|
onPress: (navigation) => navigation.navigate("Feedback")
|
|
19
|
-
};
|
|
20
|
-
var
|
|
19
|
+
});
|
|
20
|
+
var getLanguageConfig = (dictionary) => ({
|
|
21
21
|
name: "navigation",
|
|
22
22
|
iconName: "chat-processing-outline",
|
|
23
|
-
title:
|
|
24
|
-
onPress: (navigation) => navigation.navigate("
|
|
25
|
-
};
|
|
26
|
-
var getPremadeSettings = (config) => {
|
|
27
|
-
const premadeCommonNavigationItems = [
|
|
23
|
+
title: dictionary.settings.language,
|
|
24
|
+
onPress: (navigation) => navigation.navigate("SelectLanguage")
|
|
25
|
+
});
|
|
26
|
+
var getPremadeSettings = (config, dictionary) => {
|
|
27
|
+
const premadeCommonNavigationItems = [getReleaseNotesConfig(dictionary)];
|
|
28
28
|
if (config.about)
|
|
29
|
-
premadeCommonNavigationItems.push(
|
|
29
|
+
premadeCommonNavigationItems.push(getAboutConfig(dictionary));
|
|
30
30
|
if (config.serviceNow)
|
|
31
|
-
premadeCommonNavigationItems.push(
|
|
32
|
-
const premadeLanguageSection = config.language.supportedLanguages.length >= 2 ? { items: [
|
|
31
|
+
premadeCommonNavigationItems.push(getServiceNowConfig(dictionary));
|
|
32
|
+
const premadeLanguageSection = config.language.supportedLanguages.length >= 2 ? { items: [getLanguageConfig(dictionary)] } : void 0;
|
|
33
33
|
const premadeCommonNavigationSection = {
|
|
34
34
|
items: premadeCommonNavigationItems
|
|
35
35
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// src/components/navigation/MadCoreSubHeader.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { EnvironmentBanner } from "@equinor/mad-components";
|
|
4
|
+
var MadCoreSubHeader = () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(EnvironmentBanner, null));
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
MadCoreSubHeader
|
|
8
|
+
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getNavigationRouteForWhatsNewScreen
|
|
3
|
+
} from "./chunk-T3WC3PE2.js";
|
|
4
|
+
|
|
1
5
|
// src/utils/getNavigationRouteForLoginScreen.ts
|
|
2
6
|
var getNavigationRouteForLoginScreen = ({
|
|
3
7
|
appVersion,
|
|
@@ -8,7 +12,7 @@ var getNavigationRouteForLoginScreen = ({
|
|
|
8
12
|
return "WhatsNew";
|
|
9
13
|
if (!lastDisplayedReleaseNotesVersion || lastDisplayedReleaseNotesVersion < appVersion)
|
|
10
14
|
return "WhatsNew";
|
|
11
|
-
return
|
|
15
|
+
return getNavigationRouteForWhatsNewScreen();
|
|
12
16
|
};
|
|
13
17
|
var _getNavigationRouteForLoginScreenPure = {};
|
|
14
18
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getIsLanguageSelected
|
|
3
|
+
} from "./chunk-6SBQOSWK.js";
|
|
4
|
+
import {
|
|
5
|
+
getConfig
|
|
6
|
+
} from "./chunk-ZSTTHIEF.js";
|
|
7
|
+
|
|
8
|
+
// src/utils/getNavigationRouteForWhatsNewScreen.ts
|
|
9
|
+
var getNavigationRouteForWhatsNewScreen = () => {
|
|
10
|
+
const isLanguageSelected = getIsLanguageSelected();
|
|
11
|
+
const config = getConfig();
|
|
12
|
+
if (config.language.supportedLanguages.length < 2)
|
|
13
|
+
return "Root";
|
|
14
|
+
if (config.language.skipOnboarding)
|
|
15
|
+
return "Root";
|
|
16
|
+
if (isLanguageSelected)
|
|
17
|
+
return "Root";
|
|
18
|
+
return "SelectLanguageOnboarding";
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
getNavigationRouteForWhatsNewScreen
|
|
23
|
+
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-RFYZGBU4.js";
|
|
5
5
|
import {
|
|
6
6
|
__async
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BZK6J33D.js";
|
|
8
8
|
|
|
9
9
|
// src/components/screens/release-notes/fetchReleaseNotes.ts
|
|
10
10
|
import { authenticateSilently } from "@equinor/mad-auth";
|
|
@@ -20,10 +20,26 @@ var fetchReleaseNotes = (env, servicePortalName, appVersion) => __async(void 0,
|
|
|
20
20
|
Authorization: `Bearer ${authenticationResponse.accessToken}`
|
|
21
21
|
})
|
|
22
22
|
});
|
|
23
|
-
const
|
|
24
|
-
return
|
|
23
|
+
const result = yield fetchResponse.json();
|
|
24
|
+
return result;
|
|
25
|
+
});
|
|
26
|
+
var fetchAllReleaseNotes = (env, servicePortalName) => __async(void 0, null, function* () {
|
|
27
|
+
const scopes = getMadCommonScopes(env);
|
|
28
|
+
const baseUrl = getMadCommonBaseUrl(env);
|
|
29
|
+
const authenticationResponse = yield authenticateSilently(scopes);
|
|
30
|
+
if (!authenticationResponse)
|
|
31
|
+
throw new Error("Unable to authenticate silently");
|
|
32
|
+
const fetchResponse = yield fetch(`${baseUrl}/ReleaseNote/${servicePortalName}/`, {
|
|
33
|
+
method: "GET",
|
|
34
|
+
headers: new Headers({
|
|
35
|
+
Authorization: `Bearer ${authenticationResponse.accessToken}`
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
const result = yield fetchResponse.json();
|
|
39
|
+
return result;
|
|
25
40
|
});
|
|
26
41
|
|
|
27
42
|
export {
|
|
28
|
-
fetchReleaseNotes
|
|
43
|
+
fetchReleaseNotes,
|
|
44
|
+
fetchAllReleaseNotes
|
|
29
45
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCoreStackNavigation
|
|
3
|
+
} from "./chunk-BIMOM43W.js";
|
|
1
4
|
import {
|
|
2
5
|
useDemoMode
|
|
3
6
|
} from "./chunk-UZ6YMQV2.js";
|
|
4
|
-
import {
|
|
5
|
-
useCoreStackNavigation
|
|
6
|
-
} from "./chunk-K2H37TUR.js";
|
|
7
7
|
import {
|
|
8
8
|
__async
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BZK6J33D.js";
|
|
10
10
|
|
|
11
11
|
// src/components/screens/settings/useSignOut.ts
|
|
12
12
|
import { useCallback } from "react";
|
|
@@ -23,7 +23,7 @@ var useSignOut = () => {
|
|
|
23
23
|
navigation.navigate("Login");
|
|
24
24
|
} catch (_) {
|
|
25
25
|
alert("Error", "Unable to sign out", [
|
|
26
|
-
{ text: "Try again", isPreferred: true, onPress: signOutFn },
|
|
26
|
+
{ text: "Try again", isPreferred: true, onPress: () => void signOutFn() },
|
|
27
27
|
{ text: "Cancel", onPress: () => void 0 }
|
|
28
28
|
]);
|
|
29
29
|
}
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useReleaseNotesVersion
|
|
3
3
|
} from "./chunk-5BVQKJQB.js";
|
|
4
|
-
import {
|
|
5
|
-
useAppVersion,
|
|
6
|
-
useAuthConfig,
|
|
7
|
-
useLoginScreenConfig
|
|
8
|
-
} from "./chunk-35THIGVH.js";
|
|
9
4
|
import {
|
|
10
5
|
getNavigationRouteForLoginScreen
|
|
11
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QXK5OE27.js";
|
|
7
|
+
import {
|
|
8
|
+
useCoreStackNavigation
|
|
9
|
+
} from "./chunk-BIMOM43W.js";
|
|
12
10
|
import {
|
|
13
11
|
enableDemoMode
|
|
14
12
|
} from "./chunk-UZ6YMQV2.js";
|
|
15
13
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
useAppVersion,
|
|
15
|
+
useAuthConfig,
|
|
16
|
+
useDictionary,
|
|
17
|
+
useLoginScreenConfig
|
|
18
|
+
} from "./chunk-6SBQOSWK.js";
|
|
18
19
|
import {
|
|
19
20
|
__spreadProps,
|
|
20
21
|
__spreadValues
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-BZK6J33D.js";
|
|
22
23
|
|
|
23
24
|
// src/components/screens/LoginScreen.tsx
|
|
24
25
|
import { Button, EDSStyleSheet, Typography, useStyles } from "@equinor/mad-components";
|
|
25
26
|
import React, { useState } from "react";
|
|
26
27
|
import { Image, Pressable, View } from "react-native";
|
|
27
28
|
import { LoginButton } from "@equinor/mad-auth";
|
|
29
|
+
import { metricKeys, metricStatus, track } from "@equinor/mad-insights";
|
|
28
30
|
var LoginScreen = () => {
|
|
31
|
+
var _a;
|
|
29
32
|
const styles = useStyles(theme);
|
|
33
|
+
const dictionary = useDictionary();
|
|
30
34
|
const authConfig = useAuthConfig();
|
|
31
35
|
const navigation = useCoreStackNavigation();
|
|
32
36
|
const appVersion = useAppVersion();
|
|
@@ -37,21 +41,31 @@ var LoginScreen = () => {
|
|
|
37
41
|
return /* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(Typography, { variant: "h1" }, title), /* @__PURE__ */ React.createElement(Pressable, { onPress: () => setDemoPressCount((state) => state + 1) }, /* @__PURE__ */ React.createElement(Image, { source: logo, resizeMode: "contain", style: { height: 200, width: 200 } })), /* @__PURE__ */ React.createElement(View, { style: { gap: 8 } }, /* @__PURE__ */ React.createElement(
|
|
38
42
|
LoginButton,
|
|
39
43
|
__spreadProps(__spreadValues({}, authConfig), {
|
|
40
|
-
onAuthenticationSuccessful: () =>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
onAuthenticationSuccessful: (_, type) => {
|
|
45
|
+
if (type === "AUTOMATIC") {
|
|
46
|
+
void track(metricKeys.AUTHENTICATION_AUTOMATIC);
|
|
47
|
+
} else {
|
|
48
|
+
void track(metricKeys.AUTHENTICATION, metricStatus.SUCCESS);
|
|
49
|
+
}
|
|
50
|
+
navigation.navigate(
|
|
51
|
+
getNavigationRouteForLoginScreen({
|
|
52
|
+
appVersion,
|
|
53
|
+
lastDisplayedReleaseNotesVersion
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
onAuthenticationFailed: (error) => void track(metricKeys.AUTHENTICATION, metricStatus.FAILED, void 0, { error }),
|
|
58
|
+
title: dictionary.login.logIn,
|
|
46
59
|
enableAutomaticAuthentication: true,
|
|
47
|
-
scopes: authConfig.scopes
|
|
60
|
+
scopes: (_a = authConfig.scopes) != null ? _a : []
|
|
48
61
|
})
|
|
49
62
|
), shouldDisplayDemoButton && /* @__PURE__ */ React.createElement(
|
|
50
63
|
Button,
|
|
51
64
|
{
|
|
52
|
-
title:
|
|
65
|
+
title: dictionary.login.demo,
|
|
53
66
|
variant: "outlined",
|
|
54
67
|
onPress: () => {
|
|
68
|
+
void track(metricKeys.AUTHENTICATION_DEMO);
|
|
55
69
|
enableDemoMode();
|
|
56
70
|
navigation.navigate(
|
|
57
71
|
getNavigationRouteForLoginScreen({
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "./chunk-BZK6J33D.js";
|
|
5
|
+
|
|
6
|
+
// src/components/ErrorBoundary.tsx
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { ErrorBoundary as MadErrorBoundary } from "@equinor/mad-components";
|
|
9
|
+
import { trackCustom } from "@equinor/mad-insights";
|
|
10
|
+
var ErrorBoundary = (props) => /* @__PURE__ */ React.createElement(
|
|
11
|
+
MadErrorBoundary,
|
|
12
|
+
__spreadProps(__spreadValues({}, props), {
|
|
13
|
+
onError: (error, info) => {
|
|
14
|
+
var _a;
|
|
15
|
+
trackCustom(`${error.name} - ${error.message}`, { error, info });
|
|
16
|
+
(_a = props.onError) == null ? void 0 : _a.call(props, error, info);
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
ErrorBoundary
|
|
23
|
+
};
|