@qlibs/utils 1.13.0 → 1.14.1

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.
@@ -32,6 +32,12 @@ function handleAfterSave(navigateFunction) {
32
32
  else if (window.location.pathname.includes('/add')) {
33
33
  goBack(navigateFunction);
34
34
  }
35
+ else if (window.location.pathname.endsWith('/edit')) {
36
+ goBack(navigateFunction);
37
+ }
38
+ else if (window.location.pathname.includes('/edit')) {
39
+ goBack(navigateFunction);
40
+ }
35
41
  else {
36
42
  window.location.reload();
37
43
  }
@@ -1,4 +1,4 @@
1
- export declare function generateArchivePermissions(feature: string): {
1
+ export declare function generateArchivePermissions(feature: string | string[]): {
2
2
  key: string;
3
3
  checked: boolean;
4
4
  permissions: string[];
@@ -2,21 +2,25 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateArchivePermissions = generateArchivePermissions;
4
4
  function generateArchivePermissions(feature) {
5
+ const features = Array.isArray(feature) ? feature : [feature];
5
6
  return [
6
7
  {
7
8
  key: 'ARCHIVE',
8
9
  checked: true,
9
- permissions: [feature + '.ARCHIVE'],
10
+ permissions: features.map((feature) => feature + '.ARCHIVE'),
10
11
  },
11
12
  {
12
13
  key: 'RESTORE',
13
14
  checked: true,
14
- permissions: [feature + '.RESTORE'],
15
+ permissions: features.map((feature) => feature + '.RESTORE'),
15
16
  },
16
17
  {
17
18
  key: 'FORCE_DELETE',
18
19
  checked: true,
19
- permissions: [feature + '.DELETE', feature + '.FORCE_DELETE'],
20
+ permissions: [
21
+ ...features.map((feature) => feature + '.DELETE'),
22
+ ...features.map((feature) => feature + '.FORCE_DELETE'),
23
+ ],
20
24
  },
21
25
  ];
22
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qlibs/utils",
3
- "version": "1.13.0",
3
+ "version": "1.14.1",
4
4
  "description": "",
5
5
  "author": "QBIT Developer",
6
6
  "license": "MIT",