namirasoft-account-react 1.5.13 → 1.5.15
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/FieldCacheService.d.ts +14 -1
- package/dist/FieldCacheService.js +28 -2
- package/dist/FieldCacheService.js.map +1 -1
- package/dist/NSARouterMaker.d.ts +7 -12
- package/dist/NSARouterMaker.js +29 -35
- package/dist/NSARouterMaker.js.map +1 -1
- package/dist/NSARouterMakerProps.d.ts +17 -23
- package/dist/NSARouterMakerResult.d.ts +26 -0
- package/dist/NSARouterMakerResult.js +2 -0
- package/dist/NSARouterMakerResult.js.map +1 -0
- package/dist/NSFRouterMaker.d.ts +10 -0
- package/dist/NSFRouterMaker.js +27 -0
- package/dist/NSFRouterMaker.js.map +1 -0
- package/dist/Router.d.ts +1 -1
- package/dist/Router.js +5 -11
- package/dist/Router.js.map +1 -1
- package/dist/components/NSAAccessListDialog.d.ts +2 -2
- package/dist/components/NSABoxSecret.d.ts +2 -2
- package/dist/components/NSAMasterMenu.d.ts +2 -2
- package/dist/components/NSAMasterMenuItem.d.ts +2 -2
- package/dist/components/NSAMessageListDialog.d.ts +4 -4
- package/dist/components/NSAMessageListDialog.js +2 -2
- package/dist/components/NSAMessageListDialog.js.map +1 -1
- package/dist/components/NSAProductListDialog.d.ts +2 -2
- package/dist/components/NSATable.d.ts +0 -3
- package/dist/components/NSATable.js +3 -34
- package/dist/components/NSATable.js.map +1 -1
- package/dist/components/NSAUserDialog.d.ts +2 -2
- package/dist/components/NSAWorkspaceListDialog.d.ts +2 -2
- package/dist/components/NSFBoxCategoryScope.d.ts +2 -2
- package/dist/components/NSFBoxSlot.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 -7
- package/dist/layouts/NSALayout.js +88 -86
- package/dist/layouts/NSALayout.js.map +1 -1
- package/dist/layouts/NSASectionEdit.d.ts +3 -4
- package/dist/layouts/NSASectionEdit.js.map +1 -1
- package/dist/layouts/NSASectionEditTabPage.d.ts +2 -3
- package/dist/layouts/NSASectionEditTabPage.js +1 -1
- package/dist/layouts/NSASectionEditTabPage.js.map +1 -1
- package/dist/layouts/NSASectionList.d.ts +2 -3
- package/dist/layouts/NSASectionList.js.map +1 -1
- package/dist/layouts/NSASectionView.d.ts +2 -3
- package/dist/layouts/NSASectionView.js.map +1 -1
- package/dist/layouts/NSASectionViewTabMore.d.ts +2 -2
- package/dist/layouts/NSASectionViewTabMore.js +3 -2
- package/dist/layouts/NSASectionViewTabMore.js.map +1 -1
- package/dist/layouts/NSASectionViewTabPage.d.ts +2 -3
- package/dist/layouts/NSASectionViewTabPage.js +1 -1
- package/dist/layouts/NSASectionViewTabPage.js.map +1 -1
- package/dist/main.d.ts +2 -4
- package/dist/main.js +2 -4
- package/dist/main.js.map +1 -1
- package/dist/pages/NSAConsentPage.d.ts +2 -2
- package/dist/pages/NSAEmailVerificationPage.d.ts +2 -2
- package/dist/pages/NSAHomePage.d.ts +3 -3
- package/dist/pages/NSAHomePage.js +5 -5
- package/dist/pages/NSAHomePage.js.map +1 -1
- package/dist/pages/NSAPhoneVerificationPage.d.ts +2 -2
- package/dist/pages/NSAPhoneVerificationPage.js +1 -1
- package/dist/pages/NSAPhoneVerificationPage.js.map +1 -1
- package/dist/pages/NSAVerificationPage.d.ts +3 -3
- package/dist/pages/NSAVerificationPage.js +2 -3
- package/dist/pages/NSAVerificationPage.js.map +1 -1
- package/dist/pages/NSFCategoryEditPage.d.ts +2 -2
- package/dist/pages/NSFCategoryListPage.d.ts +2 -2
- package/dist/pages/NSFCategoryViewPage.d.ts +2 -2
- package/dist/pages/NSFEntities.d.ts +2 -2
- package/dist/pages/NSFEntities.js.map +1 -1
- package/dist/pages/PaymentRequired.d.ts +2 -2
- package/dist/pages/PaymentRequired.js.map +1 -1
- package/package.json +2 -2
- package/src/App.tsx +2 -2
- package/src/FieldCacheService.tsx +85 -0
- package/src/NSARouterMaker.tsx +38 -45
- package/src/NSARouterMakerProps.ts +19 -21
- package/src/NSARouterMakerResult.ts +25 -0
- package/src/NSFRouterMaker.tsx +37 -0
- package/src/Router.tsx +15 -12
- package/src/components/NSAAccessListDialog.tsx +2 -2
- package/src/components/NSABoxSecret.tsx +2 -2
- package/src/components/NSAMasterMenu.tsx +6 -6
- package/src/components/NSAMasterMenuItem.tsx +2 -2
- package/src/components/NSAMessageListDialog.tsx +4 -4
- package/src/components/NSAProductListDialog.tsx +2 -2
- package/src/components/NSATable.tsx +3 -54
- package/src/components/NSAUserDialog.tsx +2 -2
- package/src/components/NSAWorkspaceListDialog.tsx +2 -2
- package/src/components/NSFBoxCategoryScope.tsx +2 -2
- package/src/components/NSFBoxSlot.tsx +2 -2
- package/src/layouts/Actions.ts +6 -6
- package/src/layouts/NSALayout.tsx +159 -161
- package/src/layouts/NSASectionEdit.tsx +3 -4
- package/src/layouts/NSASectionEditTabPage.tsx +3 -4
- package/src/layouts/NSASectionList.tsx +2 -3
- package/src/layouts/NSASectionView.tsx +2 -3
- package/src/layouts/NSASectionViewTabMore.tsx +8 -7
- package/src/layouts/NSASectionViewTabPage.tsx +3 -4
- package/src/main.ts +2 -4
- package/src/pages/NSAConsentPage.tsx +2 -2
- package/src/pages/NSAEmailVerificationPage.tsx +2 -2
- package/src/pages/NSAHomePage.tsx +23 -22
- package/src/pages/NSAPhoneVerificationPage.tsx +3 -3
- package/src/pages/NSAVerificationPage.tsx +4 -5
- package/src/pages/NSFCategoryEditPage.tsx +2 -2
- package/src/pages/NSFCategoryListPage.tsx +2 -2
- package/src/pages/NSFCategoryViewPage.tsx +2 -2
- package/src/pages/NSFEntities.ts +2 -2
- package/src/pages/PaymentRequired.tsx +5 -5
- package/dist/App.css +0 -32
- package/dist/NSARouter.d.ts +0 -16
- package/dist/NSARouter.js +0 -42
- package/dist/NSARouter.js.map +0 -1
- package/dist/NSARouterMakerConfig.d.ts +0 -14
- package/dist/NSARouterMakerConfig.js +0 -2
- package/dist/NSARouterMakerConfig.js.map +0 -1
- package/dist/components/NSAReorderDialog.d.ts +0 -30
- package/dist/components/NSAReorderDialog.js +0 -69
- package/dist/components/NSAReorderDialog.js.map +0 -1
- package/dist/components/NSAReorderDialog.module.css +0 -50
- package/dist/components/NSASortDialog.d.ts +0 -21
- package/dist/components/NSASortDialog.js +0 -61
- package/dist/components/NSASortDialog.js.map +0 -1
- package/dist/layouts/NSARouter.d.ts +0 -16
- package/dist/layouts/NSARouter.js +0 -38
- package/dist/layouts/NSARouter.js.map +0 -1
- package/dist/layouts/NSARouter_Field.d.ts +0 -8
- package/dist/layouts/NSARouter_Field.js +0 -92
- package/dist/layouts/NSARouter_Field.js.map +0 -1
- package/src/App.css +0 -32
- package/src/FieldCacheService.ts +0 -37
- package/src/NSARouter.tsx +0 -69
- package/src/NSARouterMakerConfig.ts +0 -16
- package/src/components/NSAReorderDialog.module.css +0 -50
- package/src/components/NSAReorderDialog.tsx +0 -150
- package/src/components/NSASortDialog.tsx +0 -118
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NamirasoftAccountClient } from 'namirasoft-account-client';
|
|
2
2
|
import { ProductFullRow } from 'namirasoft-api-product';
|
|
3
3
|
import { CacheService, EnvService, IStorageLocal, NamingConvention } from 'namirasoft-core';
|
|
4
|
-
import { EntityResolveResponseRow } from 'namirasoft-field';
|
|
5
4
|
import { NamirasoftMessageServer } from 'namirasoft-message';
|
|
6
5
|
import { NamirasoftMap } from 'namirasoft-site-map';
|
|
7
6
|
import { IBackgroundProps, IBaseComponentProps, IHeaderIconProps, IHeaderRightProps, NSBarActionProps, NSBarAlertProps, NSBarTitleProps, NSDialogDelete, NSLayout, NSLoading, ProductCacheService } from 'namirasoft-site-react';
|
|
@@ -18,7 +17,7 @@ import { NSAWorkspaceListDialog } from '../components/NSAWorkspaceListDialog';
|
|
|
18
17
|
import { FieldCacheService } from '../FieldCacheService';
|
|
19
18
|
import { IEntityInfo } from '../IEntityInfo';
|
|
20
19
|
import { NSACacheService } from '../NSACacheService';
|
|
21
|
-
import {
|
|
20
|
+
import { NSARouterMakerResult } from '../NSARouterMakerResult';
|
|
22
21
|
import { UseParams } from '../UseParams';
|
|
23
22
|
import { Actions } from './Actions';
|
|
24
23
|
import { NSALayout_Field } from './NSALayout_Field';
|
|
@@ -61,7 +60,7 @@ export interface NSALayoutPagesProps<RowType extends { id: string }, RowTypeInpu
|
|
|
61
60
|
};
|
|
62
61
|
view?: NSASectionViewCutomProps<RowType>;
|
|
63
62
|
}
|
|
64
|
-
export interface NSALayoutCustomProps<RowType extends { id: string }, RowTypeInput = RowType> extends IBaseComponentProps,
|
|
63
|
+
export interface NSALayoutCustomProps<RowType extends { id: string }, RowTypeInput = RowType> extends IBaseComponentProps, NSARouterMakerResult
|
|
65
64
|
{
|
|
66
65
|
action?: NSBarActionProps;
|
|
67
66
|
title?: NSBarTitleProps;
|
|
@@ -111,8 +110,6 @@ interface NSALayoutState
|
|
|
111
110
|
showWorkspaceListDialog: boolean;
|
|
112
111
|
showUserDialog: boolean;
|
|
113
112
|
showMasterMenu: boolean;
|
|
114
|
-
ctf_enabled: boolean;
|
|
115
|
-
ctf_rows: EntityResolveResponseRow | null;
|
|
116
113
|
}
|
|
117
114
|
|
|
118
115
|
export class NSALayout<RowType extends { id: string }, RowTypeInput = RowType> extends Component<NSALayoutProps<RowType, RowTypeInput>, NSALayoutState>
|
|
@@ -122,7 +119,6 @@ export class NSALayout<RowType extends { id: string }, RowTypeInput = RowType> e
|
|
|
122
119
|
private hasCFT: boolean;
|
|
123
120
|
private isLoggedIn: boolean;
|
|
124
121
|
private cache_product: CacheService<ProductFullRow>;
|
|
125
|
-
private cache_field: CacheService<EntityResolveResponseRow>;
|
|
126
122
|
private cache_message: CacheService<number>;
|
|
127
123
|
private cache_master_menu: CacheService<{ open: boolean }>;
|
|
128
124
|
NSASectionList_Ref = createRef<NSASectionList<RowType, RowTypeInput>>();
|
|
@@ -151,9 +147,6 @@ export class NSALayout<RowType extends { id: string }, RowTypeInput = RowType> e
|
|
|
151
147
|
// Cache Product
|
|
152
148
|
this.cache_product = ProductCacheService.get(this.props.product_id, console.error);
|
|
153
149
|
|
|
154
|
-
// Cache Fields
|
|
155
|
-
this.cache_field = FieldCacheService.get(this.props.account.token_manager, this.props.product_id, props.notifier.onError)
|
|
156
|
-
|
|
157
150
|
// Cache Message
|
|
158
151
|
this.cache_message = new CacheService<number>("ns-messsage-count", new IStorageLocal(), 15, async () => "1.0.0", async () =>
|
|
159
152
|
{
|
|
@@ -181,8 +174,6 @@ export class NSALayout<RowType extends { id: string }, RowTypeInput = RowType> e
|
|
|
181
174
|
showWorkspaceListDialog: false,
|
|
182
175
|
showUserDialog: false,
|
|
183
176
|
showMasterMenu: false,
|
|
184
|
-
ctf_enabled: this.hasCFT,
|
|
185
|
-
ctf_rows: null
|
|
186
177
|
};
|
|
187
178
|
}
|
|
188
179
|
public reloadMessageCount(force: boolean)
|
|
@@ -249,15 +240,6 @@ export class NSALayout<RowType extends { id: string }, RowTypeInput = RowType> e
|
|
|
249
240
|
this.setState(() => ({ showMasterMenu: status.open }));
|
|
250
241
|
})
|
|
251
242
|
|
|
252
|
-
if (this.hasCFT)
|
|
253
|
-
if (this.props.pages?.entity)
|
|
254
|
-
{
|
|
255
|
-
this.cache_field.get().then(res =>
|
|
256
|
-
{
|
|
257
|
-
this.setState(prev => { return { ...prev, ctf_rows: res } });
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
|
|
261
243
|
if (this.isLoggedIn)
|
|
262
244
|
this.reloadMessageCount(false);
|
|
263
245
|
|
|
@@ -276,20 +258,6 @@ export class NSALayout<RowType extends { id: string }, RowTypeInput = RowType> e
|
|
|
276
258
|
{
|
|
277
259
|
client.stop();
|
|
278
260
|
}
|
|
279
|
-
private getCTF(): { enabled: boolean; rows: EntityResolveResponseRow | null; }
|
|
280
|
-
{
|
|
281
|
-
const rows = this.state.ctf_rows;
|
|
282
|
-
if (!rows)
|
|
283
|
-
return { enabled: this.state.ctf_enabled, rows: null };
|
|
284
|
-
const entity_name = NamingConvention.auto.convert((this.props.pages?.entity?.name ?? "").trim(), NamingConvention.lower_case);
|
|
285
|
-
return {
|
|
286
|
-
enabled: this.state.ctf_enabled,
|
|
287
|
-
rows: {
|
|
288
|
-
...rows,
|
|
289
|
-
slots: rows.slots.filter(slot => NamingConvention.auto.convert((slot.entity ?? "").trim(), NamingConvention.lower_case) === entity_name),
|
|
290
|
-
},
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
261
|
override render()
|
|
294
262
|
{
|
|
295
263
|
this.onDidMounted_Ready = false;
|
|
@@ -530,21 +498,31 @@ export class NSALayout<RowType extends { id: string }, RowTypeInput = RowType> e
|
|
|
530
498
|
if (this.props.pages?.list)
|
|
531
499
|
{
|
|
532
500
|
action_name = "List";
|
|
533
|
-
content = <
|
|
534
|
-
ref={this.NSASectionList_Ref}
|
|
501
|
+
content = <FieldCacheService
|
|
535
502
|
{...this.props}
|
|
536
|
-
{
|
|
537
|
-
entity={this.props.pages.entity}
|
|
538
|
-
onIDsChanged={() =>
|
|
503
|
+
render={rows =>
|
|
539
504
|
{
|
|
540
|
-
this.
|
|
541
|
-
|
|
505
|
+
if (this.props.pages?.list)
|
|
506
|
+
return <NSASectionList<RowType, RowTypeInput>
|
|
507
|
+
ref={this.NSASectionList_Ref}
|
|
508
|
+
{...this.props}
|
|
509
|
+
{...this.props.pages.list}
|
|
510
|
+
entity={this.props.pages.entity}
|
|
511
|
+
onIDsChanged={() =>
|
|
512
|
+
{
|
|
513
|
+
this.setState(prev => ({ ...prev }));
|
|
514
|
+
this.props.pages?.list?.onIDsChanged?.();
|
|
515
|
+
}}
|
|
516
|
+
ctf={{
|
|
517
|
+
enabled: this.hasCFT,
|
|
518
|
+
rows
|
|
519
|
+
}}
|
|
520
|
+
>
|
|
521
|
+
{this.props.children}
|
|
522
|
+
</NSASectionList>;
|
|
523
|
+
return <></>;
|
|
542
524
|
}}
|
|
543
|
-
|
|
544
|
-
deleteFieldCache={() => { this.cache_field.del(); }}
|
|
545
|
-
>
|
|
546
|
-
{this.props.children}
|
|
547
|
-
</NSASectionList>
|
|
525
|
+
/>;
|
|
548
526
|
}
|
|
549
527
|
else if (this.props.pages?.edit)
|
|
550
528
|
{
|
|
@@ -552,54 +530,73 @@ export class NSALayout<RowType extends { id: string }, RowTypeInput = RowType> e
|
|
|
552
530
|
action_name = "Edit";
|
|
553
531
|
else
|
|
554
532
|
action_name = "New";
|
|
555
|
-
content =
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
533
|
+
content = <FieldCacheService
|
|
534
|
+
{...this.props}
|
|
535
|
+
render={rows =>
|
|
536
|
+
{
|
|
537
|
+
if (this.props.pages?.edit)
|
|
538
|
+
return <NSASectionEdit
|
|
539
|
+
ref={this.NSASectionEdit_Ref}
|
|
540
|
+
{...this.props}
|
|
541
|
+
{...this.props.pages.edit}
|
|
542
|
+
entity={this.props.pages.entity}
|
|
543
|
+
ctf={{
|
|
544
|
+
enabled: this.hasCFT,
|
|
545
|
+
rows
|
|
546
|
+
}}
|
|
547
|
+
onRowLoaded={(row) =>
|
|
548
|
+
{
|
|
549
|
+
this.setState(prev => ({ ...prev }), () =>
|
|
550
|
+
{
|
|
551
|
+
this.props.pages?.edit?.onRowLoaded?.(row);
|
|
552
|
+
});
|
|
553
|
+
}}
|
|
554
|
+
model={{
|
|
555
|
+
id,
|
|
556
|
+
row: null
|
|
557
|
+
}}
|
|
558
|
+
>
|
|
559
|
+
{this.props.children}
|
|
560
|
+
</NSASectionEdit>;
|
|
561
|
+
return <></>;
|
|
562
|
+
}}
|
|
563
|
+
/>;
|
|
578
564
|
}
|
|
579
565
|
else if (this.props.pages?.view)
|
|
580
566
|
{
|
|
581
567
|
action_name = "View";
|
|
582
|
-
|
|
583
|
-
|
|
568
|
+
|
|
569
|
+
content = <FieldCacheService
|
|
584
570
|
{...this.props}
|
|
585
|
-
{
|
|
586
|
-
entity={this.props.pages.entity}
|
|
587
|
-
ctf={this.getCTF()}
|
|
588
|
-
deleteFieldCache={() => { this.cache_field.del(); }}
|
|
589
|
-
onRowLoaded={(row) =>
|
|
571
|
+
render={rows =>
|
|
590
572
|
{
|
|
591
|
-
this.
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
573
|
+
if (this.props.pages?.view)
|
|
574
|
+
return <NSASectionView
|
|
575
|
+
ref={this.NSASectionView_Ref}
|
|
576
|
+
{...this.props}
|
|
577
|
+
{...this.props.pages.view}
|
|
578
|
+
entity={this.props.pages.entity}
|
|
579
|
+
ctf={{
|
|
580
|
+
enabled: this.hasCFT,
|
|
581
|
+
rows
|
|
582
|
+
}}
|
|
583
|
+
onRowLoaded={(row) =>
|
|
584
|
+
{
|
|
585
|
+
this.setState(prev => ({ ...prev }), () =>
|
|
586
|
+
{
|
|
587
|
+
this.props.pages?.view?.onRowLoaded?.(row);
|
|
588
|
+
});
|
|
589
|
+
}}
|
|
590
|
+
model={{
|
|
591
|
+
id,
|
|
592
|
+
row: null
|
|
593
|
+
}}
|
|
594
|
+
>
|
|
595
|
+
{this.props.children}
|
|
596
|
+
</NSASectionView>;
|
|
597
|
+
return <></>;
|
|
599
598
|
}}
|
|
600
|
-
|
|
601
|
-
{this.props.children}
|
|
602
|
-
</NSASectionView>
|
|
599
|
+
/>;
|
|
603
600
|
}
|
|
604
601
|
else
|
|
605
602
|
content = this.props.children;
|
|
@@ -652,84 +649,85 @@ export class NSALayout<RowType extends { id: string }, RowTypeInput = RowType> e
|
|
|
652
649
|
}}
|
|
653
650
|
/>
|
|
654
651
|
}
|
|
655
|
-
<
|
|
652
|
+
<FieldCacheService
|
|
656
653
|
{...this.props}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
filters_postprocessor: (filters) => NSALayout_Field.postprocess(filters, this.state.ctf_rows),
|
|
674
|
-
}}
|
|
675
|
-
action={{
|
|
676
|
-
title: action_title,
|
|
677
|
-
description: action_description,
|
|
678
|
-
menus: action.menus,
|
|
679
|
-
children: this.props.action?.children
|
|
680
|
-
}}
|
|
681
|
-
isLoggedIn={this.props.account?.token_manager?.exists}
|
|
682
|
-
notifications={this.props.notifier.getNotifications()}
|
|
683
|
-
>
|
|
684
|
-
<Helmet>
|
|
685
|
-
<meta name="ns-account-user-id" content={user_id} />
|
|
686
|
-
<meta name="ns-account-user-first-name" content={user_first_name} />
|
|
687
|
-
<meta name="ns-account-user-last-name" content={user_last_name} />
|
|
688
|
-
<meta name="ns-account-user-email" content={user_email} />
|
|
689
|
-
<meta name="ns-account-user-phone" content={user_phone} />
|
|
690
|
-
</Helmet>
|
|
691
|
-
{
|
|
692
|
-
this.state.showDeleteDialog &&
|
|
693
|
-
<NSDialogDelete
|
|
694
|
-
title={"Delete Confirmation"}
|
|
695
|
-
description={
|
|
696
|
-
(getIDs && getIDs().length > 1)
|
|
697
|
-
? `Are you sure you want to delete ${getIDs().length} ${name}s?`
|
|
698
|
-
: `Are you sure you want to delete ${name}?`
|
|
699
|
-
}
|
|
700
|
-
onClose={hideDeleteDialog}
|
|
701
|
-
onNo={{ action: hideDeleteDialog, showLoading: false }}
|
|
702
|
-
show_as_code={false}
|
|
703
|
-
onYes={{
|
|
704
|
-
showLoading: false,
|
|
705
|
-
action: (onFinished) =>
|
|
654
|
+
render={(ctf_rows) => (
|
|
655
|
+
<NSLayout
|
|
656
|
+
{...this.props}
|
|
657
|
+
scope={scope}
|
|
658
|
+
logo={logo}
|
|
659
|
+
background={{ image: background, attachment: this.props.background?.attachment, size: this.props.background?.size }}
|
|
660
|
+
header={{
|
|
661
|
+
enabled: this.props.header?.enabled,
|
|
662
|
+
right: {
|
|
663
|
+
icons: [...icons, ...(this.props.header?.right?.icons ?? [])],
|
|
664
|
+
},
|
|
665
|
+
left: {
|
|
666
|
+
title: this.props.header?.left?.title
|
|
667
|
+
},
|
|
668
|
+
mega_menu: this.props.header?.mega_menu,
|
|
669
|
+
onCollapse: () =>
|
|
706
670
|
{
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
if (ids.length === 0)
|
|
711
|
-
throw new Error("Nothing was found to delete.");
|
|
712
|
-
this.runDelete(ids, name);
|
|
713
|
-
}
|
|
714
|
-
catch (error: any)
|
|
715
|
-
{
|
|
716
|
-
this.props.notifier.onError(error);
|
|
717
|
-
}
|
|
718
|
-
this.setState(prev => ({ ...prev, showDeleteDialog: false }));
|
|
719
|
-
onFinished();
|
|
720
|
-
}
|
|
671
|
+
this.setState((prev) => ({ showMasterMenu: !prev.showMasterMenu }))
|
|
672
|
+
},
|
|
673
|
+
filters_postprocessor: (filters) => NSALayout_Field.postprocess(filters, ctf_rows),
|
|
721
674
|
}}
|
|
675
|
+
action={{
|
|
676
|
+
title: action_title,
|
|
677
|
+
description: action_description,
|
|
678
|
+
menus: action.menus,
|
|
679
|
+
children: this.props.action?.children
|
|
680
|
+
}}
|
|
681
|
+
isLoggedIn={this.props.account?.token_manager?.exists}
|
|
682
|
+
notifications={this.props.notifier.getNotifications()}
|
|
722
683
|
>
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
684
|
+
<Helmet>
|
|
685
|
+
<meta name="ns-account-user-id" content={user_id} />
|
|
686
|
+
<meta name="ns-account-user-first-name" content={user_first_name} />
|
|
687
|
+
<meta name="ns-account-user-last-name" content={user_last_name} />
|
|
688
|
+
<meta name="ns-account-user-email" content={user_email} />
|
|
689
|
+
<meta name="ns-account-user-phone" content={user_phone} />
|
|
690
|
+
</Helmet>
|
|
691
|
+
{
|
|
692
|
+
this.state.showDeleteDialog &&
|
|
693
|
+
<NSDialogDelete
|
|
694
|
+
title={"Delete Confirmation"}
|
|
695
|
+
description={
|
|
696
|
+
(getIDs && getIDs().length > 1)
|
|
697
|
+
? `Are you sure you want to delete ${getIDs().length} ${name}s?`
|
|
698
|
+
: `Are you sure you want to delete ${name}?`
|
|
699
|
+
}
|
|
700
|
+
onClose={hideDeleteDialog}
|
|
701
|
+
onNo={{ action: hideDeleteDialog, showLoading: false }}
|
|
702
|
+
show_as_code={false}
|
|
703
|
+
onYes={{
|
|
704
|
+
showLoading: false,
|
|
705
|
+
action: (onFinished) =>
|
|
706
|
+
{
|
|
707
|
+
try
|
|
708
|
+
{
|
|
709
|
+
let ids = getIDs ? getIDs() : [];
|
|
710
|
+
if (ids.length === 0)
|
|
711
|
+
throw new Error("Nothing was found to delete.");
|
|
712
|
+
this.runDelete(ids, name);
|
|
713
|
+
}
|
|
714
|
+
catch (error: any)
|
|
715
|
+
{
|
|
716
|
+
this.props.notifier.onError(error);
|
|
717
|
+
}
|
|
718
|
+
this.setState(prev => ({ ...prev, showDeleteDialog: false }));
|
|
719
|
+
onFinished();
|
|
720
|
+
}
|
|
721
|
+
}}
|
|
722
|
+
>
|
|
723
|
+
<></>
|
|
724
|
+
</NSDialogDelete>}
|
|
725
|
+
{
|
|
726
|
+
content
|
|
727
|
+
}
|
|
728
|
+
</NSLayout>
|
|
729
|
+
)}
|
|
730
|
+
/>
|
|
733
731
|
<NSATaskBar<string>
|
|
734
732
|
ref={this.NSATaskBar_Ref}
|
|
735
733
|
title={this.state.delete_title}
|
|
@@ -4,11 +4,11 @@ import { IBaseComponentProps, NSButtonBlue, NSID, NSLine, NSLoading, NSPanel, NS
|
|
|
4
4
|
import { Component, createRef, FormHTMLAttributes, ReactNode } from "react";
|
|
5
5
|
import { NSANavigationGuard } from "../components/NSANavigationGuard";
|
|
6
6
|
import { IEntityInfo } from "../IEntityInfo";
|
|
7
|
-
import {
|
|
7
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
8
8
|
import { NSASectionEditTabPage, NSASectionEditTabPageEditorProps, NSASectionEditTabPageUIProps } from "./NSASectionEditTabPage";
|
|
9
9
|
import { NSASectionViewTabPage, NSASectionViewTabPageUIProps } from "./NSASectionViewTabPage";
|
|
10
10
|
|
|
11
|
-
export interface NSASectionEditCustomProps<RowType extends { id: string }, RowTypeInput = RowType> extends
|
|
11
|
+
export interface NSASectionEditCustomProps<RowType extends { id: string }, RowTypeInput = RowType> extends NSARouterMakerResult, IBaseComponentProps
|
|
12
12
|
{
|
|
13
13
|
isEdit: boolean;
|
|
14
14
|
ui: {
|
|
@@ -27,7 +27,7 @@ export interface NSASectionEditCustomProps<RowType extends { id: string }, RowTy
|
|
|
27
27
|
children?: React.ReactNode;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export interface NSASectionEditProps<RowType extends { id: string }, RowTypeInput = RowType> extends NSASectionEditCustomProps<RowType, RowTypeInput>,
|
|
30
|
+
export interface NSASectionEditProps<RowType extends { id: string }, RowTypeInput = RowType> extends NSASectionEditCustomProps<RowType, RowTypeInput>, NSARouterMakerResult
|
|
31
31
|
{
|
|
32
32
|
model: {
|
|
33
33
|
id: string | null;
|
|
@@ -38,7 +38,6 @@ export interface NSASectionEditProps<RowType extends { id: string }, RowTypeInpu
|
|
|
38
38
|
enabled: boolean;
|
|
39
39
|
rows: EntityResolveResponseRow | null;
|
|
40
40
|
};
|
|
41
|
-
deleteFieldCache: () => void;
|
|
42
41
|
children: ReactNode;
|
|
43
42
|
}
|
|
44
43
|
|
|
@@ -5,7 +5,7 @@ import { NSFBoxSlot } from "../components/NSFBoxSlot";
|
|
|
5
5
|
import { NSFBoxWrapper } from "../components/NSFBoxWrapper";
|
|
6
6
|
import { CTFRow } from "../CTFRow";
|
|
7
7
|
import { IEntityInfo } from "../IEntityInfo";
|
|
8
|
-
import {
|
|
8
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
9
9
|
import { CFTUtil } from "./CFTUtil";
|
|
10
10
|
import Styles from "./NSASectionEditTabPage.module.css";
|
|
11
11
|
import { NSASectionViewTabMore } from "./NSASectionViewTabMore";
|
|
@@ -29,7 +29,7 @@ export interface NSASectionEditTabPageCustomProps<RowType extends { id: string }
|
|
|
29
29
|
children: ReactNode;
|
|
30
30
|
}
|
|
31
31
|
export interface NSASectionEditTabPageProps<RowType extends { id: string }, RowTypeInput = RowType>
|
|
32
|
-
extends
|
|
32
|
+
extends NSARouterMakerResult, NSASectionEditTabPageCustomProps<RowType, RowTypeInput>
|
|
33
33
|
{
|
|
34
34
|
entity: IEntityInfo<RowType & { id: string }, RowTypeInput>;
|
|
35
35
|
ctf: {
|
|
@@ -40,7 +40,6 @@ export interface NSASectionEditTabPageProps<RowType extends { id: string }, RowT
|
|
|
40
40
|
id: string | null;
|
|
41
41
|
row: RowType | null;
|
|
42
42
|
};
|
|
43
|
-
deleteFieldCache: () => void;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
interface NSASectionEditTabPageState<RowType>
|
|
@@ -244,7 +243,7 @@ export class NSASectionEditTabPage<RowType extends { id: string }, RowTypeInput
|
|
|
244
243
|
title: "More",
|
|
245
244
|
clicked: true,
|
|
246
245
|
getContent: () => <NSASectionViewTabMore
|
|
247
|
-
|
|
246
|
+
{...this.props}
|
|
248
247
|
/>
|
|
249
248
|
});
|
|
250
249
|
}
|
|
@@ -2,7 +2,7 @@ import { EntityResolveResponseRow } from "namirasoft-field";
|
|
|
2
2
|
import { IBaseComponentProps, NSBoxCombo, NSRow, NSSpace, NSSpaceSizeType, NSSplitter } from "namirasoft-site-react";
|
|
3
3
|
import { Component, ReactNode, createRef } from "react";
|
|
4
4
|
import { IEntityInfo } from "../IEntityInfo";
|
|
5
|
-
import {
|
|
5
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
6
6
|
import { NSATable, NSATableUIProps } from "../components/NSATable";
|
|
7
7
|
import Styles from "./NSASectionList.module.css";
|
|
8
8
|
import { NSASectionViewTabPage, NSASectionViewTabPageUIProps } from "./NSASectionViewTabPage";
|
|
@@ -18,14 +18,13 @@ export interface NSASectionListCustomProps<RowType extends { id: string }, RowTy
|
|
|
18
18
|
children?: React.ReactNode;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export interface NSASectionListProps<RowType extends { id: string }, RowTypeInput = RowType> extends IBaseComponentProps,
|
|
21
|
+
export interface NSASectionListProps<RowType extends { id: string }, RowTypeInput = RowType> extends IBaseComponentProps, NSARouterMakerResult, NSASectionListCustomProps<RowType, RowTypeInput>
|
|
22
22
|
{
|
|
23
23
|
entity: IEntityInfo<RowType, RowTypeInput>;
|
|
24
24
|
ctf: {
|
|
25
25
|
enabled: boolean;
|
|
26
26
|
rows: EntityResolveResponseRow | null;
|
|
27
27
|
};
|
|
28
|
-
deleteFieldCache: () => void;
|
|
29
28
|
children?: ReactNode;
|
|
30
29
|
}
|
|
31
30
|
|
|
@@ -2,7 +2,7 @@ import { EntityResolveResponseRow } from "namirasoft-field";
|
|
|
2
2
|
import { IBaseComponentProps, NSLoading } from "namirasoft-site-react";
|
|
3
3
|
import { Component, createRef, ReactNode } from "react";
|
|
4
4
|
import { IEntityInfo } from "../IEntityInfo";
|
|
5
|
-
import {
|
|
5
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
6
6
|
import { NSASectionViewTabPage, NSASectionViewTabPageUIProps } from "./NSASectionViewTabPage";
|
|
7
7
|
|
|
8
8
|
export interface NSASectionViewCutomProps<RowType> extends IBaseComponentProps
|
|
@@ -16,7 +16,7 @@ export interface NSASectionViewCutomProps<RowType> extends IBaseComponentProps
|
|
|
16
16
|
children?: React.ReactNode;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export interface NSASectionViewProps<RowType extends { id: string }, RowTypeInput = RowType> extends
|
|
19
|
+
export interface NSASectionViewProps<RowType extends { id: string }, RowTypeInput = RowType> extends NSARouterMakerResult, NSASectionViewCutomProps<RowType>
|
|
20
20
|
{
|
|
21
21
|
entity: IEntityInfo<RowType, RowTypeInput>;
|
|
22
22
|
ctf: {
|
|
@@ -27,7 +27,6 @@ export interface NSASectionViewProps<RowType extends { id: string }, RowTypeInpu
|
|
|
27
27
|
id: string | null;
|
|
28
28
|
row: RowType | null;
|
|
29
29
|
};
|
|
30
|
-
deleteFieldCache: () => void;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
interface NSASectionViewState<RowType>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EnvService } from "namirasoft-core";
|
|
2
2
|
import { LinkOperation, NSButtonGreen, NSColumn, NSLabel, NSLine, NSRow } from "namirasoft-site-react";
|
|
3
3
|
import { Component } from "react";
|
|
4
|
+
import { FieldCacheService } from "../FieldCacheService";
|
|
5
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
4
6
|
|
|
5
|
-
export interface NSASectionViewTabMoreProps
|
|
6
|
-
{
|
|
7
|
-
deleteFieldCache: () => void;
|
|
8
|
-
}
|
|
7
|
+
export interface NSASectionViewTabMoreProps extends NSARouterMakerResult
|
|
8
|
+
{ }
|
|
9
9
|
|
|
10
10
|
export interface NSASectionViewTabMoreState
|
|
11
11
|
{ }
|
|
@@ -28,7 +28,7 @@ export class NSASectionViewTabMore extends Component<NSASectionViewTabMoreProps,
|
|
|
28
28
|
action: () =>
|
|
29
29
|
{
|
|
30
30
|
let REACT_APP_BASE_URL_FIELD_CONSOLE = new EnvService("REACT_APP_BASE_URL_FIELD_CONSOLE", true).getString();
|
|
31
|
-
|
|
31
|
+
LinkOperation.open(REACT_APP_BASE_URL_FIELD_CONSOLE + "/field/list");
|
|
32
32
|
},
|
|
33
33
|
showLoading: false
|
|
34
34
|
}}
|
|
@@ -47,7 +47,7 @@ export class NSASectionViewTabMore extends Component<NSASectionViewTabMoreProps,
|
|
|
47
47
|
action: () =>
|
|
48
48
|
{
|
|
49
49
|
let REACT_APP_BASE_URL_FIELD_CONSOLE = new EnvService("REACT_APP_BASE_URL_FIELD_CONSOLE", true).getString();
|
|
50
|
-
|
|
50
|
+
LinkOperation.open(REACT_APP_BASE_URL_FIELD_CONSOLE + "/category/list");
|
|
51
51
|
},
|
|
52
52
|
showLoading: false
|
|
53
53
|
}}
|
|
@@ -65,7 +65,8 @@ export class NSASectionViewTabMore extends Component<NSASectionViewTabMoreProps,
|
|
|
65
65
|
onClick={{
|
|
66
66
|
action: () =>
|
|
67
67
|
{
|
|
68
|
-
this.props.
|
|
68
|
+
let cache = FieldCacheService.get(this.props.account.token_manager, this.props.product_id, this.props.notifier.onError);
|
|
69
|
+
cache.del();
|
|
69
70
|
document.location.reload();
|
|
70
71
|
},
|
|
71
72
|
showLoading: false
|
|
@@ -6,7 +6,7 @@ import { BaseColumnFormatter, DateTimeFormatter, IBaseComponentProps, IDFormatte
|
|
|
6
6
|
import { Component, createRef, Fragment, ReactNode } from "react";
|
|
7
7
|
import { NSFBoxWrapper } from "../components/NSFBoxWrapper";
|
|
8
8
|
import { IEntityInfo } from "../IEntityInfo";
|
|
9
|
-
import {
|
|
9
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
10
10
|
import { CFTUtil } from "./CFTUtil";
|
|
11
11
|
import { NSASectionViewTabMore } from "./NSASectionViewTabMore";
|
|
12
12
|
import Styles from "./NSASectionViewTabPage.module.css";
|
|
@@ -64,7 +64,7 @@ export interface NSASectionViewTabPageCutomProps<RowType>
|
|
|
64
64
|
onRowLoaded?: (row: RowType) => void;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
export interface NSASectionViewTabPageProps<RowType extends { id: string }, RowTypeInput = RowType> extends
|
|
67
|
+
export interface NSASectionViewTabPageProps<RowType extends { id: string }, RowTypeInput = RowType> extends NSARouterMakerResult, NSASectionViewTabPageCutomProps<RowType>
|
|
68
68
|
{
|
|
69
69
|
entity: IEntityInfo<RowType, RowTypeInput>;
|
|
70
70
|
ctf: {
|
|
@@ -75,7 +75,6 @@ export interface NSASectionViewTabPageProps<RowType extends { id: string }, RowT
|
|
|
75
75
|
id: string | null;
|
|
76
76
|
row: RowType | null;
|
|
77
77
|
};
|
|
78
|
-
deleteFieldCache: () => void;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
interface NSASectionViewTabPageState<RowType>
|
|
@@ -374,7 +373,7 @@ export class NSASectionViewTabPage<RowType extends { id: string }, RowTypeInput
|
|
|
374
373
|
title: "More",
|
|
375
374
|
clicked: true,
|
|
376
375
|
getContent: () => <NSASectionViewTabMore
|
|
377
|
-
|
|
376
|
+
{...this.props}
|
|
378
377
|
/>
|
|
379
378
|
});
|
|
380
379
|
pushTabs(this.props.ui?.tabs?.extra?.after_more);
|
package/src/main.ts
CHANGED
|
@@ -4,8 +4,6 @@ export * from "./components/NSAMasterMenu";
|
|
|
4
4
|
export * from "./components/NSAMasterMenuItem";
|
|
5
5
|
export * from "./components/NSAMessageListDialog";
|
|
6
6
|
export * from "./components/NSAProductListDialog";
|
|
7
|
-
export * from "./components/NSAReorderDialog";
|
|
8
|
-
export * from "./components/NSASortDialog";
|
|
9
7
|
export * from "./components/NSATable";
|
|
10
8
|
export * from "./components/NSAUserDialog";
|
|
11
9
|
export * from "./components/NSAWorkspaceListDialog";
|
|
@@ -35,10 +33,10 @@ export * from "./layouts/NSASectionViewTabMore";
|
|
|
35
33
|
export * from "./layouts/NSASectionViewTabPage";
|
|
36
34
|
export * from "./NSACacheService";
|
|
37
35
|
export * from "./NSAFilterOperators";
|
|
38
|
-
export * from "./NSARouter";
|
|
39
36
|
export * from "./NSARouterMaker";
|
|
40
|
-
export * from "./NSARouterMakerConfig";
|
|
41
37
|
export * from "./NSARouterMakerProps";
|
|
38
|
+
export * from "./NSARouterMakerResult";
|
|
39
|
+
export * from "./NSFRouterMaker";
|
|
42
40
|
export * from "./NSFRoutes";
|
|
43
41
|
export * from "./pages/NSAConsentPage";
|
|
44
42
|
export * from "./pages/NSAEmailVerificationPage";
|
|
@@ -4,10 +4,10 @@ import { VersionOperation } from 'namirasoft-core';
|
|
|
4
4
|
import { IBackgroundProps, NSBox, NSBoxBoolean, NSButtonBlue, NSLoading, NSSpace, NSSpaceSizeType, ProductCacheService } from 'namirasoft-site-react';
|
|
5
5
|
import React, { useEffect, useRef, useState } from 'react';
|
|
6
6
|
import { NSACacheService } from '../NSACacheService';
|
|
7
|
-
import {
|
|
7
|
+
import { NSARouterMakerResult } from '../NSARouterMakerResult';
|
|
8
8
|
import Styles from './NSAConsentPage.module.css';
|
|
9
9
|
|
|
10
|
-
export interface NSAConsentPageProps extends
|
|
10
|
+
export interface NSAConsentPageProps extends NSARouterMakerResult
|
|
11
11
|
{
|
|
12
12
|
custom?: {
|
|
13
13
|
name?: string;
|