@equinor/mad-core 0.2.0 → 0.3.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 +14 -0
- package/dist/{chunk-DL54DMGO.js → chunk-2DFV2HBY.js} +1 -1
- package/dist/{chunk-VXUERD3Z.js → chunk-4IS74K75.js} +1 -1
- package/dist/{chunk-ZXZ2FEIU.js → chunk-5RW7M3DD.js} +1 -1
- package/dist/{chunk-UOMVB65Y.js → chunk-6O3V4Z6G.js} +12 -9
- package/dist/chunk-6UN2PRPB.js +26 -0
- package/dist/{chunk-YY3XXUD6.js → chunk-6YLWO444.js} +1 -1
- package/dist/{chunk-CMKIUYX7.js → chunk-7OT26KNA.js} +6 -6
- package/dist/{chunk-UJAEFWFH.js → chunk-A3ND5QVK.js} +3 -3
- package/dist/{chunk-QDRLODML.js → chunk-ANFSTFWV.js} +3 -3
- package/dist/chunk-BBDX2JPC.js +13 -0
- package/dist/{chunk-AM5E5CYS.js → chunk-CIMA2GQQ.js} +1 -1
- package/dist/{chunk-LNJRCADN.js → chunk-FOAO6U65.js} +6 -6
- package/dist/chunk-FXJGDKLB.js +120 -0
- package/dist/chunk-G5W3HK4A.js +0 -0
- package/dist/{chunk-6GFARWDK.js → chunk-GHWLQBHQ.js} +1 -1
- package/dist/{chunk-GSC3O7TW.js → chunk-GSOAYETS.js} +1 -1
- package/dist/{chunk-V4QL2TIA.js → chunk-KBEPONRV.js} +1 -1
- package/dist/{chunk-3XUVY5MJ.js → chunk-KBY2EXL7.js} +1 -1
- package/dist/{chunk-SQXXB44S.js → chunk-MPPFRLAL.js} +3 -3
- package/dist/{chunk-XHOURLLU.js → chunk-O2G2ZKO7.js} +3 -3
- package/dist/{chunk-FCPT6WB6.js → chunk-PEPYP4GH.js} +3 -3
- package/dist/{chunk-BZZTCMAD.js → chunk-PX7SPACG.js} +1 -1
- package/dist/{chunk-RJEUW53E.js → chunk-SGPMP2PN.js} +1 -1
- package/dist/chunk-SHKOH7MA.js +15 -0
- package/dist/chunk-T6J6HWJK.js +61 -0
- package/dist/{chunk-AFYA4V5E.js → chunk-UAKBRWHM.js} +1 -1
- package/dist/{chunk-HGT5ZUYL.js → chunk-W3LMT7N4.js} +1 -1
- package/dist/{chunk-BZK6J33D.js → chunk-WEAGW6MQ.js} +13 -0
- package/dist/chunk-YWPELSTX.js +18 -0
- package/dist/chunk-ZSUFR7LK.js +20 -0
- package/dist/{chunk-ZGFKUVSZ.js → chunk-ZX726IIW.js} +4 -4
- package/dist/components/AnnouncementsProvider.js +2 -2
- package/dist/components/ErrorBoundary.js +2 -2
- package/dist/components/NavigationContainer.js +2 -2
- package/dist/components/createCoreStackNavigator.d.ts +1 -1
- package/dist/components/createCoreStackNavigator.js +27 -21
- package/dist/components/index.js +32 -26
- package/dist/components/navigation/MadCoreSubHeader.js +14 -2
- package/dist/components/navigation/index.js +15 -3
- package/dist/components/navigation/navigation-creators.js +15 -3
- package/dist/components/screens/AboutScreen.js +4 -4
- package/dist/components/screens/CreateIncidentScreen.js +1 -1
- package/dist/components/screens/LoginScreen.js +6 -6
- package/dist/components/screens/language/SelectLanguageScreen.js +6 -6
- package/dist/components/screens/language/components/SelectLanguageCellGroup.js +4 -4
- package/dist/components/screens/release-notes/ChangeLog.js +2 -2
- package/dist/components/screens/release-notes/ReleaseNotesScreen.js +9 -9
- package/dist/components/screens/release-notes/WhatsNewScreen.js +8 -8
- package/dist/components/screens/release-notes/fetchReleaseNotes.js +2 -2
- package/dist/components/screens/settings/Section.js +1 -1
- package/dist/components/screens/settings/SettingsScreen.js +6 -6
- package/dist/components/screens/settings/index.js +7 -7
- package/dist/components/screens/settings/renderCell.js +1 -1
- package/dist/components/screens/settings/useSignOut.js +2 -2
- package/dist/components/service-message/ServiceMessageBanner.d.ts +2 -0
- package/dist/components/service-message/ServiceMessageBanner.js +18 -0
- package/dist/components/service-message/ServiceMessageProvider.d.ts +12 -0
- package/dist/components/service-message/ServiceMessageProvider.js +16 -0
- package/dist/components/service-message/components/DisableableSwipeable.d.ts +7 -0
- package/dist/components/service-message/components/DisableableSwipeable.js +7 -0
- package/dist/components/service-message/components/ExpansionToggle.d.ts +6 -0
- package/dist/components/service-message/components/ExpansionToggle.js +7 -0
- package/dist/components/service-message/hooks/useFetchServiceMessage.d.ts +12 -0
- package/dist/components/service-message/hooks/useFetchServiceMessage.js +13 -0
- package/dist/components/service-message/types.d.ts +9 -0
- package/dist/components/service-message/types.js +0 -0
- package/dist/components/service-message/utils/resolveMessageFromServiceMessage.d.ts +5 -0
- package/dist/components/service-message/utils/resolveMessageFromServiceMessage.js +7 -0
- package/dist/hooks/UseReleaseNotes.js +6 -6
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAccountOrDemoAccount.js +1 -1
- package/dist/hooks/useCoreStackNavigation.js +1 -1
- package/dist/hooks/useScreenTitleFromDictionary.js +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +53 -28
- package/dist/language/useDictionary.js +3 -3
- package/dist/store/demo-mode/demo-mode.js +1 -1
- package/dist/store/demo-mode/index.js +1 -1
- package/dist/store/index.d.ts +2 -0
- package/dist/store/index.js +29 -0
- package/dist/store/language/index.js +3 -3
- package/dist/store/language/language.js +3 -3
- package/dist/store/mad-config/hooks.js +3 -3
- package/dist/store/mad-config/index.js +3 -3
- 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/utils/createMadCoreNavigator.js +20 -18
- package/dist/utils/dateUtils.js +1 -1
- package/dist/utils/getFinalSettingsConfig.js +1 -1
- package/dist/utils/getNavigationRouteForLoginScreen.js +5 -5
- package/dist/utils/getNavigationRouteForSelectLanguageScreen.js +1 -1
- package/dist/utils/getNavigationRouteForWhatsNewScreen.js +4 -4
- package/dist/utils/getPremadeSettings.js +1 -1
- package/dist/utils/getRedirectUriFromAuthConfig.js +1 -1
- package/dist/utils/madCommonUtils.js +1 -1
- package/package.json +4 -3
- package/dist/chunk-PBCPR4ZO.js +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @equinor/mad-core
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 97dca15: Added support for service-messages!
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- e9e74b0: export demo mode and language related utilities
|
|
12
|
+
- Updated dependencies [97dca15]
|
|
13
|
+
- Updated dependencies [97dca15]
|
|
14
|
+
- @equinor/mad-components@0.8.4
|
|
15
|
+
- @equinor/mad-auth@0.1.2
|
|
16
|
+
|
|
3
17
|
## 0.2.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectLanguageScreen
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MPPFRLAL.js";
|
|
4
4
|
import {
|
|
5
5
|
ReleaseNotesScreen
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ANFSTFWV.js";
|
|
7
7
|
import {
|
|
8
8
|
WhatsNewScreen
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FOAO6U65.js";
|
|
10
|
+
import {
|
|
11
|
+
ServiceMessageProvider
|
|
12
|
+
} from "./chunk-6UN2PRPB.js";
|
|
10
13
|
import {
|
|
11
14
|
AboutScreen
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SGPMP2PN.js";
|
|
13
16
|
import {
|
|
14
17
|
CreateIncidentScreen
|
|
15
18
|
} from "./chunk-GCBWBANV.js";
|
|
16
19
|
import {
|
|
17
20
|
LoginScreen
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PEPYP4GH.js";
|
|
19
22
|
import {
|
|
20
23
|
AnnouncementsProvider
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GSOAYETS.js";
|
|
22
25
|
import {
|
|
23
26
|
__spreadProps,
|
|
24
27
|
__spreadValues
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-WEAGW6MQ.js";
|
|
26
29
|
|
|
27
30
|
// src/utils/createMadCoreNavigator.tsx
|
|
28
31
|
import React from "react";
|
|
@@ -30,7 +33,7 @@ import { EnvironmentProvider } from "@equinor/mad-components";
|
|
|
30
33
|
import { AppInsightsInitializer } from "@equinor/mad-insights";
|
|
31
34
|
var createMadCoreNavigator = (Stack, config) => {
|
|
32
35
|
function MadCoreNavigator(props) {
|
|
33
|
-
return /* @__PURE__ */ React.createElement(AppInsightsInitializer, { config: config.applicationInsights }, /* @__PURE__ */ React.createElement(EnvironmentProvider, { environment: config.environment }, /* @__PURE__ */ React.createElement(AnnouncementsProvider, null, /* @__PURE__ */ React.createElement(Stack.Navigator, __spreadProps(__spreadValues({}, props), { initialRouteName: "Login" }), /* @__PURE__ */ React.createElement(
|
|
36
|
+
return /* @__PURE__ */ React.createElement(AppInsightsInitializer, { config: config.applicationInsights }, /* @__PURE__ */ React.createElement(EnvironmentProvider, { environment: config.environment }, /* @__PURE__ */ React.createElement(ServiceMessageProvider, null, /* @__PURE__ */ React.createElement(AnnouncementsProvider, null, /* @__PURE__ */ React.createElement(Stack.Navigator, __spreadProps(__spreadValues({}, props), { initialRouteName: "Login" }), /* @__PURE__ */ React.createElement(
|
|
34
37
|
Stack.Screen,
|
|
35
38
|
{
|
|
36
39
|
name: "Login",
|
|
@@ -43,7 +46,7 @@ var createMadCoreNavigator = (Stack, config) => {
|
|
|
43
46
|
name: "WhatsNew",
|
|
44
47
|
component: WhatsNewScreen
|
|
45
48
|
}
|
|
46
|
-
), config.about && /* @__PURE__ */ React.createElement(Stack.Screen, { name: "About", component: AboutScreen }), config.serviceNow && /* @__PURE__ */ React.createElement(Stack.Screen, { name: "Feedback", component: CreateIncidentScreen }), config.language.supportedLanguages.length > 1 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Stack.Screen, { name: "SelectLanguage", component: SelectLanguageScreen }), /* @__PURE__ */ React.createElement(Stack.Screen, { name: "SelectLanguageOnboarding", component: SelectLanguageScreen, options: { headerBackVisible: false } })), props.children))));
|
|
49
|
+
), config.about && /* @__PURE__ */ React.createElement(Stack.Screen, { name: "About", component: AboutScreen }), config.serviceNow && /* @__PURE__ */ React.createElement(Stack.Screen, { name: "Feedback", component: CreateIncidentScreen }), config.language.supportedLanguages.length > 1 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Stack.Screen, { name: "SelectLanguage", component: SelectLanguageScreen }), /* @__PURE__ */ React.createElement(Stack.Screen, { name: "SelectLanguageOnboarding", component: SelectLanguageScreen, options: { headerBackVisible: false } })), props.children)))));
|
|
47
50
|
}
|
|
48
51
|
return MadCoreNavigator;
|
|
49
52
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useFetchServiceMessage
|
|
3
|
+
} from "./chunk-T6J6HWJK.js";
|
|
4
|
+
|
|
5
|
+
// src/components/service-message/ServiceMessageProvider.tsx
|
|
6
|
+
import React, { useContext } from "react";
|
|
7
|
+
var ServiceMessageContext = React.createContext({
|
|
8
|
+
serviceMessage: void 0,
|
|
9
|
+
isDismissed: false,
|
|
10
|
+
setIsDismissed: () => void 0,
|
|
11
|
+
expansionEnabled: false,
|
|
12
|
+
setExpansionEnabled: () => void 0,
|
|
13
|
+
isExpanded: false,
|
|
14
|
+
setIsExpanded: () => void 0,
|
|
15
|
+
isError: false
|
|
16
|
+
});
|
|
17
|
+
var ServiceMessageProvider = ({ children }) => {
|
|
18
|
+
const serviceMessageState = useFetchServiceMessage();
|
|
19
|
+
return /* @__PURE__ */ React.createElement(ServiceMessageContext.Provider, { value: serviceMessageState }, children);
|
|
20
|
+
};
|
|
21
|
+
var useServiceMessageState = () => useContext(ServiceMessageContext);
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
ServiceMessageProvider,
|
|
25
|
+
useServiceMessageState
|
|
26
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useSignOut
|
|
3
|
-
} from "./chunk-VXUERD3Z.js";
|
|
4
1
|
import {
|
|
5
2
|
SettingsSection
|
|
6
3
|
} from "./chunk-DWAJZVKH.js";
|
|
4
|
+
import {
|
|
5
|
+
useSignOut
|
|
6
|
+
} from "./chunk-4IS74K75.js";
|
|
7
7
|
import {
|
|
8
8
|
getFinalSettingsConfig
|
|
9
9
|
} from "./chunk-7SJM4NDH.js";
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
} from "./chunk-EQYL7INQ.js";
|
|
13
13
|
import {
|
|
14
14
|
useScreenTitleFromDictionary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UAKBRWHM.js";
|
|
16
16
|
import {
|
|
17
17
|
useDictionary,
|
|
18
18
|
useSettingsScreenPremadeConfig
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ZX726IIW.js";
|
|
20
20
|
import {
|
|
21
21
|
__spreadValues
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-WEAGW6MQ.js";
|
|
23
23
|
|
|
24
24
|
// src/components/screens/settings/SettingsScreen.tsx
|
|
25
25
|
import React from "react";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
whats_new_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GHWLQBHQ.js";
|
|
4
4
|
import {
|
|
5
5
|
fetchAllReleaseNotes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KBEPONRV.js";
|
|
7
7
|
import {
|
|
8
8
|
useDemoMode
|
|
9
9
|
} from "./chunk-UZ6YMQV2.js";
|
|
10
10
|
import {
|
|
11
11
|
useEnvironment,
|
|
12
12
|
useServicePortalName
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZX726IIW.js";
|
|
14
14
|
|
|
15
15
|
// src/hooks/UseReleaseNotes.tsx
|
|
16
16
|
import { useEffect, useMemo, useState } from "react";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChangeLog
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CIMA2GQQ.js";
|
|
4
4
|
import {
|
|
5
5
|
getShortDate
|
|
6
6
|
} from "./chunk-OCWASWDK.js";
|
|
7
7
|
import {
|
|
8
8
|
useScreenTitleFromDictionary
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UAKBRWHM.js";
|
|
10
10
|
import {
|
|
11
11
|
useReleaseNotes
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-A3ND5QVK.js";
|
|
13
13
|
|
|
14
14
|
// src/components/screens/release-notes/ReleaseNotesScreen.tsx
|
|
15
15
|
import React from "react";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ServiceMessageBanner
|
|
3
|
+
} from "./chunk-FXJGDKLB.js";
|
|
4
|
+
|
|
5
|
+
// src/components/navigation/MadCoreSubHeader.tsx
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { EnvironmentBanner } from "@equinor/mad-components";
|
|
8
|
+
import { SafeAreaView } from "react-native";
|
|
9
|
+
var MadCoreSubHeader = () => /* @__PURE__ */ React.createElement(SafeAreaView, null, /* @__PURE__ */ React.createElement(ServiceMessageBanner, null), /* @__PURE__ */ React.createElement(EnvironmentBanner, null));
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
MadCoreSubHeader
|
|
13
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChangeLog
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CIMA2GQQ.js";
|
|
4
4
|
import {
|
|
5
5
|
useReleaseNotesVersion
|
|
6
6
|
} from "./chunk-5BVQKJQB.js";
|
|
@@ -9,16 +9,16 @@ import {
|
|
|
9
9
|
} from "./chunk-OCWASWDK.js";
|
|
10
10
|
import {
|
|
11
11
|
useScreenTitleFromDictionary
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UAKBRWHM.js";
|
|
13
13
|
import {
|
|
14
14
|
useCoreStackNavigation
|
|
15
15
|
} from "./chunk-BIMOM43W.js";
|
|
16
16
|
import {
|
|
17
17
|
whats_new_exports
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GHWLQBHQ.js";
|
|
19
19
|
import {
|
|
20
20
|
fetchReleaseNotes
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-KBEPONRV.js";
|
|
22
22
|
import {
|
|
23
23
|
useDemoMode
|
|
24
24
|
} from "./chunk-UZ6YMQV2.js";
|
|
@@ -26,11 +26,11 @@ import {
|
|
|
26
26
|
useAppVersion,
|
|
27
27
|
useEnvironment,
|
|
28
28
|
useServicePortalName
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ZX726IIW.js";
|
|
30
30
|
import {
|
|
31
31
|
__spreadProps,
|
|
32
32
|
__spreadValues
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-WEAGW6MQ.js";
|
|
34
34
|
|
|
35
35
|
// src/components/screens/release-notes/WhatsNewScreen.tsx
|
|
36
36
|
import React, { useEffect, useState } from "react";
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ExpansionToggle
|
|
3
|
+
} from "./chunk-YWPELSTX.js";
|
|
4
|
+
import {
|
|
5
|
+
resolveMessageFromServiceMessage
|
|
6
|
+
} from "./chunk-SHKOH7MA.js";
|
|
7
|
+
import {
|
|
8
|
+
DisableableSwipeable
|
|
9
|
+
} from "./chunk-ZSUFR7LK.js";
|
|
10
|
+
import {
|
|
11
|
+
useServiceMessageState
|
|
12
|
+
} from "./chunk-6UN2PRPB.js";
|
|
13
|
+
import {
|
|
14
|
+
__spreadProps,
|
|
15
|
+
__spreadValues
|
|
16
|
+
} from "./chunk-WEAGW6MQ.js";
|
|
17
|
+
|
|
18
|
+
// src/components/service-message/ServiceMessageBanner.tsx
|
|
19
|
+
import React from "react";
|
|
20
|
+
import { LayoutAnimation, Linking, View } from "react-native";
|
|
21
|
+
import {
|
|
22
|
+
EDSStyleSheet,
|
|
23
|
+
PressableHighlight,
|
|
24
|
+
Typography,
|
|
25
|
+
useStyles,
|
|
26
|
+
CellSwipeItem
|
|
27
|
+
} from "@equinor/mad-components";
|
|
28
|
+
var ServiceMessageBanner = () => {
|
|
29
|
+
const styles = useStyles(theme);
|
|
30
|
+
const {
|
|
31
|
+
serviceMessage,
|
|
32
|
+
isDismissed,
|
|
33
|
+
setIsDismissed,
|
|
34
|
+
isExpanded,
|
|
35
|
+
setIsExpanded,
|
|
36
|
+
expansionEnabled,
|
|
37
|
+
setExpansionEnabled,
|
|
38
|
+
isError
|
|
39
|
+
} = useServiceMessageState();
|
|
40
|
+
const dismissAndURLIsVisible = !expansionEnabled || expansionEnabled && isExpanded;
|
|
41
|
+
const onPressServiceMessage = () => {
|
|
42
|
+
LayoutAnimation.configureNext(__spreadProps(__spreadValues({}, LayoutAnimation.Presets.easeInEaseOut), { duration: 100 }));
|
|
43
|
+
setIsExpanded((isExpanded2) => !isExpanded2);
|
|
44
|
+
};
|
|
45
|
+
if (isDismissed)
|
|
46
|
+
return null;
|
|
47
|
+
if (!serviceMessage)
|
|
48
|
+
return null;
|
|
49
|
+
const { message, url } = resolveMessageFromServiceMessage(serviceMessage, isError);
|
|
50
|
+
return /* @__PURE__ */ React.createElement(
|
|
51
|
+
DisableableSwipeable,
|
|
52
|
+
{
|
|
53
|
+
disabled: !dismissAndURLIsVisible,
|
|
54
|
+
renderRightActions: () => /* @__PURE__ */ React.createElement(
|
|
55
|
+
CellSwipeItem,
|
|
56
|
+
{
|
|
57
|
+
title: "Remove",
|
|
58
|
+
iconName: "close",
|
|
59
|
+
color: "danger",
|
|
60
|
+
onPress: () => setIsDismissed(true)
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
},
|
|
64
|
+
/* @__PURE__ */ React.createElement(
|
|
65
|
+
PressableHighlight,
|
|
66
|
+
{
|
|
67
|
+
style: styles.container,
|
|
68
|
+
onPress: onPressServiceMessage,
|
|
69
|
+
disabled: !expansionEnabled
|
|
70
|
+
},
|
|
71
|
+
/* @__PURE__ */ React.createElement(View, { style: { flex: 1 } }, /* @__PURE__ */ React.createElement(
|
|
72
|
+
Typography,
|
|
73
|
+
{
|
|
74
|
+
color: styles.text.color,
|
|
75
|
+
numberOfLines: expansionEnabled && !isExpanded ? 2 : 0,
|
|
76
|
+
onTextLayout: (e) => {
|
|
77
|
+
if (e.nativeEvent.lines.length > 2) {
|
|
78
|
+
setExpansionEnabled(true);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
message
|
|
83
|
+
), dismissAndURLIsVisible && /* @__PURE__ */ React.createElement(React.Fragment, null, url && /* @__PURE__ */ React.createElement(
|
|
84
|
+
Typography,
|
|
85
|
+
{
|
|
86
|
+
group: "interactive",
|
|
87
|
+
variant: "link",
|
|
88
|
+
style: styles.text,
|
|
89
|
+
onPress: () => void Linking.openURL(url)
|
|
90
|
+
},
|
|
91
|
+
url
|
|
92
|
+
), /* @__PURE__ */ React.createElement(
|
|
93
|
+
Typography,
|
|
94
|
+
{
|
|
95
|
+
variant: "label",
|
|
96
|
+
bold: true,
|
|
97
|
+
color: styles.text.color,
|
|
98
|
+
style: { marginTop: 8 }
|
|
99
|
+
},
|
|
100
|
+
"Swipe left to remove"
|
|
101
|
+
))),
|
|
102
|
+
expansionEnabled && /* @__PURE__ */ React.createElement(ExpansionToggle, { isExpanded })
|
|
103
|
+
)
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
var theme = EDSStyleSheet.create((themeStyles) => ({
|
|
107
|
+
container: {
|
|
108
|
+
backgroundColor: themeStyles.colors.container.warning,
|
|
109
|
+
padding: themeStyles.spacing.dialog.padding,
|
|
110
|
+
flexDirection: "row",
|
|
111
|
+
justifyContent: "space-between"
|
|
112
|
+
},
|
|
113
|
+
text: {
|
|
114
|
+
color: themeStyles.colors.text.feedbackWarning
|
|
115
|
+
}
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
export {
|
|
119
|
+
ServiceMessageBanner
|
|
120
|
+
};
|
|
File without changes
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectLanguageCellGroup
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2DFV2HBY.js";
|
|
4
4
|
import {
|
|
5
5
|
getNavigationRouteForLanguageSelectScreen
|
|
6
6
|
} from "./chunk-AEGDSD6N.js";
|
|
7
7
|
import {
|
|
8
8
|
useScreenTitleFromDictionary
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UAKBRWHM.js";
|
|
10
10
|
import {
|
|
11
11
|
useCoreStackNavigation,
|
|
12
12
|
useCoreStackRoute
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
useDictionary,
|
|
16
16
|
useLanguage
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZX726IIW.js";
|
|
18
18
|
|
|
19
19
|
// src/components/screens/language/SelectLanguageScreen.tsx
|
|
20
20
|
import React, { useState } from "react";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createNativeStackNavigator
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KBY2EXL7.js";
|
|
4
4
|
import {
|
|
5
5
|
createMadCoreNavigator
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6O3V4Z6G.js";
|
|
7
7
|
import {
|
|
8
8
|
setConfig
|
|
9
9
|
} from "./chunk-ZSTTHIEF.js";
|
|
10
10
|
import {
|
|
11
11
|
__spreadProps,
|
|
12
12
|
__spreadValues
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WEAGW6MQ.js";
|
|
14
14
|
|
|
15
15
|
// src/components/createCoreStackNavigator.tsx
|
|
16
16
|
var createCoreStackNavigator = (config) => {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-5BVQKJQB.js";
|
|
4
4
|
import {
|
|
5
5
|
getNavigationRouteForLoginScreen
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5RW7M3DD.js";
|
|
7
7
|
import {
|
|
8
8
|
useCoreStackNavigation
|
|
9
9
|
} from "./chunk-BIMOM43W.js";
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
useAuthConfig,
|
|
16
16
|
useDictionary,
|
|
17
17
|
useLoginScreenConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZX726IIW.js";
|
|
19
19
|
import {
|
|
20
20
|
__spreadProps,
|
|
21
21
|
__spreadValues
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-WEAGW6MQ.js";
|
|
23
23
|
|
|
24
24
|
// src/components/screens/LoginScreen.tsx
|
|
25
25
|
import { Button, EDSStyleSheet, Typography, useStyles } from "@equinor/mad-components";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/components/service-message/utils/resolveMessageFromServiceMessage.ts
|
|
2
|
+
var resolveMessageFromServiceMessage = (serviceMessage, isError) => {
|
|
3
|
+
if (isError)
|
|
4
|
+
return {
|
|
5
|
+
message: "Could not retrieve service message."
|
|
6
|
+
};
|
|
7
|
+
return {
|
|
8
|
+
message: serviceMessage.message,
|
|
9
|
+
url: serviceMessage.urlString
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
resolveMessageFromServiceMessage
|
|
15
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getMadCommonBaseUrl
|
|
3
|
+
} from "./chunk-RFYZGBU4.js";
|
|
4
|
+
import {
|
|
5
|
+
getConfig
|
|
6
|
+
} from "./chunk-ZSTTHIEF.js";
|
|
7
|
+
|
|
8
|
+
// src/components/service-message/hooks/useFetchServiceMessage.ts
|
|
9
|
+
import { useEffect, useRef, useState } from "react";
|
|
10
|
+
var useFetchServiceMessage = () => {
|
|
11
|
+
const [serviceMessage, setServiceMessage] = useState();
|
|
12
|
+
const [isDismissed, setIsDismissed] = useState(false);
|
|
13
|
+
const [expansionEnabled, setExpansionEnabled] = useState(false);
|
|
14
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
15
|
+
const [isError, setIsError] = useState(false);
|
|
16
|
+
const lastInterval = useRef();
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
function fetchServiceMessage() {
|
|
19
|
+
const { environment, servicePortalName } = getConfig();
|
|
20
|
+
fetch(`${getMadCommonBaseUrl(environment)}/ServiceMessage/${servicePortalName}`).then(
|
|
21
|
+
(res) => res.json().then((data) => {
|
|
22
|
+
if (!data.message)
|
|
23
|
+
return;
|
|
24
|
+
if (!serviceMessage || data.alertName !== serviceMessage.alertName) {
|
|
25
|
+
setServiceMessage(data);
|
|
26
|
+
setIsDismissed(false);
|
|
27
|
+
setExpansionEnabled(false);
|
|
28
|
+
setIsExpanded(false);
|
|
29
|
+
setIsError(false);
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
).catch(() => {
|
|
33
|
+
setIsError(true);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (!lastInterval.current)
|
|
37
|
+
fetchServiceMessage();
|
|
38
|
+
if (lastInterval.current)
|
|
39
|
+
clearInterval(lastInterval.current);
|
|
40
|
+
lastInterval.current = setInterval(() => {
|
|
41
|
+
fetchServiceMessage();
|
|
42
|
+
}, 6e4);
|
|
43
|
+
return () => {
|
|
44
|
+
clearInterval(lastInterval.current);
|
|
45
|
+
};
|
|
46
|
+
}, [serviceMessage]);
|
|
47
|
+
return {
|
|
48
|
+
serviceMessage,
|
|
49
|
+
isDismissed,
|
|
50
|
+
setIsDismissed,
|
|
51
|
+
expansionEnabled,
|
|
52
|
+
setExpansionEnabled,
|
|
53
|
+
isExpanded,
|
|
54
|
+
setIsExpanded,
|
|
55
|
+
isError
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
useFetchServiceMessage
|
|
61
|
+
};
|
|
@@ -17,6 +17,18 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
20
32
|
var __export = (target, all) => {
|
|
21
33
|
for (var name in all)
|
|
22
34
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -45,6 +57,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
45
57
|
export {
|
|
46
58
|
__spreadValues,
|
|
47
59
|
__spreadProps,
|
|
60
|
+
__objRest,
|
|
48
61
|
__export,
|
|
49
62
|
__async
|
|
50
63
|
};
|