Quellcode durchsuchen

upgrade vuew-orm-next draft 8

Vincent GUFFON vor 4 Jahren
Ursprung
Commit
a9297afafe
3 geänderte Dateien mit 30 neuen und 40 gelöschten Zeilen
  1. 1 1
      package.json
  2. 25 21
      test/services/rights/roleUtils.spec.js
  3. 4 18
      yarn.lock

+ 1 - 1
package.json

@@ -20,7 +20,7 @@
     "@nuxtjs/composition-api": "^0.17.0",
     "@syncfusion/ej2-vue-grids": "^18.4.30",
     "@types/lodash": "^4.14.168",
-    "@vuex-orm/core": "1.0.0-draft.7",
+    "@vuex-orm/core": "1.0.0-draft.8",
     "cookieparser": "^0.1.0",
     "core-js": "^3.6.5",
     "js-yaml": "^4.0.0",

+ 25 - 21
test/services/rights/roleUtils.spec.js

@@ -1,21 +1,25 @@
 import {$roleUtils} from "~/services/rights/roleUtils";
 
-const roles = [
-  'ROLE_BOOK_CONFIG_VIEW',
-  'ROLE_ROOM_CONFIG',
-  'ROLE_USER',
-  'ROLE_ADMIN',
-  'ROLE_ADMIN_CORE',
-  'ROLE_PLACE_VIEW',
-  'ROLE_ADMINISTRATIF_MANAGER_CORE',
-];
-
-const final_role = [
-  'ROLE_GENERAL-CONFIG_VIEW',
-  'ROLE_TAGG-ADVANCED',
-  'ROLE_ROOM',
-  'ROLE_USER_EDIT'
-];
+let roles, final_role
+
+beforeEach(() => {
+  roles = [
+    'ROLE_BOOK_CONFIG_VIEW',
+    'ROLE_ROOM_CONFIG',
+    'ROLE_USER',
+    'ROLE_ADMIN',
+    'ROLE_ADMIN_CORE',
+    'ROLE_PLACE_VIEW',
+    'ROLE_ADMINISTRATIF_MANAGER_CORE',
+  ];
+
+  final_role = [
+    'ROLE_GENERAL-CONFIG_VIEW',
+    'ROLE_TAGG-ADVANCED',
+    'ROLE_ROOM',
+    'ROLE_USER_VIEW'
+  ];
+});
 
 test('test isA', () => {
   expect($roleUtils.isA('ADMINISTRATIF_MANAGER', roles)).toBeTruthy();
@@ -38,7 +42,7 @@ test('test transformUnderscoreToHyphenBeforeCompleteMigration', () => {
     'ROLE_GENERAL_CONFIG_VIEW',
     'ROLE_TAGG_ADVANCED',
     'ROLE_ROOM',
-    'ROLE_USER_EDIT'
+    'ROLE_USER_VIEW'
   ];
 
   expect($roleUtils.transformUnderscoreToHyphenBeforeCompleteMigration(roles_to_array)).toStrictEqual(final_role);
@@ -46,10 +50,10 @@ test('test transformUnderscoreToHyphenBeforeCompleteMigration', () => {
 
 test('test transformRoleToAbilities', () => {
   let abilities_to_have = [
-    {action: 'read', subject: 'book-config'},
-    {action: 'read', subject: 'place'},
-    {action: 'manage', subject: 'room-config'},
-    {action: 'manage', subject: 'user'}
+    {action: 'read', subject: 'general-config'},
+    {action: 'manage', subject: 'tagg-advanced'},
+    {action: 'manage', subject: 'room'},
+    {action: 'read', subject: 'user'}
   ]
 
   expect($roleUtils.transformRoleToAbilities(final_role)).toStrictEqual(abilities_to_have);

+ 4 - 18
yarn.lock

@@ -2463,10 +2463,10 @@
     lodash "^4.17.15"
     pretty "^2.0.0"
 
-"@vuex-orm/core@1.0.0-draft.7":
-  version "1.0.0-draft.7"
-  resolved "https://registry.yarnpkg.com/@vuex-orm/core/-/core-1.0.0-draft.7.tgz#959aa88bfd785d73e017d73955081c9a808642d1"
-  integrity sha512-XmmUjqXPEjgXR6GQbW0RinwW0TraGm3epJxdb8jyAMN43DEH37Yb56KycJb13yQPoz/MYSzs7Gqp0GvXkOZqvQ==
+"@vuex-orm/core@1.0.0-draft.8":
+  version "1.0.0-draft.8"
+  resolved "https://registry.yarnpkg.com/@vuex-orm/core/-/core-1.0.0-draft.8.tgz#3122ca7aff6f651a26e29de850f76404ad2686a6"
+  integrity sha512-pGfuHK+53Qh5S5Y5Pko5NhQPYJapO1V87KIeHQAX8twbcxPJUgZw6HTRVLUogrJ7WHtKcv6XbpPQgvE29UOE2Q==
   dependencies:
     "@types/uuid" "^8.0.0"
     normalizr "^3.6.1"
@@ -7787,13 +7787,6 @@ markdown-it@^10.0.0:
     mdurl "^1.0.1"
     uc.micro "^1.0.5"
 
-markdown@^0.5.0:
-  version "0.5.0"
-  resolved "https://registry.yarnpkg.com/markdown/-/markdown-0.5.0.tgz#28205b565a8ae7592de207463d6637dc182722b2"
-  integrity sha1-KCBbVlqK51kt4gdGPWY33BgnIrI=
-  dependencies:
-    nopt "~2.1.1"
-
 marked@^0.8.2:
   version "0.8.2"
   resolved "https://registry.yarnpkg.com/marked/-/marked-0.8.2.tgz#4faad28d26ede351a7a1aaa5fec67915c869e355"
@@ -8271,13 +8264,6 @@ nopt@^5.0.0:
   dependencies:
     abbrev "1"
 
-nopt@~2.1.1:
-  version "2.1.2"
-  resolved "https://registry.yarnpkg.com/nopt/-/nopt-2.1.2.tgz#6cccd977b80132a07731d6e8ce58c2c8303cf9af"
-  integrity sha1-bMzZd7gBMqB3MdbozljCyDA8+a8=
-  dependencies:
-    abbrev "1"
-
 normalize-package-data@^2.3.2, normalize-package-data@^2.5.0:
   version "2.5.0"
   resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"