@equinor/mad-core 0.12.2 → 0.14.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 +21 -0
- package/dist/{chunk-DJMBVNB6.js → chunk-4MZFJLIZ.js} +2 -2
- package/dist/{chunk-U5IJVQDO.js → chunk-5JFNRREO.js} +1 -1
- package/dist/chunk-5O4PAUNU.js +13 -0
- package/dist/{chunk-7HGZLLNX.js → chunk-6HDRI6TU.js} +1 -1
- package/dist/{chunk-6RPJUHBL.js → chunk-BFY7M5I2.js} +1 -1
- package/dist/{chunk-STKI44UB.js → chunk-COSM7WGR.js} +4 -4
- package/dist/{chunk-TWUGCMPQ.js → chunk-D4SVYUGC.js} +2 -2
- package/dist/{chunk-KEH6NBFE.js → chunk-G4GPSIHD.js} +1 -1
- package/dist/{chunk-HVZWOPNE.js → chunk-HPDK6AZ3.js} +4 -11
- package/dist/{chunk-EOM477VC.js → chunk-IPJ2CVM4.js} +1 -1
- package/dist/{chunk-ETY3HZNI.js → chunk-IXKJM7VZ.js} +1 -1
- package/dist/{chunk-WWF7QKDX.js → chunk-LEWQGDM7.js} +2 -7
- package/dist/{chunk-SVBUWW4H.js → chunk-N7YMTR7Q.js} +2 -2
- package/dist/{chunk-O2GHT2UV.js → chunk-NVAF6GOY.js} +2 -2
- package/dist/{chunk-CKOB6JKU.js → chunk-OAVRCDCP.js} +4 -4
- package/dist/{chunk-ZAJCJP22.js → chunk-PYTNVR7M.js} +6 -6
- package/dist/{chunk-7FO6SNUK.js → chunk-QGFTS65Y.js} +5 -10
- package/dist/{chunk-GEEFQMRN.js → chunk-RBFR3YMY.js} +5 -5
- package/dist/{chunk-PB3TI2RT.js → chunk-RPD2KUSY.js} +1 -1
- package/dist/{chunk-IHCNAGT7.js → chunk-SRQFW6D5.js} +1 -1
- package/dist/chunk-TJBYNCID.js +353 -0
- package/dist/{chunk-DIITQCRW.js → chunk-TO775HMH.js} +1 -1
- package/dist/{chunk-6LMMRQYQ.js → chunk-UOOFD7CI.js} +2 -2
- package/dist/{chunk-RJDKNHBE.js → chunk-XMQYRBUW.js} +1 -1
- package/dist/{chunk-4JWXJOGM.js → chunk-YTQLIYLS.js} +4 -4
- package/dist/{chunk-GNJZV3PL.js → chunk-ZAEB6ZS3.js} +5 -9
- package/dist/components/EnvironmentBanner.js +2 -2
- package/dist/components/EnvironmentProvider.js +2 -2
- package/dist/components/NavigationContainer.d.ts +2 -15
- package/dist/components/OfflineBanner.js +2 -2
- package/dist/components/createCoreStackNavigator.d.ts +18 -37
- package/dist/components/createCoreStackNavigator.js +37 -30
- package/dist/components/index.js +35 -38
- package/dist/components/navigation/MadCoreSubHeader.js +7 -7
- package/dist/components/navigation/index.js +8 -8
- package/dist/components/navigation/navigation-creators.d.ts +6 -7
- package/dist/components/navigation/navigation-creators.js +8 -8
- package/dist/components/screens/AboutScreen.js +2 -2
- package/dist/components/screens/LoginScreen.d.ts +2 -2
- package/dist/components/screens/LoginScreen.js +4 -4
- package/dist/components/screens/create-incident/CreateIncidentScreen.js +51 -5
- package/dist/components/screens/create-incident/createIncident.js +62 -1
- package/dist/components/screens/language/SelectLanguageScreen.js +5 -5
- package/dist/components/screens/language/components/SelectLanguageCellGroup.js +2 -2
- package/dist/components/screens/release-notes/ReleaseNotesScreen.js +5 -8
- package/dist/components/screens/release-notes/WhatsNewScreen.js +6 -6
- package/dist/components/screens/release-notes/fetchReleaseNotes.js +1 -11
- package/dist/components/screens/settings/Section.js +1 -9
- package/dist/components/screens/settings/SettingsScreen.js +6 -6
- package/dist/components/screens/settings/index.js +6 -6
- package/dist/components/screens/settings/useSignOut.d.ts +1 -1
- package/dist/components/screens/settings/useSignOut.js +4 -4
- package/dist/components/service-message/ServiceMessageBanner.js +4 -4
- package/dist/components/service-message/ServiceMessageProvider.js +3 -3
- package/dist/components/service-message/hooks/useFetchServiceMessage.d.ts +0 -1
- package/dist/components/service-message/hooks/useFetchServiceMessage.js +2 -2
- package/dist/hooks/UseReleaseNotes.js +3 -6
- package/dist/hooks/index.js +1 -9
- package/dist/hooks/useAccountOrDemoAccount.js +1 -9
- package/dist/hooks/useNavigateFromLanguageSelectScreen.js +2 -2
- package/dist/hooks/useNavigateFromLoginScreen.js +3 -3
- package/dist/hooks/useNavigateFromWhatsNewScreen.js +3 -3
- package/dist/hooks/useScreenTitleFromDictionary.js +2 -2
- package/dist/index.js +53 -75
- package/dist/language/useDictionary.js +1 -1
- package/dist/store/index.js +2 -2
- package/dist/store/language/index.js +1 -1
- package/dist/store/language/language.js +1 -1
- package/dist/store/mad-config/hooks.d.ts +3 -3
- package/dist/store/mad-config/hooks.js +1 -1
- package/dist/store/mad-config/index.js +1 -1
- package/dist/store/mad-config/mad-config.js +1 -1
- package/dist/utils/MadCoreProviders.d.ts +1 -1
- package/dist/utils/MadCoreProviders.js +5 -5
- package/dist/utils/createEnvironmentProxy.d.ts +2 -2
- package/dist/utils/createEnvironmentProxy.js +1 -1
- package/dist/utils/createMadCoreNavigator.d.ts +6 -6
- package/dist/utils/createMadCoreNavigator.js +41 -22
- package/dist/utils/initiateAuthenticationClient.js +1 -11
- package/package.json +10 -11
- package/dist/chunk-4ZX24N67.js +0 -41
- package/dist/chunk-JYWP44JR.js +0 -0
- package/dist/chunk-NJ5W3O5I.js +0 -30
- package/dist/chunk-S2WEOFU7.js +0 -98
- package/dist/chunk-WDZF2C5R.js +0 -20
- package/dist/chunk-ZIV7DVBA.js +0 -158
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @equinor/mad-core
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7bf5e2b: React Native Architecture Upgrade -> Expo sdk upgraded to version 53
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [7bf5e2b]
|
|
12
|
+
- @equinor/mad-components@0.23.0
|
|
13
|
+
- @equinor/mad-navigation@0.6.0
|
|
14
|
+
- @equinor/mad-insights@0.2.0
|
|
15
|
+
- @equinor/mad-toast@0.3.0
|
|
16
|
+
- @equinor/mad-auth@0.3.0
|
|
17
|
+
|
|
18
|
+
## 0.13.0
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- 0c7c214: removes duplicate link from the about section
|
|
23
|
+
|
|
3
24
|
## 0.12.2
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-4DXH3SPN.js";
|
|
4
4
|
import {
|
|
5
5
|
fetchAllReleaseNotes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QGFTS65Y.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-RBFR3YMY.js";
|
|
14
14
|
|
|
15
15
|
// src/hooks/UseReleaseNotes.tsx
|
|
16
16
|
import { useEffect, useMemo, useState } from "react";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/utils/initiateAuthenticationClient.ts
|
|
2
|
+
import { ExpoAuthSession } from "@equinor/mad-auth";
|
|
3
|
+
var initiateAuthenticationClient = () => {
|
|
4
|
+
const discovery = ExpoAuthSession.getDiscovery();
|
|
5
|
+
const config = ExpoAuthSession.getConfig();
|
|
6
|
+
if (!(!discovery || !config)) {
|
|
7
|
+
void ExpoAuthSession.initiateAuthenticationClient(config, discovery);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
initiateAuthenticationClient
|
|
13
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectLanguageCellGroup
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G4GPSIHD.js";
|
|
4
4
|
import {
|
|
5
5
|
useScreenTitleFromDictionary
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5JFNRREO.js";
|
|
7
7
|
import {
|
|
8
8
|
useNavigateFromLanguageSelectScreen
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SRQFW6D5.js";
|
|
10
10
|
import {
|
|
11
11
|
useDictionary,
|
|
12
12
|
useLanguage
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RBFR3YMY.js";
|
|
14
14
|
|
|
15
15
|
// src/components/screens/language/SelectLanguageScreen.tsx
|
|
16
16
|
import React, { useState } from "react";
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-OCWASWDK.js";
|
|
7
7
|
import {
|
|
8
8
|
useScreenTitleFromDictionary
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5JFNRREO.js";
|
|
10
10
|
import {
|
|
11
11
|
useReleaseNotes
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4MZFJLIZ.js";
|
|
13
13
|
|
|
14
14
|
// src/components/screens/release-notes/ReleaseNotesScreen.tsx
|
|
15
15
|
import React from "react";
|
|
@@ -4,27 +4,20 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
useDemoMode
|
|
6
6
|
} from "./chunk-UZ6YMQV2.js";
|
|
7
|
-
import {
|
|
8
|
-
getConfig
|
|
9
|
-
} from "./chunk-GEEFQMRN.js";
|
|
10
7
|
import {
|
|
11
8
|
CoreRoutes
|
|
12
9
|
} from "./chunk-UKAZW3CQ.js";
|
|
13
|
-
import {
|
|
14
|
-
__async
|
|
15
|
-
} from "./chunk-CWMXXUWU.js";
|
|
16
10
|
|
|
17
11
|
// src/components/screens/settings/useSignOut.ts
|
|
18
12
|
import { useCallback } from "react";
|
|
19
|
-
import { ExpoAuthSession
|
|
13
|
+
import { ExpoAuthSession } from "@equinor/mad-auth";
|
|
20
14
|
import { alert } from "@equinor/mad-components";
|
|
21
15
|
var useSignOut = () => {
|
|
22
16
|
const navigation = useCoreStackNavigation();
|
|
23
17
|
const demoMode = useDemoMode();
|
|
24
|
-
const signOutFn = useCallback(() =>
|
|
25
|
-
var _a;
|
|
18
|
+
const signOutFn = useCallback(() => {
|
|
26
19
|
try {
|
|
27
|
-
const result =
|
|
20
|
+
const result = ExpoAuthSession.signOut();
|
|
28
21
|
if (!demoMode.isEnabled && !result) throw new Error("Unable to sign out");
|
|
29
22
|
demoMode.disableDemoMode();
|
|
30
23
|
navigation.navigate(CoreRoutes.LOGIN);
|
|
@@ -34,7 +27,7 @@ var useSignOut = () => {
|
|
|
34
27
|
{ text: "Cancel", onPress: () => void 0 }
|
|
35
28
|
]);
|
|
36
29
|
}
|
|
37
|
-
}
|
|
30
|
+
}, [navigation, demoMode]);
|
|
38
31
|
return signOutFn;
|
|
39
32
|
};
|
|
40
33
|
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDemoMode
|
|
3
3
|
} from "./chunk-UZ6YMQV2.js";
|
|
4
|
-
import {
|
|
5
|
-
getConfig
|
|
6
|
-
} from "./chunk-GEEFQMRN.js";
|
|
7
4
|
|
|
8
5
|
// src/hooks/useAccountOrDemoAccount.ts
|
|
9
|
-
import { ExpoAuthSession
|
|
6
|
+
import { ExpoAuthSession } from "@equinor/mad-auth";
|
|
10
7
|
var MAD_DEMO_USER = {
|
|
11
8
|
name: "Demo user",
|
|
12
9
|
username: "demo.user@example.com",
|
|
13
10
|
identifier: "-1"
|
|
14
11
|
};
|
|
15
12
|
var useAccountOrDemoAccount = () => {
|
|
16
|
-
var _a;
|
|
17
13
|
const demoMode = useDemoMode();
|
|
18
|
-
const msalAccount = useAccount();
|
|
19
14
|
const expoAccount = ExpoAuthSession.useAccount();
|
|
20
|
-
const account =
|
|
15
|
+
const account = expoAccount;
|
|
21
16
|
if (demoMode.isEnabled) return MAD_DEMO_USER;
|
|
22
17
|
return account;
|
|
23
18
|
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ZB37EIZB.js";
|
|
4
4
|
import {
|
|
5
5
|
getConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RBFR3YMY.js";
|
|
7
7
|
|
|
8
8
|
// src/components/service-message/hooks/useFetchServiceMessage.ts
|
|
9
9
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -13,7 +13,7 @@ var useFetchServiceMessage = () => {
|
|
|
13
13
|
const [expansionEnabled, setExpansionEnabled] = useState(false);
|
|
14
14
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
15
15
|
const [isError, setIsError] = useState(false);
|
|
16
|
-
const lastInterval = useRef();
|
|
16
|
+
const lastInterval = useRef(void 0);
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
function fetchServiceMessage() {
|
|
19
19
|
const { currentEnvironment, servicePortalName } = getConfig();
|
|
@@ -9,16 +9,16 @@ import {
|
|
|
9
9
|
} from "./chunk-5BVQKJQB.js";
|
|
10
10
|
import {
|
|
11
11
|
useNavigateFromWhatsNewScreen
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IPJ2CVM4.js";
|
|
13
13
|
import {
|
|
14
14
|
useScreenTitleFromDictionary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5JFNRREO.js";
|
|
16
16
|
import {
|
|
17
17
|
whats_new_exports
|
|
18
18
|
} from "./chunk-4DXH3SPN.js";
|
|
19
19
|
import {
|
|
20
20
|
fetchReleaseNotes
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-QGFTS65Y.js";
|
|
22
22
|
import {
|
|
23
23
|
useDemoMode
|
|
24
24
|
} from "./chunk-UZ6YMQV2.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
useAppVersion,
|
|
27
27
|
useEnvironment,
|
|
28
28
|
useServicePortalName
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-RBFR3YMY.js";
|
|
30
30
|
import {
|
|
31
31
|
__spreadProps,
|
|
32
32
|
__spreadValues
|
|
@@ -7,9 +7,8 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
useAbout,
|
|
9
9
|
useAppVersion,
|
|
10
|
-
useEnvironment
|
|
11
|
-
|
|
12
|
-
} from "./chunk-GEEFQMRN.js";
|
|
10
|
+
useEnvironment
|
|
11
|
+
} from "./chunk-RBFR3YMY.js";
|
|
13
12
|
|
|
14
13
|
// src/components/screens/AboutScreen.tsx
|
|
15
14
|
import React from "react";
|
|
@@ -23,9 +22,10 @@ var AboutScreen = () => {
|
|
|
23
22
|
const appVersion = useAppVersion();
|
|
24
23
|
const about = useAbout();
|
|
25
24
|
const coreNavigatorType = useCoreNavigatorType();
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
25
|
+
const authenticationMethod = "Expo";
|
|
26
|
+
const endpoints = Array.from(
|
|
27
|
+
new Set([getMadCommonBaseUrl(environment)].concat((_a = about == null ? void 0 : about.endpoints) != null ? _a : []))
|
|
28
|
+
);
|
|
29
29
|
return /* @__PURE__ */ React.createElement(
|
|
30
30
|
ScrollView,
|
|
31
31
|
{
|
|
@@ -2,20 +2,16 @@ import {
|
|
|
2
2
|
getMadCommonBaseUrl,
|
|
3
3
|
getMadCommonScopes
|
|
4
4
|
} from "./chunk-ZB37EIZB.js";
|
|
5
|
-
import {
|
|
6
|
-
getConfig
|
|
7
|
-
} from "./chunk-GEEFQMRN.js";
|
|
8
5
|
import {
|
|
9
6
|
__async
|
|
10
7
|
} from "./chunk-CWMXXUWU.js";
|
|
11
8
|
|
|
12
9
|
// src/components/screens/release-notes/fetchReleaseNotes.ts
|
|
13
|
-
import {
|
|
14
|
-
var fetchReleaseNotes = (env, servicePortalName, appVersion) => __async(
|
|
15
|
-
var _a;
|
|
10
|
+
import { ExpoAuthSession } from "@equinor/mad-auth";
|
|
11
|
+
var fetchReleaseNotes = (env, servicePortalName, appVersion) => __async(null, null, function* () {
|
|
16
12
|
const scopes = getMadCommonScopes(env);
|
|
17
13
|
const baseUrl = getMadCommonBaseUrl(env);
|
|
18
|
-
const authenticationResponse =
|
|
14
|
+
const authenticationResponse = yield ExpoAuthSession.authenticateSilently(scopes);
|
|
19
15
|
if (!authenticationResponse) throw new Error("Unable to authenticate silently");
|
|
20
16
|
const fetchResponse = yield fetch(`${baseUrl}/ReleaseNote/${servicePortalName}/${appVersion}`, {
|
|
21
17
|
method: "GET",
|
|
@@ -25,11 +21,10 @@ var fetchReleaseNotes = (env, servicePortalName, appVersion) => __async(void 0,
|
|
|
25
21
|
});
|
|
26
22
|
return yield fetchResponse.json();
|
|
27
23
|
});
|
|
28
|
-
var fetchAllReleaseNotes = (env, servicePortalName) => __async(
|
|
29
|
-
var _a;
|
|
24
|
+
var fetchAllReleaseNotes = (env, servicePortalName) => __async(null, null, function* () {
|
|
30
25
|
const scopes = getMadCommonScopes(env);
|
|
31
26
|
const baseUrl = getMadCommonBaseUrl(env);
|
|
32
|
-
const authenticationResponse =
|
|
27
|
+
const authenticationResponse = yield ExpoAuthSession.authenticateSilently(scopes);
|
|
33
28
|
if (!authenticationResponse) throw new Error("Unable to authenticate silently");
|
|
34
29
|
const fetchResponse = yield fetch(`${baseUrl}/ReleaseNote/${servicePortalName}/`, {
|
|
35
30
|
method: "GET",
|
|
@@ -436,6 +436,10 @@ export {
|
|
|
436
436
|
getPureConfig,
|
|
437
437
|
setConfig,
|
|
438
438
|
setEnvironment,
|
|
439
|
+
useLanguage,
|
|
440
|
+
getLanguage,
|
|
441
|
+
setSelectedLanguage,
|
|
442
|
+
getIsLanguageSelected,
|
|
439
443
|
useDictionary,
|
|
440
444
|
useAuthConfig,
|
|
441
445
|
useLoginScreenConfig,
|
|
@@ -446,9 +450,5 @@ export {
|
|
|
446
450
|
useExperimentalFeatures,
|
|
447
451
|
useServiceNow,
|
|
448
452
|
useNavigateToMainRoute,
|
|
449
|
-
useSettingsScreenPremadeConfig
|
|
450
|
-
useLanguage,
|
|
451
|
-
getLanguage,
|
|
452
|
-
setSelectedLanguage,
|
|
453
|
-
getIsLanguageSelected
|
|
453
|
+
useSettingsScreenPremadeConfig
|
|
454
454
|
};
|