@admin-layout/gluestack-ui-mobile 10.0.2-alpha.2 → 10.0.2-alpha.21
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 +28 -0
- package/lib/components/WithConfiguration.d.ts +3 -3
- package/lib/components/WithConfiguration.js +3 -3
- package/lib/components/WithConfiguration.js.map +1 -1
- package/lib/components/WithPermission.d.ts +3 -3
- package/lib/components/WithPermission.js +3 -3
- package/lib/components/WithPermission.js.map +1 -1
- package/lib/components/usePermissionAutoFetch.js +7 -7
- package/lib/components/usePermissionAutoFetch.js.map +1 -1
- package/lib/components/useSetting.d.ts +1 -1
- package/lib/components/with-interactions-lifecycle-managed.js +11 -9
- package/lib/components/with-interactions-lifecycle-managed.js.map +1 -1
- package/package.json +3 -3
- package/src/components/WithConfiguration.tsx +4 -4
- package/src/components/WithPermission.tsx +4 -4
- package/src/components/usePermissionAutoFetch.tsx +7 -7
- package/src/components/useSetting.tsx +1 -1
- package/src/components/with-interactions-lifecycle-managed.tsx +11 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.0.2-alpha.21](https://github.com/CDEBase/admin-layout/compare/v10.0.2-alpha.20...v10.0.2-alpha.21) (2025-02-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @admin-layout/gluestack-ui-mobile
|
|
9
|
+
|
|
10
|
+
## [10.0.2-alpha.19](https://github.com/CDEBase/admin-layout/compare/v10.0.2-alpha.18...v10.0.2-alpha.19) (2025-02-24)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @admin-layout/gluestack-ui-mobile
|
|
13
|
+
|
|
14
|
+
## [10.0.2-alpha.17](https://github.com/CDEBase/admin-layout/compare/v10.0.2-alpha.16...v10.0.2-alpha.17) (2025-02-19)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @admin-layout/gluestack-ui-mobile
|
|
17
|
+
|
|
18
|
+
## [10.0.2-alpha.13](https://github.com/CDEBase/admin-layout/compare/v10.0.2-alpha.12...v10.0.2-alpha.13) (2025-02-12)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @admin-layout/gluestack-ui-mobile
|
|
21
|
+
|
|
22
|
+
## [10.0.2-alpha.8](https://github.com/CDEBase/admin-layout/compare/v10.0.2-alpha.7...v10.0.2-alpha.8) (2025-02-10)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @admin-layout/gluestack-ui-mobile
|
|
25
|
+
|
|
26
|
+
## [10.0.2-alpha.5](https://github.com/CDEBase/admin-layout/compare/v10.0.2-alpha.4...v10.0.2-alpha.5) (2025-02-09)
|
|
27
|
+
|
|
28
|
+
**Note:** Version bump only for package @admin-layout/gluestack-ui-mobile
|
|
29
|
+
|
|
30
|
+
## [10.0.2-alpha.4](https://github.com/CDEBase/admin-layout/compare/v10.0.2-alpha.3...v10.0.2-alpha.4) (2025-02-07)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @admin-layout/gluestack-ui-mobile
|
|
33
|
+
|
|
6
34
|
## [10.0.2-alpha.2](https://github.com/CDEBase/admin-layout/compare/v10.0.2-alpha.1...v10.0.2-alpha.2) (2025-02-07)
|
|
7
35
|
|
|
8
36
|
**Note:** Version bump only for package @admin-layout/gluestack-ui-mobile
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PermissionType } from 'common';
|
|
3
3
|
import { IPreDefinedPermissions } from '@adminide-stack/core';
|
|
4
4
|
import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri';
|
|
5
5
|
export interface IWithConfigurationProps {
|
|
6
6
|
children?: React.ReactElement;
|
|
7
7
|
configKey: string;
|
|
8
8
|
permissionKeys?: IPreDefinedPermissions[];
|
|
9
|
-
permissionTypes?:
|
|
9
|
+
permissionTypes?: PermissionType[];
|
|
10
10
|
resourceName?: string;
|
|
11
11
|
settingsUri?: URI;
|
|
12
12
|
}
|
|
13
13
|
export declare const WithConfiguration: {
|
|
14
14
|
(props: IWithConfigurationProps): React.JSX.Element;
|
|
15
15
|
defaultProps: {
|
|
16
|
-
permissionTypes:
|
|
16
|
+
permissionTypes: PermissionType[];
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
export declare const WithConfigurationContainer: (props: IWithConfigurationProps) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Spinner, Box, Text, Heading } from '@gluestack-ui/themed';
|
|
3
|
-
import {
|
|
3
|
+
import { PermissionType, Visibility } from 'common';
|
|
4
4
|
import { useSetting, usePermissionAutoFetch } from '@adminide-stack/platform-client';
|
|
5
5
|
import { get } from 'lodash-es';
|
|
6
6
|
export const WithConfiguration = (props) => {
|
|
@@ -11,7 +11,7 @@ export const WithConfiguration = (props) => {
|
|
|
11
11
|
});
|
|
12
12
|
// const { data: permissions, loading: permissionLoading } = usePermissionAutoFetch();
|
|
13
13
|
const { permissions, loading: permissionLoading } = usePermissionAutoFetch();
|
|
14
|
-
const isPrivate = React.useMemo(() =>
|
|
14
|
+
const isPrivate = React.useMemo(() => Visibility.Private === data?.resolveConfiguration, [data?.resolveConfiguration]);
|
|
15
15
|
const hasPermission = React.useMemo(() => {
|
|
16
16
|
if (isPrivate && permissions && Array.isArray(permissionKeys)) {
|
|
17
17
|
return permissionKeys.some((key) => permissionTypes.includes(get(permissions?.resolveConfiguration, key)));
|
|
@@ -36,7 +36,7 @@ export const WithConfiguration = (props) => {
|
|
|
36
36
|
React.createElement(Text, null, `You are trying to access private ${resourceName || 'resource'}.`)));
|
|
37
37
|
};
|
|
38
38
|
WithConfiguration.defaultProps = {
|
|
39
|
-
permissionTypes: [
|
|
39
|
+
permissionTypes: [PermissionType.Allow],
|
|
40
40
|
};
|
|
41
41
|
export const WithConfigurationContainer = (props) => React.createElement(WithConfiguration, { ...props });
|
|
42
42
|
//# sourceMappingURL=WithConfiguration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithConfiguration.js","sourceRoot":"","sources":["../../src/components/WithConfiguration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"WithConfiguration.js","sourceRoot":"","sources":["../../src/components/WithConfiguration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAYhC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA8B,EAAE,EAAE;IAChE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAErF,MAAM,EACF,IAAI,EACJ,OAAO,EAAE,eAAe,EACxB,mBAAmB,EAAE,CAAC,GACzB,GAAG,UAAU,CAAC;QACX,SAAS;QACT,SAAS,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,EAAE;KAC7C,CAAC,CAAC;IACH,sFAAsF;IACtF,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,iBAAiB,EAAE,GAAG,sBAAsB,EAAE,CAAC;IAE7E,MAAM,SAAS,GAAG,K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T,CAAC;AACN,CAAC,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG;IAC7B,eAAe,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC;CAC1C,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAA8B,EAAE,EAAE,CAAC,oBAAC,iBAAiB,OAAK,KAAK,GAAI,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PermissionType } from 'common';
|
|
3
3
|
import { IPreDefinedPermissions } from '@adminide-stack/core';
|
|
4
4
|
export declare enum WithPermissionBehaviour {
|
|
5
5
|
hide = 0,
|
|
@@ -9,7 +9,7 @@ export declare enum WithPermissionBehaviour {
|
|
|
9
9
|
export interface IWithPermissionProps {
|
|
10
10
|
children?: React.ReactElement;
|
|
11
11
|
permissionKeys: IPreDefinedPermissions[];
|
|
12
|
-
permissionTypes?:
|
|
12
|
+
permissionTypes?: PermissionType[];
|
|
13
13
|
behaviour?: WithPermissionBehaviour;
|
|
14
14
|
message?: string;
|
|
15
15
|
alternative?: React.ReactElement;
|
|
@@ -20,7 +20,7 @@ export interface IWithPermissionProps {
|
|
|
20
20
|
export declare const WithPermission: {
|
|
21
21
|
({ permissionKeys, children, permissionTypes, behaviour, message, alternative, render, }: IWithPermissionProps): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode>;
|
|
22
22
|
defaultProps: {
|
|
23
|
-
permissionTypes:
|
|
23
|
+
permissionTypes: PermissionType[];
|
|
24
24
|
behaviour: WithPermissionBehaviour;
|
|
25
25
|
message: string;
|
|
26
26
|
disabledProps: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Spinner, Box, Text, Heading } from '@gluestack-ui/themed';
|
|
3
|
-
import {
|
|
3
|
+
import { PermissionType } from 'common';
|
|
4
4
|
import { get } from 'lodash-es';
|
|
5
5
|
import { usePermissionAutoFetch } from '@adminide-stack/platform-client';
|
|
6
6
|
export var WithPermissionBehaviour;
|
|
@@ -9,7 +9,7 @@ export var WithPermissionBehaviour;
|
|
|
9
9
|
WithPermissionBehaviour[WithPermissionBehaviour["showUnAuthorized"] = 1] = "showUnAuthorized";
|
|
10
10
|
WithPermissionBehaviour[WithPermissionBehaviour["showAlternative"] = 2] = "showAlternative";
|
|
11
11
|
})(WithPermissionBehaviour || (WithPermissionBehaviour = {}));
|
|
12
|
-
export const WithPermission = ({ permissionKeys, children, permissionTypes = [
|
|
12
|
+
export const WithPermission = ({ permissionKeys, children, permissionTypes = [PermissionType.Allow], behaviour = WithPermissionBehaviour.hide, message = "You don't have permission to access this resource, contact owner", alternative, render, }) => {
|
|
13
13
|
// const { data: permissions, loading: permissionLoading } = usePermissionAutoFetch();
|
|
14
14
|
const { permissions, loading: permissionLoading } = usePermissionAutoFetch();
|
|
15
15
|
const hasPermission = React.useMemo(() => {
|
|
@@ -40,7 +40,7 @@ export const WithPermission = ({ permissionKeys, children, permissionTypes = [IP
|
|
|
40
40
|
return null;
|
|
41
41
|
};
|
|
42
42
|
WithPermission.defaultProps = {
|
|
43
|
-
permissionTypes: [
|
|
43
|
+
permissionTypes: [PermissionType.Allow],
|
|
44
44
|
behaviour: WithPermissionBehaviour.hide,
|
|
45
45
|
message: "You don't have permission to access this resource, contact owner",
|
|
46
46
|
disabledProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithPermission.js","sourceRoot":"","sources":["../../src/components/WithPermission.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"WithPermission.js","sourceRoot":"","sources":["../../src/components/WithPermission.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;A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C;IACvB,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,IAAI,aAAa,EAAE,CAAC;QAChB,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,IAAI,SAAS,KAAK,uBAAuB,CAAC,eAAe,EAAE,CAAC;QACxD,OAAO,WAAW,CAAC;IACvB,CAAC;IACD,IAAI,SAAS,KAAK,uBAAuB,CAAC,gBAAgB,EAAE,CAAC;QACzD,IAAI,iBAAiB,EAAE,CAAC;YACpB,OAAO,oBAAC,OAAO,OAAG,CAAC;QACvB,CAAC;QACD,OAAO,CACH,oBAAC,GAAG;YACA,oBAAC,OAAO,6BAA6B;YACrC,oBAAC,IAAI,QAAE,OAAO,CAAQ,CACpB,CACT,CAAC;IACN,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,cAAc,CAAC,YAAY,GAAG;IAC1B,eAAe,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC;IACvC,SAAS,EAAE,uBAAuB,CAAC,IAAI;IACvC,OAAO,EAAE,kEAAkE;IAC3E,aAAa,EAAE;QACX,QAAQ,EAAE,IAAI;KACjB;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,KAA2B,EAAE,EAAE,CAAC,oBAAC,cAAc,OAAK,KAAK,GAAI,CAAC,CAAC;AAClH,eAAe,uBAAuB,CAAC;AACvC,yGAAyG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResourceAuthority, ConfigFragmentName } from 'common';
|
|
2
2
|
import { generateUserUri } from '@adminide-stack/core';
|
|
3
3
|
import { useGetContextDataQuery } from 'common/lib/generated/generated.js';
|
|
4
4
|
import { useSetting } from './useSetting';
|
|
@@ -14,14 +14,14 @@ export const usePermissionAutoFetch = (options) => {
|
|
|
14
14
|
},
|
|
15
15
|
options: {
|
|
16
16
|
forceExist: false,
|
|
17
|
-
authority:
|
|
18
|
-
fragment:
|
|
17
|
+
authority: ResourceAuthority.Defaultpermissions,
|
|
18
|
+
fragment: ConfigFragmentName.Roles,
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
21
|
return { ...remaining, loading: loading || settingLoading };
|
|
22
22
|
};
|
|
23
23
|
// import React from 'react';
|
|
24
|
-
// import {
|
|
24
|
+
// import { ResourceAuthority, ConfigFragmentName } from '@adminide-stack/core';
|
|
25
25
|
// import { useGetTeamContextQuery } from '@adminide-stack/platform-client';
|
|
26
26
|
// import { generateOrgUri } from '@adminide-stack/core/lib/utils/generate-uri.js';
|
|
27
27
|
// import { useSelector } from 'react-redux';
|
|
@@ -45,7 +45,7 @@ export const usePermissionAutoFetch = (options) => {
|
|
|
45
45
|
// }
|
|
46
46
|
// }
|
|
47
47
|
// if (orgName) {
|
|
48
|
-
// const orgUri = generateOrgUri(orgName,
|
|
48
|
+
// const orgUri = generateOrgUri(orgName, ConfigFragmentName.Settings);
|
|
49
49
|
// setOrgUri(orgUri);
|
|
50
50
|
// }
|
|
51
51
|
// }, [currentRoute, platformState, orgName]);
|
|
@@ -56,8 +56,8 @@ export const usePermissionAutoFetch = (options) => {
|
|
|
56
56
|
// },
|
|
57
57
|
// options: {
|
|
58
58
|
// forceExist: false,
|
|
59
|
-
// authority:
|
|
60
|
-
// fragment:
|
|
59
|
+
// authority: ResourceAuthority.Defaultpermissions,
|
|
60
|
+
// fragment: ConfigFragmentName.Roles,
|
|
61
61
|
// },
|
|
62
62
|
// });
|
|
63
63
|
// return { ...remaining, loading: loading || settingLoading };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePermissionAutoFetch.js","sourceRoot":"","sources":["../../src/components/usePermissionAutoFetch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"usePermissionAutoFetch.js","sourceRoot":"","sources":["../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3C,0BAA0B;AAC1B,IAAI;AACJ,sFAAsF;AACtF,+DAA+D;AAC/D,6DAA6D;AAC7D,6EAA6E;AAC7E,mGAAmG;AACnG,0DAA0D;AAC1D,0EAA0E;AAC1E,8BAA8B;AAC9B,yEAAyE;AACzE,mFAAmF;AACnF,qCAAqC;AACrC,mCAAmC;AACnC,gBAAgB;AAChB,YAAY;AACZ,yBAAyB;AACzB,mFAAmF;AACnF,iCAAiC;AACjC,YAAY;AACZ,kDAAkD;AAElD,qEAAqE;AACrE,+CAA+C;AAC/C,uBAAuB;AACvB,qDAAqD;AACrD,aAAa;AACb,qBAAqB;AACrB,iCAAiC;AACjC,+DAA+D;AAC/D,kDAAkD;AAClD,aAAa;AACb,UAAU;AACV,mEAAmE;AACnE,KAAK"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResolveConfigurationQuery, IResolveConfigurationQueryVariables, IPreferencesInput, IPreferencesOpenOptionsInput, IUpdateConfigurationMutation, IConfigurationOverridesInput } from 'common';
|
|
1
|
+
import type { IResolveConfigurationQuery, IResolveConfigurationQueryVariables, IPreferencesInput, IPreferencesOpenOptionsInput, IUpdateConfigurationMutation, IConfigurationOverridesInput } from 'common';
|
|
2
2
|
import { ConfigurationTarget } from 'common';
|
|
3
3
|
import { QueryResult } from '@apollo/client/react';
|
|
4
4
|
import { ExecutionResult } from 'graphql';
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Lifecycle } from '../containers/layout/Lifecycle';
|
|
3
2
|
import Animated from 'react-native-reanimated';
|
|
4
3
|
import { useAfterInteractions } from '../hooks/use-after-interactions';
|
|
5
4
|
import { Spinner, Center } from '@gluestack-ui/themed';
|
|
6
5
|
import { Platform } from 'react-native';
|
|
7
|
-
import { isUserAuthenticated } from '@adminide-stack/user-auth0-client';
|
|
8
6
|
const LoadingComponent = () => (React.createElement(Center, { flex: 1, justifyContent: 'center', alignItems: 'center' }, React.createElement(Spinner, { color: '$blue500' })));
|
|
9
7
|
const LifecycleComponent = ({ children }) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
return React.createElement(React.Fragment, null, children);
|
|
9
|
+
// const { authenticated } = isUserAuthenticated();
|
|
10
|
+
// if (authenticated) {
|
|
11
|
+
// return (
|
|
12
|
+
// <Lifecycle renderWhenPhase={LifecyclePhase.Restored} loadingRenderer={LoadingComponent}>
|
|
13
|
+
// {children}
|
|
14
|
+
// </Lifecycle>
|
|
15
|
+
// );
|
|
16
|
+
// } else {
|
|
17
|
+
// return <>{children}</>;
|
|
18
|
+
// }
|
|
17
19
|
};
|
|
18
20
|
const IntractionComponent = ({ children, interationTime }) => {
|
|
19
21
|
const { interactionsComplete, opacity, setInteractionsTimeOut } = useAfterInteractions();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-interactions-lifecycle-managed.js","sourceRoot":"","sources":["../../src/components/with-interactions-lifecycle-managed.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"with-interactions-lifecycle-managed.js","sourceRoot":"","sources":["../../src/components/with-interactions-lifecycle-managed.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,CAC3B,oBAAC,MAAM,IAAC,IAAI,EAAE,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,IAC1D,oBAAC,OAAO,IAAC,KAAK,EAAE,UAAU,G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|
2
2
|
"name": "@admin-layout/gluestack-ui-mobile",
|
|
3
|
-
"version": "10.0.2-alpha.
|
|
3
|
+
"version": "10.0.2-alpha.21",
|
|
4
4
|
"description": "Glustack-ui for mobile component layout",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"watch": "npm run build:lib:watch"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@admin-layout/client": "10.0.2-alpha.
|
|
26
|
+
"@admin-layout/client": "10.0.2-alpha.21",
|
|
27
27
|
"@gluestack-style/react": "^1.0.53",
|
|
28
28
|
"@gluestack-ui/config": "^1.1.18",
|
|
29
29
|
"@gluestack-ui/themed": "^1.1.22",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"typescript": {
|
|
43
43
|
"definition": "lib/index.d.ts"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "5df14dc7370039f8a7c3ed0124cc2655701f2732"
|
|
46
46
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Spinner, Box, Text, Heading } from '@gluestack-ui/themed';
|
|
3
|
-
import {
|
|
3
|
+
import { PermissionType, Visibility } from 'common';
|
|
4
4
|
import { IPreDefinedPermissions } from '@adminide-stack/core';
|
|
5
5
|
import { useSetting, usePermissionAutoFetch } from '@adminide-stack/platform-client';
|
|
6
6
|
import { get } from 'lodash-es';
|
|
@@ -10,7 +10,7 @@ export interface IWithConfigurationProps {
|
|
|
10
10
|
children?: React.ReactElement;
|
|
11
11
|
configKey: string;
|
|
12
12
|
permissionKeys?: IPreDefinedPermissions[];
|
|
13
|
-
permissionTypes?:
|
|
13
|
+
permissionTypes?: PermissionType[];
|
|
14
14
|
resourceName?: string;
|
|
15
15
|
settingsUri?: URI;
|
|
16
16
|
}
|
|
@@ -30,7 +30,7 @@ export const WithConfiguration = (props: IWithConfigurationProps) => {
|
|
|
30
30
|
const { permissions, loading: permissionLoading } = usePermissionAutoFetch();
|
|
31
31
|
|
|
32
32
|
const isPrivate = React.useMemo(
|
|
33
|
-
() =>
|
|
33
|
+
() => Visibility.Private === data?.resolveConfiguration,
|
|
34
34
|
[data?.resolveConfiguration],
|
|
35
35
|
);
|
|
36
36
|
|
|
@@ -69,7 +69,7 @@ export const WithConfiguration = (props: IWithConfigurationProps) => {
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
WithConfiguration.defaultProps = {
|
|
72
|
-
permissionTypes: [
|
|
72
|
+
permissionTypes: [PermissionType.Allow],
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
export const WithConfigurationContainer = (props: IWithConfigurationProps) => <WithConfiguration {...props} />;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Spinner, Box, Text, Heading } from '@gluestack-ui/themed';
|
|
3
|
-
import {
|
|
3
|
+
import { PermissionType } from 'common';
|
|
4
4
|
import { IPreDefinedPermissions } from '@adminide-stack/core';
|
|
5
5
|
import { get } from 'lodash-es';
|
|
6
6
|
import { usePermissionAutoFetch } from '@adminide-stack/platform-client';
|
|
@@ -14,7 +14,7 @@ export enum WithPermissionBehaviour {
|
|
|
14
14
|
export interface IWithPermissionProps {
|
|
15
15
|
children?: React.ReactElement;
|
|
16
16
|
permissionKeys: IPreDefinedPermissions[];
|
|
17
|
-
permissionTypes?:
|
|
17
|
+
permissionTypes?: PermissionType[];
|
|
18
18
|
behaviour?: WithPermissionBehaviour;
|
|
19
19
|
message?: string;
|
|
20
20
|
alternative?: React.ReactElement;
|
|
@@ -24,7 +24,7 @@ export interface IWithPermissionProps {
|
|
|
24
24
|
export const WithPermission = ({
|
|
25
25
|
permissionKeys,
|
|
26
26
|
children,
|
|
27
|
-
permissionTypes = [
|
|
27
|
+
permissionTypes = [PermissionType.Allow],
|
|
28
28
|
behaviour = WithPermissionBehaviour.hide,
|
|
29
29
|
message = "You don't have permission to access this resource, contact owner",
|
|
30
30
|
alternative,
|
|
@@ -69,7 +69,7 @@ export const WithPermission = ({
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
WithPermission.defaultProps = {
|
|
72
|
-
permissionTypes: [
|
|
72
|
+
permissionTypes: [PermissionType.Allow],
|
|
73
73
|
behaviour: WithPermissionBehaviour.hide,
|
|
74
74
|
message: "You don't have permission to access this resource, contact owner",
|
|
75
75
|
disabledProps: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResourceAuthority, ConfigFragmentName, IContext } from 'common';
|
|
2
2
|
import { generateUserUri } from '@adminide-stack/core';
|
|
3
3
|
import { useGetContextDataQuery } from 'common/lib/generated/generated.js';
|
|
4
4
|
import { useSetting } from './useSetting';
|
|
@@ -20,8 +20,8 @@ export const usePermissionAutoFetch = (options?: userPermissionAutoFetchProps) =
|
|
|
20
20
|
},
|
|
21
21
|
options: {
|
|
22
22
|
forceExist: false,
|
|
23
|
-
authority:
|
|
24
|
-
fragment:
|
|
23
|
+
authority: ResourceAuthority.Defaultpermissions,
|
|
24
|
+
fragment: ConfigFragmentName.Roles,
|
|
25
25
|
},
|
|
26
26
|
});
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ export const usePermissionAutoFetch = (options?: userPermissionAutoFetchProps) =
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
// import React from 'react';
|
|
32
|
-
// import {
|
|
32
|
+
// import { ResourceAuthority, ConfigFragmentName } from '@adminide-stack/core';
|
|
33
33
|
// import { useGetTeamContextQuery } from '@adminide-stack/platform-client';
|
|
34
34
|
// import { generateOrgUri } from '@adminide-stack/core/lib/utils/generate-uri.js';
|
|
35
35
|
// import { useSelector } from 'react-redux';
|
|
@@ -54,7 +54,7 @@ export const usePermissionAutoFetch = (options?: userPermissionAutoFetchProps) =
|
|
|
54
54
|
// }
|
|
55
55
|
// }
|
|
56
56
|
// if (orgName) {
|
|
57
|
-
// const orgUri = generateOrgUri(orgName,
|
|
57
|
+
// const orgUri = generateOrgUri(orgName, ConfigFragmentName.Settings);
|
|
58
58
|
// setOrgUri(orgUri);
|
|
59
59
|
// }
|
|
60
60
|
// }, [currentRoute, platformState, orgName]);
|
|
@@ -66,8 +66,8 @@ export const usePermissionAutoFetch = (options?: userPermissionAutoFetchProps) =
|
|
|
66
66
|
// },
|
|
67
67
|
// options: {
|
|
68
68
|
// forceExist: false,
|
|
69
|
-
// authority:
|
|
70
|
-
// fragment:
|
|
69
|
+
// authority: ResourceAuthority.Defaultpermissions,
|
|
70
|
+
// fragment: ConfigFragmentName.Roles,
|
|
71
71
|
// },
|
|
72
72
|
// });
|
|
73
73
|
// return { ...remaining, loading: loading || settingLoading };
|
|
@@ -15,16 +15,17 @@ const LoadingComponent = () => (
|
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
const LifecycleComponent = ({ children }: { children?: any }) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
18
|
+
return <>{children}</>;
|
|
19
|
+
// const { authenticated } = isUserAuthenticated();
|
|
20
|
+
// if (authenticated) {
|
|
21
|
+
// return (
|
|
22
|
+
// <Lifecycle renderWhenPhase={LifecyclePhase.Restored} loadingRenderer={LoadingComponent}>
|
|
23
|
+
// {children}
|
|
24
|
+
// </Lifecycle>
|
|
25
|
+
// );
|
|
26
|
+
// } else {
|
|
27
|
+
// return <>{children}</>;
|
|
28
|
+
// }
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
const IntractionComponent = ({ children, interationTime }: { children?: any; interationTime: number }) => {
|