namirasoft-account-react 1.4.225 → 1.4.227
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/dist/App.d.ts +2 -2
- package/dist/NSARouterMaker.d.ts +6 -10
- package/dist/NSARouterMaker.js +22 -52
- package/dist/NSARouterMaker.js.map +1 -1
- package/dist/NSARouterMakerComponent.d.ts +6 -0
- package/dist/NSARouterMakerComponent.js +2 -0
- package/dist/NSARouterMakerComponent.js.map +1 -0
- package/dist/{INSARouterProps.d.ts → NSARouterMakerProps.d.ts} +2 -2
- package/dist/NSARouterMakerProps.js +2 -0
- package/dist/NSARouterMakerProps.js.map +1 -0
- package/dist/Router.js +5 -5
- package/dist/Router.js.map +1 -1
- package/dist/components/NSAAccessListDialog.d.ts +2 -2
- package/dist/components/NSAMessageListDialog.d.ts +2 -2
- package/dist/components/NSAProductListDialog.d.ts +2 -2
- package/dist/components/NSAWorkspaceListDialog.d.ts +2 -2
- package/dist/components/NSBoxSecret.d.ts +2 -2
- package/dist/layouts/Actions.d.ts +6 -6
- package/dist/layouts/Actions.js.map +1 -1
- package/dist/layouts/NSALayout.d.ts +2 -2
- package/dist/layouts/NSALayout.js.map +1 -1
- package/dist/layouts/NSASectionEdit.d.ts +2 -2
- package/dist/layouts/NSASectionEditTabPage.d.ts +2 -2
- package/dist/layouts/NSASectionList.d.ts +2 -2
- package/dist/main.d.ts +3 -3
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/pages/NSAHomePage.d.ts +2 -2
- package/dist/pages/NSAHomePage.js.map +1 -1
- package/dist/pages/NSAVerificationPage.d.ts +3 -3
- package/dist/pages/NSAVerificationPage.js +2 -2
- package/dist/pages/NSAVerificationPage.js.map +1 -1
- package/package.json +3 -3
- package/src/App.tsx +2 -2
- package/src/NSARouterMaker.tsx +34 -71
- package/src/NSARouterMakerComponent.ts +8 -0
- package/src/{INSARouterProps.ts → NSARouterMakerProps.ts} +2 -2
- package/src/Router.tsx +9 -12
- package/src/components/NSAAccessListDialog.tsx +2 -2
- package/src/components/NSAMessageListDialog.tsx +2 -2
- package/src/components/NSAProductListDialog.tsx +2 -2
- package/src/components/NSAWorkspaceListDialog.tsx +2 -2
- package/src/components/NSBoxSecret.tsx +2 -2
- package/src/layouts/Actions.ts +6 -6
- package/src/layouts/NSALayout.tsx +2 -3
- package/src/layouts/NSASectionEdit.tsx +3 -3
- package/src/layouts/NSASectionEditTabPage.tsx +2 -2
- package/src/layouts/NSASectionList.tsx +2 -2
- package/src/layouts/NSASectionTabs.tsx +2 -2
- package/src/layouts/NSASectionView.tsx +2 -2
- package/src/main.ts +3 -3
- package/src/pages/NSAHomePage.tsx +2 -2
- package/src/pages/NSAVerificationPage.tsx +4 -4
- package/dist/INSARouterMaker.d.ts +0 -6
- package/dist/INSARouterMaker.js +0 -2
- package/dist/INSARouterMaker.js.map +0 -1
- package/dist/INSARouterProps.js +0 -2
- package/dist/INSARouterProps.js.map +0 -1
- package/dist/INSARouterState.d.ts +0 -4
- package/dist/INSARouterState.js +0 -2
- package/dist/INSARouterState.js.map +0 -1
- package/src/INSARouterMaker.ts +0 -8
- package/src/INSARouterState.ts +0 -6
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.227",
|
|
12
12
|
"author": "Amir Abolhasani",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"namirasoft-secret": "^1.4.30",
|
|
39
39
|
"namirasoft-site": "^1.4.24",
|
|
40
40
|
"namirasoft-site-map": "^1.4.18",
|
|
41
|
-
"namirasoft-site-react": "^1.4.
|
|
41
|
+
"namirasoft-site-react": "^1.4.321",
|
|
42
42
|
"namirasoft-workspace": "^1.4.22",
|
|
43
43
|
"os-browserify": "^0.3.0",
|
|
44
44
|
"path-browserify": "^1.0.1",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"react": "^18.3.1",
|
|
48
48
|
"react-app-rewired": "^2.2.1",
|
|
49
49
|
"react-dom": "^18.3.1",
|
|
50
|
-
"react-router-dom": "^7.
|
|
50
|
+
"react-router-dom": "^7.4.0",
|
|
51
51
|
"react-scripts": "5.0.1",
|
|
52
52
|
"run": "^1.5.0"
|
|
53
53
|
},
|
package/src/App.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NSARouterMakerProps } from "./NSARouterMakerProps";
|
|
2
2
|
import { NSALayout, NSALoginPage, NSASectionTabs } from "./main";
|
|
3
3
|
import { BaseColumnFormatter, DateTimeFormatter, IDFormatter, StringFormatter, StringFormatterSizeType } from "namirasoft-site-react";
|
|
4
4
|
import { ProductUUID } from "namirasoft-site";
|
|
5
5
|
import { NamirasoftFieldServer } from "namirasoft-field";
|
|
6
6
|
import { NamirasoftMap } from "namirasoft-site-map";
|
|
7
7
|
|
|
8
|
-
export interface AppProps extends
|
|
8
|
+
export interface AppProps extends NSARouterMakerProps
|
|
9
9
|
{ }
|
|
10
10
|
|
|
11
11
|
export function App(props: AppProps)
|
package/src/NSARouterMaker.tsx
CHANGED
|
@@ -1,72 +1,46 @@
|
|
|
1
1
|
import queryString, { ParsedQuery } from 'query-string';
|
|
2
2
|
import rrd from 'react-router-dom';
|
|
3
3
|
import axios from "axios";
|
|
4
|
-
import { EnvService, IStorageCookie, ObjectService, ParsedNameValue, URLOperation } from "namirasoft-core";
|
|
4
|
+
import { EnvService, IStorage, IStorageCookie, ObjectService, ParsedNameValue, URLOperation } from "namirasoft-core";
|
|
5
5
|
import { NamirasoftAccountServer, TokenManager } from "namirasoft-account";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { INSARouterState } from "./INSARouterState";
|
|
6
|
+
import { NSRouterMaker, NSRouterMakerProps } from 'namirasoft-site-react';
|
|
7
|
+
import { NSARouterMakerComponent } from "./NSARouterMakerComponent";
|
|
8
|
+
import { NSARouterMakerProps } from "./NSARouterMakerProps";
|
|
10
9
|
|
|
11
10
|
export class NSARouterMaker
|
|
12
11
|
{
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
12
|
+
private storage: IStorage;
|
|
13
|
+
private setState: () => void;
|
|
14
|
+
private component: NSARouterMakerComponent;
|
|
16
15
|
private location: rrd.Location;
|
|
17
16
|
private navigate: rrd.NavigateFunction;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
location: rrd.Location, navigate: rrd.NavigateFunction,
|
|
22
|
-
component: INSARouterMaker)
|
|
17
|
+
constructor(storage: IStorage, setState: () => void, component: NSARouterMakerComponent,
|
|
18
|
+
location: rrd.Location, navigate: rrd.NavigateFunction
|
|
19
|
+
)
|
|
23
20
|
{
|
|
24
|
-
this.
|
|
21
|
+
this.storage = storage;
|
|
25
22
|
this.setState = setState;
|
|
23
|
+
this.component = component;
|
|
26
24
|
this.location = location;
|
|
27
25
|
this.navigate = navigate;
|
|
28
|
-
this.
|
|
29
|
-
this.init = this.init.bind(this);
|
|
26
|
+
this.getProps = this.getProps.bind(this);
|
|
30
27
|
this.getQueryStrings = this.getQueryStrings.bind(this);
|
|
31
28
|
this.getQuery = this.getQuery.bind(this);
|
|
32
29
|
this.getLink = this.getLink.bind(this);
|
|
33
30
|
this.redirect = this.redirect.bind(this);
|
|
34
|
-
this.onComponentDidMount = this.onComponentDidMount.bind(this);
|
|
35
31
|
this.onRender = this.onRender.bind(this);
|
|
36
|
-
|
|
37
|
-
this.maker = new NSRouterMaker(this.state, this.setState, {
|
|
38
|
-
onRender: (ns_router_maker_props: INSRouterProps) =>
|
|
39
|
-
{
|
|
40
|
-
this.ns_router_maker_props = ns_router_maker_props;
|
|
41
|
-
let { inited, props } = this.init();
|
|
42
|
-
if (!inited)
|
|
43
|
-
return <></>;
|
|
44
|
-
let banned = false;
|
|
45
|
-
if (props.account.token_manager.exists())
|
|
46
|
-
{
|
|
47
|
-
banned = props.account.token_manager.getUserData(user => user.banned, false);
|
|
48
|
-
if (!banned)
|
|
49
|
-
return this.component.onRenderOnLogin(props);
|
|
50
|
-
}
|
|
51
|
-
return this.component.onRenderOnLogout(props, banned);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
32
|
}
|
|
56
|
-
private
|
|
33
|
+
private getProps(ns_router_maker_props: NSRouterMakerProps): NSARouterMakerProps
|
|
57
34
|
{
|
|
58
|
-
let qToken: string = this.getQuery("token");
|
|
59
35
|
let Cookies = process.env.REACT_APP_ACCOUNT_TOKEN;
|
|
60
36
|
let storage = new IStorageCookie({ domain: ".namirasoft.com", path: "/" }, Cookies);
|
|
61
|
-
let token_manager = new TokenManager(storage, () =>
|
|
62
|
-
if (qToken)
|
|
63
|
-
token_manager.setValue(qToken, true);
|
|
64
|
-
|
|
37
|
+
let token_manager = new TokenManager(storage, () => { });
|
|
65
38
|
|
|
66
39
|
let REACT_APP_BASE_URL_ACCOUNT = new EnvService("REACT_APP_BASE_URL_ACCOUNT", true).getString();
|
|
67
40
|
let REACT_APP_BASE_URL_ACCOUNT_CONSOLE = new EnvService("REACT_APP_BASE_URL_ACCOUNT_CONSOLE", true).getString();
|
|
68
41
|
let server = new NamirasoftAccountServer(REACT_APP_BASE_URL_ACCOUNT, token_manager, (error: Error) =>
|
|
69
42
|
{
|
|
43
|
+
// Todo this should be on every Server uses Account
|
|
70
44
|
if (axios.isAxiosError(error))
|
|
71
45
|
if (error.response)
|
|
72
46
|
if (error.response?.status === 401)
|
|
@@ -75,9 +49,9 @@ export class NSARouterMaker
|
|
|
75
49
|
window.location.href = REACT_APP_BASE_URL_ACCOUNT_CONSOLE;
|
|
76
50
|
return;
|
|
77
51
|
}
|
|
78
|
-
|
|
52
|
+
ns_router_maker_props.notifier.onError(error);
|
|
79
53
|
});
|
|
80
|
-
|
|
54
|
+
return {
|
|
81
55
|
account: {
|
|
82
56
|
token_manager,
|
|
83
57
|
server,
|
|
@@ -88,12 +62,8 @@ export class NSARouterMaker
|
|
|
88
62
|
getQueryStrings: this.getQueryStrings,
|
|
89
63
|
getQuery: this.getQuery,
|
|
90
64
|
},
|
|
91
|
-
...
|
|
65
|
+
...ns_router_maker_props
|
|
92
66
|
};
|
|
93
|
-
let inited = true;
|
|
94
|
-
if (qToken)
|
|
95
|
-
inited = this.state?.inited ?? false;
|
|
96
|
-
return { props, inited };
|
|
97
67
|
}
|
|
98
68
|
getQueryStrings(): ParsedQuery
|
|
99
69
|
{
|
|
@@ -116,30 +86,23 @@ export class NSARouterMaker
|
|
|
116
86
|
let ans = this.getLink(sub, customQuery);
|
|
117
87
|
this.navigate(ans);
|
|
118
88
|
}
|
|
119
|
-
|
|
89
|
+
onRender(): React.JSX.Element
|
|
120
90
|
{
|
|
121
|
-
let
|
|
122
|
-
|
|
123
|
-
let token = this.getQuery("token");
|
|
124
|
-
if (token)
|
|
125
|
-
{
|
|
126
|
-
if (!props.account.token_manager.getUserData(u => u.id, ""))
|
|
91
|
+
let maker = new NSRouterMaker(this.storage, this.setState, {
|
|
92
|
+
onRender: (ns_router_maker_props: NSRouterMakerProps) =>
|
|
127
93
|
{
|
|
128
|
-
props.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
});
|
|
94
|
+
let props = this.getProps(ns_router_maker_props);
|
|
95
|
+
let banned = false;
|
|
96
|
+
if (props.account.token_manager.exists())
|
|
97
|
+
{
|
|
98
|
+
banned = props.account.token_manager.getUserData(user => user.banned, false);
|
|
99
|
+
if (!banned)
|
|
100
|
+
return this.component.onRenderOnLogin(props);
|
|
101
|
+
}
|
|
102
|
+
return this.component.onRenderOnLogout(props, banned);
|
|
138
103
|
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
{
|
|
143
|
-
return this.maker.onRender();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
return maker.onRender();
|
|
144
107
|
}
|
|
145
108
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NSARouterMakerProps } from "./NSARouterMakerProps";
|
|
3
|
+
|
|
4
|
+
export interface NSARouterMakerComponent
|
|
5
|
+
{
|
|
6
|
+
onRenderOnLogin(props: NSARouterMakerProps): React.JSX.Element;
|
|
7
|
+
onRenderOnLogout(props: NSARouterMakerProps, banned: boolean): React.JSX.Element;
|
|
8
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NamirasoftAccountServer, TokenManager } from "namirasoft-account";
|
|
2
2
|
import { ParsedNameValue } from "namirasoft-core";
|
|
3
|
-
import {
|
|
3
|
+
import { NSRouterMakerProps } from "namirasoft-site-react";
|
|
4
4
|
import { ParsedQuery } from "query-string";
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface NSARouterMakerProps extends NSRouterMakerProps
|
|
7
7
|
{
|
|
8
8
|
account: {
|
|
9
9
|
token_manager: TokenManager
|
package/src/Router.tsx
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { NSARouterMaker } from './NSARouterMaker';
|
|
2
|
-
import {
|
|
3
|
-
import { INSARouterProps } from './INSARouterProps';
|
|
4
|
-
import { useEffect, useState } from 'react';
|
|
2
|
+
import { NSARouterMakerProps } from './NSARouterMakerProps';
|
|
5
3
|
import { Routes, Route, useLocation, useNavigate } from 'react-router-dom';
|
|
6
4
|
import { NSNotFoundPage } from 'namirasoft-site-react';
|
|
7
5
|
import { App } from './App';
|
|
8
|
-
|
|
6
|
+
import { IStorageSession } from 'namirasoft-core';
|
|
7
|
+
import { useState } from 'react';
|
|
9
8
|
|
|
10
9
|
export default function Router()
|
|
11
10
|
{
|
|
12
|
-
let [
|
|
11
|
+
let [_, setState] = useState<boolean>(true);
|
|
13
12
|
let location = useLocation();
|
|
14
13
|
let navigate = useNavigate();
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
|
|
15
|
+
const maker = new NSARouterMaker(new IStorageSession(), () => { setState(true); }, {
|
|
16
|
+
onRenderOnLogin: (props: NSARouterMakerProps) =>
|
|
17
17
|
{
|
|
18
18
|
return (
|
|
19
19
|
<>
|
|
@@ -24,7 +24,7 @@ export default function Router()
|
|
|
24
24
|
</>
|
|
25
25
|
);
|
|
26
26
|
},
|
|
27
|
-
onRenderOnLogout: (_:
|
|
27
|
+
onRenderOnLogout: (_: NSARouterMakerProps, __: boolean) =>
|
|
28
28
|
{
|
|
29
29
|
return (
|
|
30
30
|
<Routes>
|
|
@@ -32,10 +32,7 @@ export default function Router()
|
|
|
32
32
|
</Routes>
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
|
-
useEffect(maker.onComponentDidMount, []);
|
|
35
|
+
}, location, navigate);
|
|
39
36
|
|
|
40
37
|
return maker.onRender();
|
|
41
38
|
}
|
|
@@ -2,10 +2,10 @@ import React, { Component, createRef } from 'react';
|
|
|
2
2
|
import { EnvService } from 'namirasoft-core'
|
|
3
3
|
import { NamirasoftAccessServer, PermissionRow } from 'namirasoft-access';
|
|
4
4
|
import { NSLine, NSLoading, NSDialog, NSDialogProps, NSCopy, NSSpace, NSSpaceSizeType } from 'namirasoft-site-react';
|
|
5
|
-
import {
|
|
5
|
+
import { NSARouterMakerProps } from '../NSARouterMakerProps';
|
|
6
6
|
import Styles from './NSAAccessListDialog.module.css';
|
|
7
7
|
|
|
8
|
-
export interface NSAAccessListDialogProps extends
|
|
8
|
+
export interface NSAAccessListDialogProps extends NSARouterMakerProps, NSDialogProps
|
|
9
9
|
{
|
|
10
10
|
onClose: () => void;
|
|
11
11
|
}
|
|
@@ -2,10 +2,10 @@ import { Component } from 'react';
|
|
|
2
2
|
import { EnvService, FilterItem, FilterItemOperator, SortItem } from 'namirasoft-core';
|
|
3
3
|
import { IBaseComponentProps, NSButtonBlue, NSDialog, NSDialogProps, NSLoading, NSNoData, StringFormatter } from "namirasoft-site-react";
|
|
4
4
|
import { NamirasoftMessageMetaDatabase, MessageRow, NamirasoftMessageServer } from 'namirasoft-message';
|
|
5
|
-
import {
|
|
5
|
+
import { NSARouterMakerProps } from '../NSARouterMakerProps';
|
|
6
6
|
import Styles from './NSAMessageListDialog.module.css';
|
|
7
7
|
|
|
8
|
-
export interface NSAMessageListDialogProps extends
|
|
8
|
+
export interface NSAMessageListDialogProps extends NSARouterMakerProps, NSDialogProps, IBaseComponentProps
|
|
9
9
|
{
|
|
10
10
|
onClose: () => void;
|
|
11
11
|
onSeenAll: () => void;
|
|
@@ -2,11 +2,11 @@ import { Component } from 'react';
|
|
|
2
2
|
import { EnvService, CacheService, IStorageLocal, SearchOperation, PackageService } from 'namirasoft-core';
|
|
3
3
|
import { NamirasoftAPIProductServer, ProductFullRow } from 'namirasoft-api-product';
|
|
4
4
|
import { NSBoxSearch, NSDialog, NSDialogProps, NSLoading } from 'namirasoft-site-react';
|
|
5
|
-
import {
|
|
5
|
+
import { NSARouterMakerProps } from '../NSARouterMakerProps';
|
|
6
6
|
import Styles from './NSAProductListDialog.module.css';
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
export interface NSAProductListDialogProps extends
|
|
9
|
+
export interface NSAProductListDialogProps extends NSARouterMakerProps, NSDialogProps
|
|
10
10
|
{
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NSBoxSearch, NSCopy, NSDialog, NSDialogProps, NSLoading } from 'namirasoft-site-react';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import { NamirasoftWorkspaceServer, WorkspaceRow } from 'namirasoft-workspace';
|
|
4
|
-
import {
|
|
4
|
+
import { NSARouterMakerProps } from '../NSARouterMakerProps';
|
|
5
5
|
import { EnvService, SearchOperation } from 'namirasoft-core';
|
|
6
6
|
import Styles from './NSAWorkspaceListDialog.module.css';
|
|
7
7
|
|
|
8
|
-
export interface NSAWorkspaceListDialogProps extends
|
|
8
|
+
export interface NSAWorkspaceListDialogProps extends NSARouterMakerProps, NSDialogProps
|
|
9
9
|
{ }
|
|
10
10
|
|
|
11
11
|
export interface NSAWorkspaceListDialogState
|
|
@@ -2,9 +2,9 @@ import React, { createRef } from "react";
|
|
|
2
2
|
import { IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps, INSBox, NSBoxPassword, safeMenuMenuItem } from "namirasoft-site-react";
|
|
3
3
|
import { NamirasoftSecretMetaDatabase, NamirasoftSecretServer } from "namirasoft-secret";
|
|
4
4
|
import { BaseUUID, EnvService } from "namirasoft-core";
|
|
5
|
-
import {
|
|
5
|
+
import { NSARouterMakerProps } from "../NSARouterMakerProps";
|
|
6
6
|
|
|
7
|
-
export interface NSBoxSecretProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps<string, NSBoxSecret>,
|
|
7
|
+
export interface NSBoxSecretProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps<string, NSBoxSecret>, NSARouterMakerProps
|
|
8
8
|
{ }
|
|
9
9
|
|
|
10
10
|
interface NSBoxSecretState
|
package/src/layouts/Actions.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NSMenuActionProps } from "namirasoft-site-react";
|
|
2
|
-
import {
|
|
2
|
+
import { NSARouterMakerProps } from "../NSARouterMakerProps";
|
|
3
3
|
import { IEntityInfo } from "../IEntityInfo";
|
|
4
4
|
import { EnvService, FilterItem, FilterItemOperator } from "namirasoft-core";
|
|
5
5
|
import { NamirasoftHistoryMetaDatabase } from "namirasoft-history";
|
|
@@ -15,7 +15,7 @@ export class Actions
|
|
|
15
15
|
isActive() { return true; }
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
static _new(props:
|
|
18
|
+
static _new(props: NSARouterMakerProps, entity: IEntityInfo<any>): NSMenuActionProps
|
|
19
19
|
{
|
|
20
20
|
return {
|
|
21
21
|
id: "1",
|
|
@@ -31,7 +31,7 @@ export class Actions
|
|
|
31
31
|
isActive() { return true; }
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
static list(props:
|
|
34
|
+
static list(props: NSARouterMakerProps, entity: IEntityInfo<any>): NSMenuActionProps
|
|
35
35
|
{
|
|
36
36
|
return {
|
|
37
37
|
id: "2",
|
|
@@ -47,7 +47,7 @@ export class Actions
|
|
|
47
47
|
isActive() { return true; }
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
static view(props:
|
|
50
|
+
static view(props: NSARouterMakerProps, entity: IEntityInfo<any>, getIDs: () => string[]): NSMenuActionProps
|
|
51
51
|
{
|
|
52
52
|
return {
|
|
53
53
|
id: "3",
|
|
@@ -81,7 +81,7 @@ export class Actions
|
|
|
81
81
|
isActive() { return getIDs().length === 1; }
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
static copy(props:
|
|
84
|
+
static copy(props: NSARouterMakerProps, entity: IEntityInfo<any>, getIDs: () => string[]): NSMenuActionProps
|
|
85
85
|
{
|
|
86
86
|
return {
|
|
87
87
|
id: "5",
|
|
@@ -98,7 +98,7 @@ export class Actions
|
|
|
98
98
|
isActive() { return getIDs().length === 1; }
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
static edit(props:
|
|
101
|
+
static edit(props: NSARouterMakerProps, entity: IEntityInfo<any>, getIDs: () => string[]): NSMenuActionProps
|
|
102
102
|
{
|
|
103
103
|
return {
|
|
104
104
|
id: "6",
|
|
@@ -7,7 +7,7 @@ import { NSASectionEdit, NSASectionEditProps, NSASectionEditRef } from './NSASec
|
|
|
7
7
|
import { NSASectionView, NSASectionViewProps, NSASectionViewRef } from './NSASectionView';
|
|
8
8
|
import { NSASectionList, NSASectionListProps } from './NSASectionList';
|
|
9
9
|
import { Actions } from './Actions';
|
|
10
|
-
import {
|
|
10
|
+
import { NSARouterMakerProps } from '../NSARouterMakerProps';
|
|
11
11
|
import { IEntityInfo } from '../IEntityInfo';
|
|
12
12
|
import { NSAProductListDialog } from '../components/NSAProductListDialog';
|
|
13
13
|
import { NSAWorkspaceListDialog } from '../components/NSAWorkspaceListDialog';
|
|
@@ -20,7 +20,7 @@ import { NamirasoftAccountClient } from 'namirasoft-account-client';
|
|
|
20
20
|
let REACT_APP_BASE_URL_ACCOUNT_CONSOLE = new EnvService("REACT_APP_BASE_URL_ACCOUNT_CONSOLE").getString();
|
|
21
21
|
let client = new NamirasoftAccountClient(REACT_APP_BASE_URL_ACCOUNT_CONSOLE);
|
|
22
22
|
|
|
23
|
-
export interface NSALayoutProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends IBaseComponentProps,
|
|
23
|
+
export interface NSALayoutProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends IBaseComponentProps, NSARouterMakerProps
|
|
24
24
|
{
|
|
25
25
|
scope: string;
|
|
26
26
|
logo: string;
|
|
@@ -277,7 +277,6 @@ export const NSALayout = forwardRef<any, any>(<EntityType extends { id: string }
|
|
|
277
277
|
setState(prevState => ({ ...prevState, showAccessListDialog: false }));
|
|
278
278
|
}} />
|
|
279
279
|
}
|
|
280
|
-
|
|
281
280
|
</>,
|
|
282
281
|
tooltip: "Accsess"
|
|
283
282
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IBaseComponentProps, NSTabPageTab } from "namirasoft-site-react";
|
|
2
2
|
import { NSSection, NSPanel, NSButtonBlue, NSLine, NSSpace, NSSpaceSizeType } from 'namirasoft-site-react';
|
|
3
|
-
import {
|
|
3
|
+
import { NSARouterMakerProps } from "../NSARouterMakerProps";
|
|
4
4
|
import { forwardRef, ReactNode, useImperativeHandle, useRef } from "react";
|
|
5
5
|
import { IEntityInfo } from "../IEntityInfo";
|
|
6
6
|
import { NamingConvention } from "namirasoft-core";
|
|
@@ -9,7 +9,7 @@ import { NSASectionEditTabPage } from "./NSASectionEditTabPage";
|
|
|
9
9
|
import { CategoryRow, FieldRow } from "namirasoft-field";
|
|
10
10
|
import { useParams } from "react-router-dom";
|
|
11
11
|
|
|
12
|
-
export interface NSASectionEditProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends
|
|
12
|
+
export interface NSASectionEditProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends NSARouterMakerProps, IBaseComponentProps
|
|
13
13
|
{
|
|
14
14
|
isEdit: boolean;
|
|
15
15
|
ui: {
|
|
@@ -29,7 +29,7 @@ export interface NSASectionEditProps<EntityType extends { id: string }, EntityTy
|
|
|
29
29
|
onEntityLoaded?: (item: EntityType) => void;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
interface NSASectionEditInnerProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends NSASectionEditProps<EntityType, EntityTypeInput>,
|
|
32
|
+
interface NSASectionEditInnerProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends NSASectionEditProps<EntityType, EntityTypeInput>, NSARouterMakerProps
|
|
33
33
|
{
|
|
34
34
|
entity: IEntityInfo<EntityType, EntityTypeInput>,
|
|
35
35
|
ctf: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IBaseComponentProps, NSBoxBooleans, NSBoxDynamic, NSColumn, NSRepeaterNSTag, NSRow, NSTabPage, NSTabPageTab } from "namirasoft-site-react";
|
|
2
|
-
import {
|
|
2
|
+
import { NSARouterMakerProps } from "../NSARouterMakerProps";
|
|
3
3
|
import { Component, createRef, ReactNode } from "react";
|
|
4
4
|
import { CategoryRow, FieldRow } from "namirasoft-field";
|
|
5
5
|
import { EntityCategoryInputRow, EntityFieldInputRow, EntityTagInputRow } from "namirasoft-field";
|
|
@@ -9,7 +9,7 @@ import { CTFRow } from "../CTFRow";
|
|
|
9
9
|
import { NSASectionTabsMore } from "./NSASectionTabsMore";
|
|
10
10
|
import Styles from "./NSASectionEditTabPage.module.css";
|
|
11
11
|
|
|
12
|
-
export interface NSASectionEditTabPageProps<EntityType, EntityTypeInput = EntityType> extends
|
|
12
|
+
export interface NSASectionEditTabPageProps<EntityType, EntityTypeInput = EntityType> extends NSARouterMakerProps
|
|
13
13
|
{
|
|
14
14
|
id: string | undefined;
|
|
15
15
|
entity: IEntityInfo<EntityType & { id: string }, EntityTypeInput>;
|
|
@@ -3,7 +3,7 @@ import { FilterItem, FilterItemColumnType, NamingConvention, ObjectService, Sear
|
|
|
3
3
|
import { NSLine, NSSpace, NSSpaceSizeType, NSTable, NSFilterBox, NSFilterBoxProps_Table, NSFilterBoxProps_Column, TableColumnInfo, TableRowInfo, IBaseComponentProps } from "namirasoft-site-react";
|
|
4
4
|
import { CategoryRow, FieldRow } from "namirasoft-field";
|
|
5
5
|
import { IEntityInfo } from "../IEntityInfo";
|
|
6
|
-
import {
|
|
6
|
+
import { NSARouterMakerProps } from "../NSARouterMakerProps";
|
|
7
7
|
import { NSASectionTabs, NSASectionTabsItemsProps } from "./NSASectionTabs";
|
|
8
8
|
import { FilterItemColumnTypeBuilder, VariableType } from "namirasoft-schema";
|
|
9
9
|
|
|
@@ -17,7 +17,7 @@ export interface NSASectionListProps<EntityType extends { id: string }> extends
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
interface NSASectionListInnerProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends NSASectionListProps<EntityType>,
|
|
20
|
+
interface NSASectionListInnerProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends NSASectionListProps<EntityType>, NSARouterMakerProps
|
|
21
21
|
{
|
|
22
22
|
entity: IEntityInfo<EntityType, EntityTypeInput>;
|
|
23
23
|
onIDsChanged: () => void;
|
|
@@ -4,7 +4,7 @@ import { EnvService, FilterItem, FilterItemOperator, IStorageLocal, NamingConven
|
|
|
4
4
|
import { BaseColumnFormatter, DateTimeFormatter, IDFormatter, NSLabel, NSLoading, NSTable, NSTabPage, StringFormatter, NSTabPageTab, StringFormatterSizeType, NSNoData } from "namirasoft-site-react";
|
|
5
5
|
import { HistoryRow, NamirasoftHistoryServer } from "namirasoft-history";
|
|
6
6
|
import { IEntityInfo } from "../IEntityInfo";
|
|
7
|
-
import {
|
|
7
|
+
import { NSARouterMakerProps } from "../NSARouterMakerProps";
|
|
8
8
|
import { CategoryRow, FieldRow } from "namirasoft-field";
|
|
9
9
|
import { CFTUtil } from "./CFTUtil";
|
|
10
10
|
import { NSASectionTabsMore } from "./NSASectionTabsMore";
|
|
@@ -29,7 +29,7 @@ export interface NSASectionTabsItemsProps
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
interface NSASectionTabsItemsInnerProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends NSASectionTabsItemsProps,
|
|
32
|
+
interface NSASectionTabsItemsInnerProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends NSASectionTabsItemsProps, NSARouterMakerProps, NSASectionTabsProps
|
|
33
33
|
{
|
|
34
34
|
entity: IEntityInfo<EntityType, EntityTypeInput>;
|
|
35
35
|
ctf: {
|
|
@@ -3,7 +3,7 @@ import { IEntityInfo } from "../IEntityInfo";
|
|
|
3
3
|
import { useParams } from "react-router-dom";
|
|
4
4
|
import { forwardRef, ReactNode, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
5
5
|
import { IBaseComponentProps, NSLoading } from "namirasoft-site-react";
|
|
6
|
-
import {
|
|
6
|
+
import { NSARouterMakerProps } from "../NSARouterMakerProps";
|
|
7
7
|
import { CategoryRow, FieldRow } from "namirasoft-field";
|
|
8
8
|
|
|
9
9
|
export interface NSASectionViewProps<EntityType> extends IBaseComponentProps
|
|
@@ -16,7 +16,7 @@ export interface NSASectionViewProps<EntityType> extends IBaseComponentProps
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
interface NSASectionViewInnerProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends NSASectionViewProps<EntityType>,
|
|
19
|
+
interface NSASectionViewInnerProps<EntityType extends { id: string }, EntityTypeInput = EntityType> extends NSASectionViewProps<EntityType>, NSARouterMakerProps
|
|
20
20
|
{
|
|
21
21
|
entity: IEntityInfo<EntityType, EntityTypeInput>;
|
|
22
22
|
ctf: {
|
package/src/main.ts
CHANGED
|
@@ -12,7 +12,7 @@ export * from "./pages/NSALoginPage";
|
|
|
12
12
|
export * from "./pages/NSAVerificationPage";
|
|
13
13
|
export * from "./IEntityInfo";
|
|
14
14
|
export * from "./Info";
|
|
15
|
-
export * from "./
|
|
16
|
-
export * from "./
|
|
17
|
-
export * from "./
|
|
15
|
+
export * from "./NSARouterMaker";
|
|
16
|
+
export * from "./NSARouterMakerComponent";
|
|
17
|
+
export * from "./NSARouterMakerProps";
|
|
18
18
|
export * from "./NSARouterMaker";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IBaseComponentProps, NSBarTitleProps,
|
|
1
|
+
import { IBaseComponentProps, NSBarTitleProps, NSRouterMakerProps, NSListProduct, NSSpace, NSSpaceSizeType } from 'namirasoft-site-react';
|
|
2
2
|
import Styles from './NSAHomePage.module.css';
|
|
3
3
|
|
|
4
|
-
export interface NSAHomePageProps extends IBaseComponentProps, NSBarTitleProps,
|
|
4
|
+
export interface NSAHomePageProps extends IBaseComponentProps, NSBarTitleProps, NSRouterMakerProps
|
|
5
5
|
{
|
|
6
6
|
scope: string;
|
|
7
7
|
title: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import Styles from './NSAVerificationPage.module.css';
|
|
2
|
-
import { IBaseComponentProps, INSRouterProps, NSBoxString } from 'namirasoft-site-react';
|
|
3
1
|
import { ReactNode, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { IBaseComponentProps, NSRouterMakerProps, NSBoxString } from 'namirasoft-site-react';
|
|
4
3
|
import { NSSection, NSSpace, NSSpaceSizeType, NSButtonBlue } from 'namirasoft-site-react';
|
|
5
|
-
import {
|
|
4
|
+
import { NSARouterMakerProps } from '../NSARouterMakerProps';
|
|
5
|
+
import Styles from './NSAVerificationPage.module.css';
|
|
6
6
|
|
|
7
|
-
export interface INSAVerificationPageProps extends IBaseComponentProps,
|
|
7
|
+
export interface INSAVerificationPageProps extends IBaseComponentProps, NSRouterMakerProps, NSARouterMakerProps
|
|
8
8
|
{
|
|
9
9
|
contact_type: string;
|
|
10
10
|
contact_value_name: string;
|
package/dist/INSARouterMaker.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"INSARouterMaker.js","sourceRoot":"","sources":["../src/INSARouterMaker.ts"],"names":[],"mappings":""}
|
package/dist/INSARouterProps.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"INSARouterProps.js","sourceRoot":"","sources":["../src/INSARouterProps.ts"],"names":[],"mappings":""}
|
package/dist/INSARouterState.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"INSARouterState.js","sourceRoot":"","sources":["../src/INSARouterState.ts"],"names":[],"mappings":""}
|
package/src/INSARouterMaker.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { INSARouterProps } from "./INSARouterProps";
|
|
3
|
-
|
|
4
|
-
export interface INSARouterMaker
|
|
5
|
-
{
|
|
6
|
-
onRenderOnLogin(props: INSARouterProps): React.JSX.Element;
|
|
7
|
-
onRenderOnLogout(props: INSARouterProps, banned: boolean): React.JSX.Element;
|
|
8
|
-
}
|