namirasoft-site-react 1.4.305 → 1.4.307

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.
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { IBaseComponentProps } from '../main';
2
3
  import { IStorage } from 'namirasoft-core';
3
4
  import { Globe } from 'namirasoft-site-map';
@@ -10,4 +11,13 @@ export interface NSIDState {
10
11
  tried: boolean;
11
12
  text?: string;
12
13
  }
13
- export declare function NSID(props: NSIDProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare class NSID extends React.Component<NSIDProps, NSIDState> {
15
+ private static mutex;
16
+ private static mutexes;
17
+ private globe;
18
+ private info;
19
+ constructor(props: NSIDProps);
20
+ componentDidMount(): void;
21
+ reload(): Promise<void>;
22
+ render(): import("react/jsx-runtime").JSX.Element;
23
+ }
@@ -8,51 +8,76 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
- import { useEffect, useState } from 'react';
11
+ import React from 'react';
12
12
  import { BaseURLImageFormatter, NSCopy } from '../main';
13
13
  import { BaseUUID, CacheService } from 'namirasoft-core';
14
14
  import { Globe } from 'namirasoft-site-map';
15
15
  import Styles from './NSID.module.css';
16
- export function NSID(props) {
17
- var _a;
18
- const [state, setState] = useState({
19
- tried: false,
20
- });
21
- let short = BaseUUID.getShort(props.id);
22
- let namirasoft = (_a = props.globe) !== null && _a !== void 0 ? _a : new Globe();
23
- let info = namirasoft.getByShortName(short);
24
- let cache = null;
25
- if (props.storage)
26
- cache = new CacheService(info.product.id + "-" + info.table.name, props.storage, 30, () => __awaiter(this, void 0, void 0, function* () { return "0.0.0"; }), () => __awaiter(this, void 0, void 0, function* () {
27
- var _a, _b;
28
- if (info.table.back_end.get) {
29
- try {
30
- let row = yield info.table.back_end.get(props.id);
31
- return (_b = (_a = row.name) !== null && _a !== void 0 ? _a : row.description) !== null && _b !== void 0 ? _b : "";
32
- }
33
- catch (error) {
34
- console.error(error);
35
- }
16
+ import { Mutex } from 'async-mutex';
17
+ export class NSID extends React.Component {
18
+ constructor(props) {
19
+ var _a;
20
+ super(props);
21
+ this.state = { tried: false };
22
+ let short = BaseUUID.getShort(this.props.id);
23
+ this.globe = (_a = this.props.globe) !== null && _a !== void 0 ? _a : new Globe();
24
+ this.info = this.globe.getByShortName(short);
25
+ }
26
+ componentDidMount() {
27
+ this.reload();
28
+ }
29
+ reload() {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ let cache = null;
32
+ if (this.props.storage) {
33
+ cache = new CacheService(this.info.product.id + ":" + this.info.table.name + ":" + this.props.id, this.props.storage, 30, () => __awaiter(this, void 0, void 0, function* () { return "0.0.0"; }), () => __awaiter(this, void 0, void 0, function* () {
34
+ var _a, _b;
35
+ if (this.info.table.back_end.get) {
36
+ try {
37
+ let columns = [];
38
+ this.info.table.forEachColumn(column => {
39
+ if (column.name.includes("name"))
40
+ columns.push(column.name);
41
+ });
42
+ let row = yield this.info.table.back_end.get(this.props.id);
43
+ let values = columns.map(column => row[column]).filter(x => x);
44
+ if (values.length > 0)
45
+ return values.join(" ");
46
+ return (_b = (_a = row.name) !== null && _a !== void 0 ? _a : row.description) !== null && _b !== void 0 ? _b : "";
47
+ }
48
+ catch (error) {
49
+ console.error(error);
50
+ }
51
+ }
52
+ return "";
53
+ }));
54
+ cache.runGetOn = yield NSID.mutex.runExclusive(() => __awaiter(this, void 0, void 0, function* () {
55
+ if (!NSID.mutexes[this.info.product.id])
56
+ NSID.mutexes[this.info.product.id] = new Mutex();
57
+ return NSID.mutexes[this.info.product.id];
58
+ }));
36
59
  }
37
- return "";
38
- }));
39
- useEffect(() => {
40
- if (cache)
41
- cache.get().then(text => {
42
- setState({ tried: true, text });
43
- });
44
- else
45
- setState({ tried: true });
46
- }, [props.id]);
47
- let text = state.text;
48
- if (!text)
49
- text = props.id;
50
- let formatter = new BaseURLImageFormatter();
51
- return (_jsxs(NSCopy, { value: props.id, children: [!state.tried &&
52
- _jsx("div", { className: Styles.ns_loader }), formatter.format({
53
- text,
54
- href: info.table.front_end.getViewLink(props.id + ""),
55
- image: { url: info.product.logo, alt: info.product.logo }
56
- })] }));
60
+ if (cache)
61
+ cache.get().then(text => {
62
+ this.setState({ tried: true, text });
63
+ });
64
+ else
65
+ this.setState({ tried: true });
66
+ });
67
+ }
68
+ render() {
69
+ let text = this.state.text;
70
+ if (!text)
71
+ text = this.props.id;
72
+ let formatter = new BaseURLImageFormatter();
73
+ return (_jsxs(NSCopy, { value: this.props.id, children: [!this.state.tried &&
74
+ _jsx("div", { className: Styles.ns_loader }), formatter.format({
75
+ text,
76
+ href: this.info.table.front_end.getViewLink(this.props.id + ""),
77
+ image: { url: this.info.product.logo, alt: this.info.product.logo }
78
+ })] }));
79
+ }
57
80
  }
81
+ NSID.mutex = new Mutex();
82
+ NSID.mutexes = {};
58
83
  //# sourceMappingURL=NSID.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NSID.js","sourceRoot":"","sources":["../../src/components/NSID.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAuB,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAY,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAevC,MAAM,UAAU,IAAI,CAAC,KAAgB;;IAEpC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAY;QAC7C,KAAK,EAAE,KAAK;KACZ,CAAC,CAAC;IAEH,IAAI,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACxC,IAAI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AAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAC3B,IAAI,CAAC,IAAI;YACR,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAEtB,IAAI,SAAS,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAC5C,OAAO,CACN,MAAC,MAAM,IACN,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,aAGnB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK;oBACjB,cAAK,SAAS,EAAE,MAAM,CAAC,SAAS,GAC1B,EAGN,SAAS,CAAC,MAAM,CAAC;oBAChB,IAAI;oBACJ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;oBAC/D,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;iBACnE,CAAC,IAEK,CACT,CAAC;IACH,CAAC;;AAhGc,UAAK,GAAU,IAAI,KAAK,EAAE,CAAC;AAC3B,YAAO,GAAoC,EAAE,CAAC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.305",
11
+ "version": "1.4.307",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/main.js",
@@ -28,13 +28,14 @@
28
28
  "@types/react-bootstrap": "^0.32.37",
29
29
  "@types/react-dom": "^18.3.1",
30
30
  "antd": "^5.24.3",
31
+ "async-mutex": "^0.5.0",
31
32
  "bootstrap": "^5.3.3",
32
33
  "chart.js": "^4.4.8",
33
34
  "copyfiles": "^2.4.1",
34
35
  "link-react": "^3.0.0",
35
36
  "namirasoft-api-link": "^1.4.13",
36
37
  "namirasoft-api-product": "^1.4.19",
37
- "namirasoft-core": "^1.4.53",
38
+ "namirasoft-core": "^1.4.54",
38
39
  "namirasoft-schema": "^1.4.25",
39
40
  "namirasoft-site": "^1.4.24",
40
41
  "namirasoft-site-map": "^1.4.15",
@@ -1,8 +1,10 @@
1
- import { useEffect, useState } from 'react';
1
+ import React from 'react';
2
2
  import { BaseURLImageFormatter, IBaseComponentProps, NSCopy } from '../main';
3
3
  import { BaseUUID, CacheService, IStorage } from 'namirasoft-core';
4
4
  import { Globe } from 'namirasoft-site-map';
5
5
  import Styles from './NSID.module.css';
6
+ import { NSBaseMetaTable, NSBaseServer } from 'namirasoft-site';
7
+ import { Mutex } from 'async-mutex';
6
8
 
7
9
  export interface NSIDProps extends IBaseComponentProps
8
10
  {
@@ -17,65 +19,103 @@ export interface NSIDState
17
19
  text?: string;
18
20
  }
19
21
 
20
- export function NSID(props: NSIDProps)
22
+ export class NSID extends React.Component<NSIDProps, NSIDState>
21
23
  {
22
- const [state, setState] = useState<NSIDState>({
23
- tried: false,
24
- });
25
-
26
- let short = BaseUUID.getShort(props.id);
27
- let namirasoft = props.globe ?? new Globe();
28
- let info = namirasoft.getByShortName(short);
29
- let cache = null;
30
- if (props.storage)
31
- cache = new CacheService<string>(info.product.id + "-" + info.table.name, props.storage, 30, async () => "0.0.0", async () =>
24
+ private static mutex: Mutex = new Mutex();
25
+ private static mutexes: { [product_id: string]: Mutex } = {};
26
+ private globe: Globe;
27
+ private info: {
28
+ product: {
29
+ id: string;
30
+ name: string;
31
+ headline: string;
32
+ description: string;
33
+ logo: string;
34
+ link: string;
35
+ };
36
+ table: NSBaseMetaTable<NSBaseServer, any>;
37
+ };
38
+ constructor(props: NSIDProps)
39
+ {
40
+ super(props);
41
+ this.state = { tried: false };
42
+ let short = BaseUUID.getShort(this.props.id);
43
+ this.globe = this.props.globe ?? new Globe();
44
+ this.info = this.globe.getByShortName(short);
45
+ }
46
+ override componentDidMount(): void
47
+ {
48
+ this.reload();
49
+ }
50
+ async reload()
51
+ {
52
+ let cache = null;
53
+ if (this.props.storage)
32
54
  {
33
- if (info.table.back_end.get)
55
+ cache = new CacheService<string>(this.info.product.id + ":" + this.info.table.name + ":" + this.props.id, this.props.storage, 30, async () => "0.0.0", async () =>
34
56
  {
35
- try
36
- {
37
- let row = await info.table.back_end.get(props.id);
38
- return row.name ?? row.description ?? "";
39
- } catch (error)
57
+ if (this.info.table.back_end.get)
40
58
  {
41
- console.error(error);
59
+ try
60
+ {
61
+ let columns: string[] = [];
62
+ this.info.table.forEachColumn(column =>
63
+ {
64
+ if (column.name.includes("name"))
65
+ columns.push(column.name);
66
+ });
67
+ let row = await this.info.table.back_end.get(this.props.id);
68
+ let values = columns.map(column => row[column]).filter(x => x);
69
+ if (values.length > 0)
70
+ return values.join(" ");
71
+ return row.name ?? row.description ?? "";
72
+ } catch (error)
73
+ {
74
+ console.error(error);
75
+ }
42
76
  }
43
- }
44
- return "";
45
- });
46
-
47
- useEffect(() =>
48
- {
77
+ return "";
78
+ });
79
+ cache.runGetOn = await NSID.mutex.runExclusive(async () =>
80
+ {
81
+ if (!NSID.mutexes[this.info.product.id])
82
+ NSID.mutexes[this.info.product.id] = new Mutex();
83
+ return NSID.mutexes[this.info.product.id];
84
+ });
85
+ }
49
86
  if (cache)
50
87
  cache.get().then(text =>
51
88
  {
52
- setState({ tried: true, text });
89
+ this.setState({ tried: true, text });
53
90
  });
54
91
  else
55
- setState({ tried: true });
56
- }, [props.id]);
92
+ this.setState({ tried: true });
93
+ }
57
94
 
58
- let text = state.text;
59
- if (!text)
60
- text = props.id;
95
+ override render()
96
+ {
97
+ let text = this.state.text;
98
+ if (!text)
99
+ text = this.props.id;
61
100
 
62
- let formatter = new BaseURLImageFormatter();
63
- return (
64
- <NSCopy
65
- value={props.id}
66
- >
67
- {
68
- !state.tried &&
69
- <div className={Styles.ns_loader}>
70
- </div>
71
- }
72
- {
73
- formatter.format({
74
- text,
75
- href: info.table.front_end.getViewLink(props.id + ""),
76
- image: { url: info.product.logo, alt: info.product.logo }
77
- })
78
- }
79
- </NSCopy>
80
- );
81
- }
101
+ let formatter = new BaseURLImageFormatter();
102
+ return (
103
+ <NSCopy
104
+ value={this.props.id}
105
+ >
106
+ {
107
+ !this.state.tried &&
108
+ <div className={Styles.ns_loader}>
109
+ </div>
110
+ }
111
+ {
112
+ formatter.format({
113
+ text,
114
+ href: this.info.table.front_end.getViewLink(this.props.id + ""),
115
+ image: { url: this.info.product.logo, alt: this.info.product.logo }
116
+ })
117
+ }
118
+ </NSCopy>
119
+ );
120
+ }
121
+ }