namirasoft-account-react 1.4.102 → 1.4.104
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.
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { Component, createRef } from 'react';
|
|
3
3
|
import { EnvService } from 'namirasoft-core';
|
|
4
4
|
import { NamirasoftAccessServer } from 'namirasoft-access';
|
|
5
|
-
import { NSLine, NSLoading, NSDialog, NSCopy } from 'namirasoft-site-react';
|
|
5
|
+
import { NSLine, NSLoading, NSDialog, NSCopy, NSSpace, NSSpaceSizeType } from 'namirasoft-site-react';
|
|
6
6
|
import Styles from './NSAAccessListDialog.module.css';
|
|
7
7
|
export class NSAAccessListDialog extends Component {
|
|
8
8
|
constructor(props) {
|
|
@@ -30,26 +30,25 @@ export class NSAAccessListDialog extends Component {
|
|
|
30
30
|
let profile = null;
|
|
31
31
|
let content = null;
|
|
32
32
|
if (this.state.permissions === null)
|
|
33
|
-
content =
|
|
34
|
-
_jsx(NSLoading, {});
|
|
33
|
+
content = (_jsx(NSLoading, {}));
|
|
35
34
|
else {
|
|
36
35
|
let user_id = this.props.account.token_manager.getUserData(u => u.id, "");
|
|
37
36
|
let first_name = this.props.account.token_manager.getUserData(u => u.first_name, "");
|
|
38
37
|
let last_name = this.props.account.token_manager.getUserData(u => u.last_name, "");
|
|
39
38
|
let email = this.props.account.token_manager.getUserData(u => u.email, "");
|
|
40
39
|
let generate = (permission) => {
|
|
41
|
-
return _jsxs("div", { className: Styles.ns_access_account_container, onClick: () => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: Styles.ns_access_account_container, onClick: () => {
|
|
41
|
+
let REACT_APP_BASE_URL_ACCESS = new EnvService("REACT_APP_BASE_URL_ACCESS", true).getString();
|
|
42
|
+
let server = new NamirasoftAccessServer(REACT_APP_BASE_URL_ACCESS, this.props.account.token_manager, this.props.notifier.onError);
|
|
43
|
+
if (permission.id)
|
|
44
|
+
server.access.SetOwner({ owner_id: permission.user_id }).then(() => {
|
|
45
|
+
this.props.onClose();
|
|
46
|
+
}).catch(() => { });
|
|
47
|
+
else
|
|
48
|
+
server.access.SetOwner({ owner_id: null }).then(() => {
|
|
49
|
+
this.props.onClose();
|
|
50
|
+
}).catch(() => { });
|
|
51
|
+
}, children: [_jsx("div", { className: Styles.ns_access_account_info, children: _jsx("img", { src: "https://static.namirasoft.com/image/concept/no-profile/grey.svg", alt: 'User Profile', width: 48, height: 48, className: 'rounded-circle' }) }), _jsxs("div", { className: 'd-flex flex-column', style: { padding: "8px 0px" }, children: [_jsx("h4", { children: `${permission.first_name} ${permission.last_name}`.trim() }), _jsx("p", { children: permission.email }), _jsx(NSCopy, { classList: ["flex-row"], id: current.user_id, children: _jsx("h2", { className: 'text-center', style: { cursor: "pointer" }, children: permission.user_id }) })] })] }, permission.id), _jsx(NSSpace, { size: NSSpaceSizeType.MINI })] }));
|
|
53
52
|
};
|
|
54
53
|
let me = {
|
|
55
54
|
id: "",
|
|
@@ -65,10 +64,11 @@ export class NSAAccessListDialog extends Component {
|
|
|
65
64
|
let permissions = [me, ...this.state.permissions];
|
|
66
65
|
let current = permissions.filter(x => x.default)[0];
|
|
67
66
|
content = permissions.filter(x => !x.default).map(generate);
|
|
68
|
-
profile = _jsx(_Fragment, { children: _jsxs("div", { className: 'text-center d-flex flex-column justify-content-center align-items-center pb-2', children: [_jsx("img", { src: "https://static.namirasoft.com/image/namirasoft/access/logo/circle.png", alt: 'No Profile', width: 103, height: 103, className: 'rounded-circle', style: { cursor: "default", pointerEvents: "none" } }), _jsx("h6", { className: "pb-2", children: "
|
|
67
|
+
profile = _jsx(_Fragment, { children: _jsxs("div", { className: 'text-center d-flex flex-column justify-content-center align-items-center pb-2', children: [_jsx("img", { src: "https://static.namirasoft.com/image/namirasoft/access/logo/circle.png", alt: 'No Profile', width: 103, height: 103, className: 'rounded-circle', style: { cursor: "default", pointerEvents: "none" } }), _jsx("h6", { className: "pb-2", children: "You are working as:" }), _jsxs("div", { className: 'd-flex flex-column', style: { padding: "8px 0px" }, children: [_jsx("h4", { children: `${current.first_name} ${current.last_name}`.trim() }), _jsx("p", { children: current.email }), _jsx(NSCopy, { classList: ["flex-row"], id: current.user_id, children: _jsx("h2", { className: 'text-center', style: { cursor: "pointer" }, children: current.user_id }) })] })] }) });
|
|
69
68
|
}
|
|
70
|
-
return (_jsxs(NSDialog, Object.assign({}, this.props, { children: [_jsx("a", { className: 'text-left w-100 ps-3', href: 'https://access.namirasoft.com/permission/incoming/list/', target: "_blank", rel: "noopener noreferrer", children: _jsx("span", { className: 'd-flex justify-content-left', children: "Manage Accesss" }) }), _jsxs("section", { className: Styles.ns_access_container, children: [profile ? profile : _jsx(NSLoading, {}), _jsx(NSLine, {}), _jsx("h6", { children: "Switch user as:" }), content
|
|
71
|
-
|
|
69
|
+
return (_jsxs(NSDialog, Object.assign({}, this.props, { children: [_jsx("a", { className: 'text-left w-100 ps-3', href: 'https://access.namirasoft.com/permission/incoming/list/', target: "_blank", rel: "noopener noreferrer", children: _jsx("span", { className: 'd-flex justify-content-left', children: "Manage Accesss" }) }), _jsxs("section", { className: Styles.ns_access_container, children: [profile ? profile : _jsx(NSLoading, {}), _jsx(NSLine, {}), _jsx("h6", { children: "Switch user as:" }), content == null &&
|
|
70
|
+
_jsxs("p", { children: ["There is no ", _jsx("strong", { children: "Incoming Permission" }), ".", _jsx("br", {}), _jsx("br", {}), "If you would like to get access to other user's account and act on their behalf, you must request them to grant you ", _jsx("strong", { children: "Outgoing Permission" }), " using ", _jsx("a", { href: 'https://account.namirasoft.com', target: '_blank', rel: "noreferrer", children: "Namirasoft Access" }), " from their account."] }), content != null &&
|
|
71
|
+
content] })] })));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
//# sourceMappingURL=NSAAccessListDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSAAccessListDialog.js","sourceRoot":"","sources":["../../src/components/NSAAccessListDialog.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,sBAAsB,EAAiB,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAiB,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"NSAAccessListDialog.js","sourceRoot":"","sources":["../../src/components/NSAAccessListDialog.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,sBAAsB,EAAiB,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAiB,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErH,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAYtD,MAAM,OAAO,mBAAoB,SAAQ,SAA6D;IAIrG,YAAY,KAA+B;QAE1C,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,SAAS,EAAE,CAAC;QAC5B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;IACQ,iBAAiB;QAEzB,QAAQ,CAAC,gBAAgB,CAAC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I,CAAC,KAAK,eACvB,YAAG,SAAS,EAAC,sBAAsB,EAAC,IAAI,EAAC,yDAAyD,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,YAC3I,eAAM,SAAS,EAAC,6BAA6B,+BAAsB,GAChE,EACJ,mBAAS,SAAS,EAAE,MAAM,CAAC,mBAAmB,aAC5C,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAC,SAAS,KAAG,EAClC,KAAC,MAAM,KAAG,EACV,2CAAwB,EAEvB,OAAO,IAAI,IAAI;4BACf,wCAAe,mDAAoC,OAAC,cAAM,EAAA,cAAM,0HAAoH,mDAAoC,aAAO,YAAG,IAAI,EAAC,gCAAgC,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,kCAAsB,4BAAwB,EAGtV,OAAO,IAAI,IAAI;4BACf,OAAO,IAEC,KACC,CACZ,CAAC;IACH,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.4.
|
|
11
|
+
"version": "1.4.104",
|
|
12
12
|
"author": "Amir Abolhasani",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -21,18 +21,20 @@
|
|
|
21
21
|
"copy": "copyfiles -u 1 src/**/*.html src/**/*.css src/**/*.svg src/**/*.png src/**/*.jpg dist/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
25
|
+
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
|
|
24
26
|
"@types/device-uuid": "^1.0.3",
|
|
25
27
|
"@types/react": "^18.3.13",
|
|
26
28
|
"device-uuid": "^1.0.4",
|
|
27
|
-
"namirasoft-access": "^1.4.
|
|
29
|
+
"namirasoft-access": "^1.4.29",
|
|
28
30
|
"namirasoft-account": "^1.4.28",
|
|
29
31
|
"namirasoft-account-client": "^1.4.0",
|
|
30
|
-
"namirasoft-api-product": "^1.4.
|
|
32
|
+
"namirasoft-api-product": "^1.4.11",
|
|
31
33
|
"namirasoft-core": "^1.4.25",
|
|
32
34
|
"namirasoft-field": "^1.4.4",
|
|
33
35
|
"namirasoft-history": "^1.4.8",
|
|
34
36
|
"namirasoft-message": "^1.4.8",
|
|
35
|
-
"namirasoft-site-react": "^1.4.
|
|
37
|
+
"namirasoft-site-react": "^1.4.130",
|
|
36
38
|
"namirasoft-workspace": "^1.4.7",
|
|
37
39
|
"os-browserify": "^0.3.0",
|
|
38
40
|
"path-browserify": "^1.0.1",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
text-align: left;
|
|
8
8
|
font-weight: 300;
|
|
9
9
|
font-size: 16px;
|
|
10
|
-
cursor:
|
|
10
|
+
cursor: pointer;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.ns_access_container h2 {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
text-align: center;
|
|
16
16
|
font-weight: 600;
|
|
17
17
|
font-size: 16px;
|
|
18
|
-
cursor:
|
|
18
|
+
cursor: pointer;
|
|
19
19
|
margin: 0;
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
font-weight: 600;
|
|
25
25
|
font-size: 16px;
|
|
26
26
|
text-align: left;
|
|
27
|
-
cursor:
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
margin: 0px;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
.ns_access_content h6 {
|
|
@@ -33,11 +34,16 @@
|
|
|
33
34
|
margin: 0;
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
.ns_access_container p {
|
|
38
|
+
padding: 0;
|
|
39
|
+
margin: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
.ns_access_account_container {
|
|
37
43
|
display: flex;
|
|
38
44
|
cursor: pointer;
|
|
39
45
|
border: none;
|
|
40
|
-
background-color: rgba(
|
|
46
|
+
background-color: rgba(224, 226, 235, 1);
|
|
41
47
|
border-radius: 8px;
|
|
42
48
|
align-items: center;
|
|
43
49
|
gap: 10px;
|
|
@@ -77,7 +83,7 @@
|
|
|
77
83
|
display: flex;
|
|
78
84
|
justify-content: center;
|
|
79
85
|
align-items: center;
|
|
80
|
-
cursor:
|
|
86
|
+
cursor: pointer;
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
.ns_line {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component, createRef } from 'react';
|
|
2
2
|
import { EnvService } from 'namirasoft-core'
|
|
3
3
|
import { NamirasoftAccessServer, PermissionRow } from 'namirasoft-access';
|
|
4
|
-
import { NSLine, NSLoading, NSDialog, NSDialogProps, NSCopy } from 'namirasoft-site-react';
|
|
4
|
+
import { NSLine, NSLoading, NSDialog, NSDialogProps, NSCopy, NSSpace, NSSpaceSizeType } from 'namirasoft-site-react';
|
|
5
5
|
import { INSARouterProps } from '../INSARouterProps';
|
|
6
6
|
import Styles from './NSAAccessListDialog.module.css';
|
|
7
7
|
|
|
@@ -50,8 +50,9 @@ export class NSAAccessListDialog extends Component<NSAAccessListDialogProps, NSA
|
|
|
50
50
|
let profile = null;
|
|
51
51
|
let content = null;
|
|
52
52
|
if (this.state.permissions === null)
|
|
53
|
-
content =
|
|
53
|
+
content = (
|
|
54
54
|
<NSLoading />
|
|
55
|
+
);
|
|
55
56
|
else
|
|
56
57
|
{
|
|
57
58
|
let user_id = this.props.account.token_manager.getUserData(u => u.id, "");
|
|
@@ -60,33 +61,43 @@ export class NSAAccessListDialog extends Component<NSAAccessListDialogProps, NSA
|
|
|
60
61
|
let email = this.props.account.token_manager.getUserData(u => u.email, "");
|
|
61
62
|
let generate = (permission: PermissionRow) =>
|
|
62
63
|
{
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
let server = new NamirasoftAccessServer(REACT_APP_BASE_URL_ACCESS, this.props.account.token_manager, this.props.notifier.onError);
|
|
70
|
-
if (permission.id)
|
|
71
|
-
server.access.SetOwner({ owner_id: permission.user_id }).then(() =>
|
|
72
|
-
{
|
|
73
|
-
this.props.onClose();
|
|
74
|
-
}).catch(() => { });
|
|
75
|
-
else
|
|
76
|
-
server.access.SetOwner({ owner_id: null }).then(() =>
|
|
64
|
+
return (
|
|
65
|
+
<>
|
|
66
|
+
<div
|
|
67
|
+
key={permission.id}
|
|
68
|
+
className={Styles.ns_access_account_container}
|
|
69
|
+
onClick={() =>
|
|
77
70
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
let REACT_APP_BASE_URL_ACCESS = new EnvService("REACT_APP_BASE_URL_ACCESS", true).getString();
|
|
72
|
+
let server = new NamirasoftAccessServer(REACT_APP_BASE_URL_ACCESS, this.props.account.token_manager, this.props.notifier.onError);
|
|
73
|
+
if (permission.id)
|
|
74
|
+
server.access.SetOwner({ owner_id: permission.user_id }).then(() =>
|
|
75
|
+
{
|
|
76
|
+
this.props.onClose();
|
|
77
|
+
}).catch(() => { });
|
|
78
|
+
else
|
|
79
|
+
server.access.SetOwner({ owner_id: null }).then(() =>
|
|
80
|
+
{
|
|
81
|
+
this.props.onClose();
|
|
82
|
+
}).catch(() => { });
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<div className={Styles.ns_access_account_info}>
|
|
86
|
+
<img src={"https://static.namirasoft.com/image/concept/no-profile/grey.svg"} alt='User Profile' width={48} height={48} className='rounded-circle' />
|
|
87
|
+
</div>
|
|
88
|
+
<div className='d-flex flex-column' style={{ padding: "8px 0px" }}>
|
|
89
|
+
<h4>{`${permission.first_name} ${permission.last_name}`.trim()}</h4>
|
|
90
|
+
<p>{permission.email}</p>
|
|
91
|
+
<NSCopy classList={["flex-row"]} id={current.user_id}>
|
|
92
|
+
<h2 className='text-center' style={{ cursor: "pointer" }} >
|
|
93
|
+
{permission.user_id}
|
|
94
|
+
</h2>
|
|
95
|
+
</NSCopy>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<NSSpace size={NSSpaceSizeType.MINI} />
|
|
99
|
+
</>
|
|
100
|
+
);
|
|
90
101
|
}
|
|
91
102
|
let me: PermissionRow = {
|
|
92
103
|
id: "",
|
|
@@ -108,13 +119,17 @@ export class NSAAccessListDialog extends Component<NSAAccessListDialogProps, NSA
|
|
|
108
119
|
'text-center d-flex flex-column justify-content-center align-items-center pb-2'
|
|
109
120
|
>
|
|
110
121
|
<img src={"https://static.namirasoft.com/image/namirasoft/access/logo/circle.png"} alt='No Profile' width={103} height={103} className='rounded-circle' style={{ cursor: "default", pointerEvents: "none" }} />
|
|
111
|
-
<h6 className="pb-2">
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</
|
|
116
|
-
|
|
117
|
-
|
|
122
|
+
<h6 className="pb-2">You are working as:</h6>
|
|
123
|
+
|
|
124
|
+
<div className='d-flex flex-column' style={{ padding: "8px 0px" }}>
|
|
125
|
+
<h4>{`${current.first_name} ${current.last_name}`.trim()}</h4>
|
|
126
|
+
<p>{current.email}</p>
|
|
127
|
+
<NSCopy classList={["flex-row"]} id={current.user_id}>
|
|
128
|
+
<h2 className='text-center' style={{ cursor: "pointer" }} >
|
|
129
|
+
{current.user_id}
|
|
130
|
+
</h2>
|
|
131
|
+
</NSCopy>
|
|
132
|
+
</div>
|
|
118
133
|
</div >
|
|
119
134
|
</>;
|
|
120
135
|
}
|
|
@@ -127,8 +142,13 @@ export class NSAAccessListDialog extends Component<NSAAccessListDialogProps, NSA
|
|
|
127
142
|
{profile ? profile : <NSLoading />}
|
|
128
143
|
<NSLine />
|
|
129
144
|
<h6>Switch user as:</h6>
|
|
130
|
-
{
|
|
131
|
-
|
|
145
|
+
{
|
|
146
|
+
content == null &&
|
|
147
|
+
<p>There is no <strong>Incoming Permission</strong>.<br /><br />If you would like to get access to other user's account and act on their behalf, you must request them to grant you <strong>Outgoing Permission</strong> using <a href='https://account.namirasoft.com' target='_blank' rel="noreferrer">Namirasoft Access</a> from their account.</p>
|
|
148
|
+
}
|
|
149
|
+
{
|
|
150
|
+
content != null &&
|
|
151
|
+
content
|
|
132
152
|
}
|
|
133
153
|
</section>
|
|
134
154
|
</NSDialog >
|
|
@@ -52,7 +52,7 @@ export const NSASectionTabs = forwardRef<any, any>(<EntityType extends { id: str
|
|
|
52
52
|
setState(prevState => ({ ...prevState, row }));
|
|
53
53
|
}).catch(() => { });
|
|
54
54
|
}
|
|
55
|
-
// eslint-disable-line
|
|
55
|
+
// eslint-disable-next-line
|
|
56
56
|
}, [props.id]);
|
|
57
57
|
|
|
58
58
|
//todo
|