namirasoft-account-react 1.4.19 → 1.4.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/.env.template +10 -10
- package/config-overrides.js +72 -72
- package/dist/IEntityInfo.d.ts +11 -11
- package/dist/Messages.js.map +1 -1
- package/dist/NSARouterMaker.d.ts +0 -1
- package/dist/NSARouterMaker.js.map +1 -1
- package/dist/Router.d.ts +0 -1
- package/dist/components/NSAAccessListDialog.js.map +1 -1
- package/dist/components/NSAAccessListDialog.module.css +87 -0
- package/dist/components/NSABoxOTP.js.map +1 -1
- package/dist/components/NSABoxOTP.module.css +11 -0
- package/dist/components/NSAMessageListDialog.js.map +1 -1
- package/dist/components/NSAMessageListDialog.module.css +98 -0
- package/dist/components/NSAProductListDialog.js.map +1 -1
- package/dist/components/NSAProductListDialog.module.css +45 -0
- package/dist/components/NSAWorkspaceListDialog.js.map +1 -1
- package/dist/components/NSAWorkspaceListDialog.module.css +43 -0
- package/dist/index.js.map +1 -1
- package/dist/layouts/Actions.d.ts +2 -1
- package/dist/layouts/Actions.js +38 -17
- package/dist/layouts/Actions.js.map +1 -1
- package/dist/layouts/NSALayout.d.ts +2 -1
- package/dist/layouts/NSALayout.js +58 -37
- package/dist/layouts/NSALayout.js.map +1 -1
- package/dist/layouts/NSASectionEdit.d.ts +0 -1
- package/dist/layouts/NSASectionEdit.js +12 -8
- package/dist/layouts/NSASectionEdit.js.map +1 -1
- package/dist/layouts/NSASectionList.js +6 -4
- package/dist/layouts/NSASectionList.js.map +1 -1
- package/dist/layouts/NSASectionTabs.d.ts +0 -1
- package/dist/layouts/NSASectionTabs.js +4 -7
- package/dist/layouts/NSASectionTabs.js.map +1 -1
- package/dist/layouts/NSASectionView.js +4 -3
- package/dist/layouts/NSASectionView.js.map +1 -1
- package/dist/pages/NSAHomePage.module.css +23 -0
- package/dist/pages/NSALoginPage.module.css +20 -0
- package/dist/pages/NSAVerificationPage.module.css +23 -0
- package/package.json +70 -70
- package/public/index.html +21 -21
- package/src/App.css +31 -31
- package/src/App.tsx +18 -18
- package/src/IEntityInfo.ts +31 -31
- package/src/INSARouterMaker.ts +7 -7
- package/src/INSARouterProps.ts +17 -17
- package/src/INSARouterState.ts +5 -5
- package/src/Info.ts +20 -20
- package/src/Message.ts +6 -6
- package/src/Messages.ts +33 -33
- package/src/NSARouterMaker.tsx +142 -142
- package/src/Router.tsx +39 -39
- package/src/components/NSAAccessListDialog.module.css +86 -86
- package/src/components/NSAAccessListDialog.tsx +160 -160
- package/src/components/NSABoxOTP.module.css +10 -10
- package/src/components/NSABoxOTP.tsx +63 -63
- package/src/components/NSAMessageListDialog.module.css +97 -97
- package/src/components/NSAMessageListDialog.tsx +116 -116
- package/src/components/NSAProductListDialog.module.css +44 -44
- package/src/components/NSAProductListDialog.tsx +100 -100
- package/src/components/NSAWorkspaceListDialog.module.css +42 -42
- package/src/components/NSAWorkspaceListDialog.tsx +73 -73
- package/src/index.tsx +24 -24
- package/src/layouts/Actions.ts +147 -119
- package/src/layouts/Menus.ts +15 -15
- package/src/layouts/NSALayout.tsx +417 -387
- package/src/layouts/NSASectionEdit.tsx +144 -140
- package/src/layouts/NSASectionList.tsx +161 -158
- package/src/layouts/NSASectionTabs.tsx +152 -156
- package/src/layouts/NSASectionView.tsx +61 -60
- package/src/main.ts +19 -19
- package/src/pages/NSAHomePage.module.css +22 -22
- package/src/pages/NSAHomePage.tsx +27 -27
- package/src/pages/NSALoginPage.module.css +19 -19
- package/src/pages/NSALoginPage.tsx +65 -65
- package/src/pages/NSAVerificationPage.module.css +22 -22
- package/src/pages/NSAVerificationPage.tsx +59 -59
- package/tsconfig.json +43 -43
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { NSBoxSearch, NSDialog, NSDialogProps, NSLoading } from 'namirasoft-site-react';
|
|
2
|
-
import { Component } from 'react';
|
|
3
|
-
import { NamirasoftWorkspaceServer, WorkspaceRow } from 'namirasoft-workspace';
|
|
4
|
-
import { INSARouterProps } from '../INSARouterProps';
|
|
5
|
-
import { EnvService, SearchOperation } from 'namirasoft-core';
|
|
6
|
-
import Styles from './NSAWorkspaceListDialog.module.css';
|
|
7
|
-
|
|
8
|
-
export interface NSAWorkspaceListDialogProps extends INSARouterProps, NSDialogProps
|
|
9
|
-
{
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface NSAWorkspaceListDialogState
|
|
13
|
-
{
|
|
14
|
-
workspaces: WorkspaceRow[];
|
|
15
|
-
search: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export class NSAWorkspaceListDialog extends Component<NSAWorkspaceListDialogProps, NSAWorkspaceListDialogState>
|
|
19
|
-
{
|
|
20
|
-
constructor(props: NSAWorkspaceListDialogProps)
|
|
21
|
-
{
|
|
22
|
-
super(props);
|
|
23
|
-
this.state = { workspaces: [], search: "" };
|
|
24
|
-
}
|
|
25
|
-
override componentDidMount(): void
|
|
26
|
-
{
|
|
27
|
-
let REACT_APP_BASE_URL_WORKSPACE = new EnvService("REACT_APP_BASE_URL_WORKSPACE", true).getString();
|
|
28
|
-
let server = new NamirasoftWorkspaceServer(REACT_APP_BASE_URL_WORKSPACE, this.props.account.token_manager, this.props.notifier.onError);
|
|
29
|
-
server.workspace.List([], null, null).then(res =>
|
|
30
|
-
{
|
|
31
|
-
this.setState({ workspaces: res.rows });
|
|
32
|
-
}).catch(() => { });
|
|
33
|
-
}
|
|
34
|
-
override render()
|
|
35
|
-
{
|
|
36
|
-
let content = null;
|
|
37
|
-
if (this.state.workspaces == null)
|
|
38
|
-
{
|
|
39
|
-
content = <NSLoading />;
|
|
40
|
-
} else
|
|
41
|
-
{
|
|
42
|
-
let workspaces = SearchOperation.filter(this.state.workspaces, p => p.name, this.state.search);
|
|
43
|
-
content = (
|
|
44
|
-
<div className={Styles.nsa_workspace_list}>
|
|
45
|
-
{
|
|
46
|
-
workspaces.map((workspace) => (
|
|
47
|
-
<div className={Styles.nsa_workspace_border}>
|
|
48
|
-
<img src={"https://static.namirasoft.com/image/namirasoft/workspace/logo/base.png"} alt='No Profile' width={48} height={48} style={{ cursor: "pointer" }} />
|
|
49
|
-
<div className='d-flex flex-column align-items-start'>
|
|
50
|
-
<h2 className={Styles.nsa_workspace_h2}>{workspace.name}</h2>
|
|
51
|
-
<h6 className={Styles.nsa_workspace_h6}>{workspace.user_id}</h6>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
))
|
|
55
|
-
}
|
|
56
|
-
</div>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
return (
|
|
60
|
-
<NSDialog {...this.props}>
|
|
61
|
-
<NSBoxSearch
|
|
62
|
-
title=''
|
|
63
|
-
required={false}
|
|
64
|
-
placeholder='Search your workspace'
|
|
65
|
-
onChanged={(e) =>
|
|
66
|
-
{
|
|
67
|
-
this.setState({ search: e.getValue() });
|
|
68
|
-
}}
|
|
69
|
-
/>
|
|
70
|
-
{content}
|
|
71
|
-
</NSDialog>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
1
|
+
import { NSBoxSearch, NSDialog, NSDialogProps, NSLoading } from 'namirasoft-site-react';
|
|
2
|
+
import { Component } from 'react';
|
|
3
|
+
import { NamirasoftWorkspaceServer, WorkspaceRow } from 'namirasoft-workspace';
|
|
4
|
+
import { INSARouterProps } from '../INSARouterProps';
|
|
5
|
+
import { EnvService, SearchOperation } from 'namirasoft-core';
|
|
6
|
+
import Styles from './NSAWorkspaceListDialog.module.css';
|
|
7
|
+
|
|
8
|
+
export interface NSAWorkspaceListDialogProps extends INSARouterProps, NSDialogProps
|
|
9
|
+
{
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface NSAWorkspaceListDialogState
|
|
13
|
+
{
|
|
14
|
+
workspaces: WorkspaceRow[];
|
|
15
|
+
search: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class NSAWorkspaceListDialog extends Component<NSAWorkspaceListDialogProps, NSAWorkspaceListDialogState>
|
|
19
|
+
{
|
|
20
|
+
constructor(props: NSAWorkspaceListDialogProps)
|
|
21
|
+
{
|
|
22
|
+
super(props);
|
|
23
|
+
this.state = { workspaces: [], search: "" };
|
|
24
|
+
}
|
|
25
|
+
override componentDidMount(): void
|
|
26
|
+
{
|
|
27
|
+
let REACT_APP_BASE_URL_WORKSPACE = new EnvService("REACT_APP_BASE_URL_WORKSPACE", true).getString();
|
|
28
|
+
let server = new NamirasoftWorkspaceServer(REACT_APP_BASE_URL_WORKSPACE, this.props.account.token_manager, this.props.notifier.onError);
|
|
29
|
+
server.workspace.List([], null, null).then(res =>
|
|
30
|
+
{
|
|
31
|
+
this.setState({ workspaces: res.rows });
|
|
32
|
+
}).catch(() => { });
|
|
33
|
+
}
|
|
34
|
+
override render()
|
|
35
|
+
{
|
|
36
|
+
let content = null;
|
|
37
|
+
if (this.state.workspaces == null)
|
|
38
|
+
{
|
|
39
|
+
content = <NSLoading />;
|
|
40
|
+
} else
|
|
41
|
+
{
|
|
42
|
+
let workspaces = SearchOperation.filter(this.state.workspaces, p => p.name, this.state.search);
|
|
43
|
+
content = (
|
|
44
|
+
<div className={Styles.nsa_workspace_list}>
|
|
45
|
+
{
|
|
46
|
+
workspaces.map((workspace) => (
|
|
47
|
+
<div className={Styles.nsa_workspace_border}>
|
|
48
|
+
<img src={"https://static.namirasoft.com/image/namirasoft/workspace/logo/base.png"} alt='No Profile' width={48} height={48} style={{ cursor: "pointer" }} />
|
|
49
|
+
<div className='d-flex flex-column align-items-start'>
|
|
50
|
+
<h2 className={Styles.nsa_workspace_h2}>{workspace.name}</h2>
|
|
51
|
+
<h6 className={Styles.nsa_workspace_h6}>{workspace.user_id}</h6>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
))
|
|
55
|
+
}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
return (
|
|
60
|
+
<NSDialog {...this.props}>
|
|
61
|
+
<NSBoxSearch
|
|
62
|
+
title=''
|
|
63
|
+
required={false}
|
|
64
|
+
placeholder='Search your workspace'
|
|
65
|
+
onChanged={(e) =>
|
|
66
|
+
{
|
|
67
|
+
this.setState({ search: e.getValue() });
|
|
68
|
+
}}
|
|
69
|
+
/>
|
|
70
|
+
{content}
|
|
71
|
+
</NSDialog>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
74
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import ReactDOM from "react-dom/client";
|
|
2
|
-
import Router from "./Router";
|
|
3
|
-
import { BrowserRouter } from "react-router-dom";
|
|
4
|
-
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
5
|
-
import "./index.css";
|
|
6
|
-
|
|
7
|
-
const root = ReactDOM.createRoot(
|
|
8
|
-
document.getElementById("root") as HTMLElement
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
// base
|
|
12
|
-
const REACT_APP_BASE_PATH = process.env.REACT_APP_BASE_PATH;
|
|
13
|
-
if (REACT_APP_BASE_PATH)
|
|
14
|
-
{
|
|
15
|
-
const baseElement = document.createElement('base');
|
|
16
|
-
baseElement.href = REACT_APP_BASE_PATH + "/";
|
|
17
|
-
const head = document.querySelector('head');
|
|
18
|
-
head?.appendChild(baseElement);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
root.render(
|
|
22
|
-
<BrowserRouter>
|
|
23
|
-
<Router />
|
|
24
|
-
</BrowserRouter>
|
|
1
|
+
import ReactDOM from "react-dom/client";
|
|
2
|
+
import Router from "./Router";
|
|
3
|
+
import { BrowserRouter } from "react-router-dom";
|
|
4
|
+
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
5
|
+
import "./index.css";
|
|
6
|
+
|
|
7
|
+
const root = ReactDOM.createRoot(
|
|
8
|
+
document.getElementById("root") as HTMLElement
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
// base
|
|
12
|
+
const REACT_APP_BASE_PATH = process.env.REACT_APP_BASE_PATH;
|
|
13
|
+
if (REACT_APP_BASE_PATH)
|
|
14
|
+
{
|
|
15
|
+
const baseElement = document.createElement('base');
|
|
16
|
+
baseElement.href = REACT_APP_BASE_PATH + "/";
|
|
17
|
+
const head = document.querySelector('head');
|
|
18
|
+
head?.appendChild(baseElement);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
root.render(
|
|
22
|
+
<BrowserRouter>
|
|
23
|
+
<Router />
|
|
24
|
+
</BrowserRouter>
|
|
25
25
|
);
|
package/src/layouts/Actions.ts
CHANGED
|
@@ -1,120 +1,148 @@
|
|
|
1
|
-
import { INSActionMenuProps } from "namirasoft-site-react";
|
|
2
|
-
import { INSARouterProps } from "../INSARouterProps";
|
|
3
|
-
import { IEntityInfo } from "../IEntityInfo";
|
|
4
|
-
import { NamingConvention } from "namirasoft-core";
|
|
5
|
-
|
|
6
|
-
export class Actions
|
|
7
|
-
{
|
|
8
|
-
static home(name_lower_case_underscore: string): INSActionMenuProps[]
|
|
9
|
-
{
|
|
10
|
-
let Pascal_Case_Space = NamingConvention.lower_case_underscore.convert(name_lower_case_underscore, NamingConvention.Pascal_Case_Space);
|
|
11
|
-
let lower_case_slash = NamingConvention.lower_case_underscore.convert(name_lower_case_underscore, NamingConvention.lower_case_slash);
|
|
12
|
-
let lower_case_dash = NamingConvention.lower_case_underscore.convert(name_lower_case_underscore, NamingConvention.lower_case_dash);
|
|
13
|
-
return [
|
|
14
|
-
{
|
|
15
|
-
id: "home-1",
|
|
16
|
-
handler: () =>
|
|
17
|
-
{
|
|
18
|
-
window.location.href = "https://namirasoft.com/" + lower_case_slash
|
|
19
|
-
},
|
|
20
|
-
isActive: () => true,
|
|
21
|
-
menu_item: "Namirasoft " + Pascal_Case_Space
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: "home-2",
|
|
25
|
-
handler: () =>
|
|
26
|
-
{
|
|
27
|
-
window.location.href = `https://${lower_case_dash}.namirasoft.com/api/v1`
|
|
28
|
-
},
|
|
29
|
-
isActive: () => true,
|
|
30
|
-
menu_item: "API"
|
|
31
|
-
}
|
|
32
|
-
];
|
|
33
|
-
}
|
|
34
|
-
static apply(handler: () => void): INSActionMenuProps
|
|
35
|
-
{
|
|
36
|
-
return {
|
|
37
|
-
id: "0",
|
|
38
|
-
menu_item: "Apply",
|
|
39
|
-
handler,
|
|
40
|
-
isActive() { return true; }
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
static
|
|
44
|
-
{
|
|
45
|
-
return {
|
|
46
|
-
id: "1",
|
|
47
|
-
menu_item: "New",
|
|
48
|
-
handler: () =>
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
1
|
+
import { INSActionMenuProps } from "namirasoft-site-react";
|
|
2
|
+
import { INSARouterProps } from "../INSARouterProps";
|
|
3
|
+
import { IEntityInfo } from "../IEntityInfo";
|
|
4
|
+
import { NamingConvention } from "namirasoft-core";
|
|
5
|
+
|
|
6
|
+
export class Actions
|
|
7
|
+
{
|
|
8
|
+
static home(name_lower_case_underscore: string): INSActionMenuProps[]
|
|
9
|
+
{
|
|
10
|
+
let Pascal_Case_Space = NamingConvention.lower_case_underscore.convert(name_lower_case_underscore, NamingConvention.Pascal_Case_Space);
|
|
11
|
+
let lower_case_slash = NamingConvention.lower_case_underscore.convert(name_lower_case_underscore, NamingConvention.lower_case_slash);
|
|
12
|
+
let lower_case_dash = NamingConvention.lower_case_underscore.convert(name_lower_case_underscore, NamingConvention.lower_case_dash);
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
id: "home-1",
|
|
16
|
+
handler: () =>
|
|
17
|
+
{
|
|
18
|
+
window.location.href = "https://namirasoft.com/" + lower_case_slash
|
|
19
|
+
},
|
|
20
|
+
isActive: () => true,
|
|
21
|
+
menu_item: "Namirasoft " + Pascal_Case_Space
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "home-2",
|
|
25
|
+
handler: () =>
|
|
26
|
+
{
|
|
27
|
+
window.location.href = `https://${lower_case_dash}.namirasoft.com/api/v1`
|
|
28
|
+
},
|
|
29
|
+
isActive: () => true,
|
|
30
|
+
menu_item: "API"
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
static apply(handler: () => void): INSActionMenuProps
|
|
35
|
+
{
|
|
36
|
+
return {
|
|
37
|
+
id: "0",
|
|
38
|
+
menu_item: "Apply",
|
|
39
|
+
handler,
|
|
40
|
+
isActive() { return true; }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
static _new(props: INSARouterProps, entity: IEntityInfo<any>): INSActionMenuProps
|
|
44
|
+
{
|
|
45
|
+
return {
|
|
46
|
+
id: "1",
|
|
47
|
+
menu_item: "New",
|
|
48
|
+
handler: () =>
|
|
49
|
+
{
|
|
50
|
+
if (entity.client.getNewURL)
|
|
51
|
+
{
|
|
52
|
+
let link = props.url.getLink(entity.client.getNewURL(), {});
|
|
53
|
+
window.open(link, "_blank");
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
isActive() { return true; }
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static list(props: INSARouterProps, entity: IEntityInfo<any>): INSActionMenuProps
|
|
60
|
+
{
|
|
61
|
+
return {
|
|
62
|
+
id: "2",
|
|
63
|
+
menu_item: "List",
|
|
64
|
+
handler: () =>
|
|
65
|
+
{
|
|
66
|
+
if (entity.client.getListURL)
|
|
67
|
+
{
|
|
68
|
+
let link = props.url.getLink(entity.client.getListURL(), {});
|
|
69
|
+
window.open(link, "_blank");
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
isActive() { return true; }
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
static view(props: INSARouterProps, entity: IEntityInfo<any>, getIDs: () => string[]): INSActionMenuProps
|
|
76
|
+
{
|
|
77
|
+
return {
|
|
78
|
+
id: "3",
|
|
79
|
+
menu_item: "View",
|
|
80
|
+
handler: () =>
|
|
81
|
+
{
|
|
82
|
+
if (entity.client.getViewURL)
|
|
83
|
+
{
|
|
84
|
+
let ids = getIDs();
|
|
85
|
+
let link = props.url.getLink(entity.client.getViewURL(ids[0]), {});
|
|
86
|
+
window.open(link, "_blank");
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
isActive() { return getIDs().length === 1; }
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
static viewHistory(getIDs: () => string[]): INSActionMenuProps
|
|
93
|
+
{
|
|
94
|
+
return {
|
|
95
|
+
id: "4",
|
|
96
|
+
menu_item: "View History",
|
|
97
|
+
handler: () =>
|
|
98
|
+
{
|
|
99
|
+
let link = "https://history.namirasoft.com/history/view?id=" + getIDs()[0];
|
|
100
|
+
window.open(link, "_blank");
|
|
101
|
+
},
|
|
102
|
+
isActive() { return getIDs().length === 1; }
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
static copy(props: INSARouterProps, entity: IEntityInfo<any>, getIDs: () => string[]): INSActionMenuProps
|
|
106
|
+
{
|
|
107
|
+
return {
|
|
108
|
+
id: "5",
|
|
109
|
+
menu_item: "Copy",
|
|
110
|
+
handler: () =>
|
|
111
|
+
{
|
|
112
|
+
if (entity.client.getCopyURL)
|
|
113
|
+
{
|
|
114
|
+
let ids = getIDs();
|
|
115
|
+
let link = props.url.getLink(entity.client.getCopyURL(ids[0]), {});
|
|
116
|
+
window.open(link, "_blank");
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
isActive() { return getIDs().length === 1; }
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
static edit(props: INSARouterProps, entity: IEntityInfo<any>, getIDs: () => string[]): INSActionMenuProps
|
|
123
|
+
{
|
|
124
|
+
return {
|
|
125
|
+
id: "6",
|
|
126
|
+
menu_item: "Edit",
|
|
127
|
+
handler: () =>
|
|
128
|
+
{
|
|
129
|
+
if (entity.client.getEditURL)
|
|
130
|
+
{
|
|
131
|
+
let ids = getIDs();
|
|
132
|
+
let link = props.url.getLink(entity.client.getEditURL(ids[0]), {});
|
|
133
|
+
window.open(link, "_blank");
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
isActive() { return getIDs().length === 1; }
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
static delete(getIDs: () => string[], showDeleteDialog: () => void): INSActionMenuProps
|
|
140
|
+
{
|
|
141
|
+
return {
|
|
142
|
+
id: "7",
|
|
143
|
+
menu_item: "Delete",
|
|
144
|
+
handler: showDeleteDialog,
|
|
145
|
+
isActive() { return getIDs().length !== 0; }
|
|
146
|
+
}
|
|
147
|
+
}
|
|
120
148
|
}
|
package/src/layouts/Menus.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { INSActionMenuProps } from "namirasoft-site-react";
|
|
2
|
-
import { Actions } from "./Actions";
|
|
3
|
-
|
|
4
|
-
export class Menus
|
|
5
|
-
{
|
|
6
|
-
static home(name_lower_case_underscore: string): { [group: string]: INSActionMenuProps[]; }
|
|
7
|
-
{
|
|
8
|
-
let actions = Actions.home(name_lower_case_underscore);
|
|
9
|
-
let ans: { [group: string]: INSActionMenuProps[]; } = {};
|
|
10
|
-
actions.forEach(action =>
|
|
11
|
-
{
|
|
12
|
-
ans[action.id] = [action];
|
|
13
|
-
});
|
|
14
|
-
return ans;
|
|
15
|
-
}
|
|
1
|
+
import { INSActionMenuProps } from "namirasoft-site-react";
|
|
2
|
+
import { Actions } from "./Actions";
|
|
3
|
+
|
|
4
|
+
export class Menus
|
|
5
|
+
{
|
|
6
|
+
static home(name_lower_case_underscore: string): { [group: string]: INSActionMenuProps[]; }
|
|
7
|
+
{
|
|
8
|
+
let actions = Actions.home(name_lower_case_underscore);
|
|
9
|
+
let ans: { [group: string]: INSActionMenuProps[]; } = {};
|
|
10
|
+
actions.forEach(action =>
|
|
11
|
+
{
|
|
12
|
+
ans[action.id] = [action];
|
|
13
|
+
});
|
|
14
|
+
return ans;
|
|
15
|
+
}
|
|
16
16
|
}
|