@enso-ui/roles 4.0.6 → 4.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enso-ui/roles",
3
- "version": "4.0.6",
3
+ "version": "4.0.10",
4
4
  "description": "Basic roles package",
5
5
  "main": "src/bulma/pages/roles/Index.vue",
6
6
  "scripts": {
@@ -25,9 +25,10 @@
25
25
  "@enso-ui/forms": "^3.0",
26
26
  "@enso-ui/permissions": "^4.0",
27
27
  "@enso-ui/tables": "^3.0",
28
+ "@enso-ui/transitions": "^2.0",
28
29
  "@enso-ui/ui": "^5.0",
29
30
  "@fortawesome/fontawesome-svg-core": "^1.2.2",
30
- "@fortawesome/free-solid-svg-icons": "^5.2.0",
31
+ "@fortawesome/free-solid-svg-icons": "^5.11.2",
31
32
  "@fortawesome/vue-fontawesome": "3.0.0-5",
32
33
  "vue": "^3.0",
33
34
  "vuex": "^4.0.0"
@@ -1,53 +1,56 @@
1
1
  <template>
2
2
  <div class="columns is-centered">
3
3
  <div class="column is-half is-three-fifths-desktop is-full-touch">
4
- <div class="animate__animated animate__fadeIn"
5
- v-if="data">
6
- <checkbox-manager class="is-rounded mt-3"
7
- :title="`${i18n('Permissions')}: ${data.role.display_name}`"
8
- v-model="data.rolePermissions"
9
- :items="data.permissions">
10
- <template #item="{ item }">
11
- <div class="level permission is-hoverable p-2 is-mobile">
12
- <div class="level-left">
13
- <div class="level-item">
14
- <label class="checkbox">
15
- <input type="checkbox"
16
- :id="item.id"
17
- :value="item.id"
18
- v-model="data.rolePermissions">
19
- {{ item.description }}
20
- </label>
4
+ <fade>
5
+ <div v-if="data">
6
+ <checkbox-manager class="is-rounded mt-3"
7
+ :title="`${i18n('Permissions')}: ${data.role.display_name}`"
8
+ v-model="data.rolePermissions"
9
+ :items="data.permissions">
10
+ <template #item="{ item }">
11
+ <div class="level permission is-hoverable p-2 is-mobile">
12
+ <div class="level-left">
13
+ <div class="level-item">
14
+ <label class="checkbox">
15
+ <input type="checkbox"
16
+ :id="item.id"
17
+ :value="item.id"
18
+ v-model="data.rolePermissions">
19
+ <span class="has-text-weight-bold ml-1">
20
+ {{ item.shortName }}
21
+ </span>: {{ item.description }}
22
+ </label>
23
+ </div>
21
24
  </div>
22
- </div>
23
- <div class="level-right">
24
- <div class="level-item">
25
- <span class="tag is-small is-info is-bold mr-2"
26
- v-if="item.isDefault">
27
- {{ i18n('Default') }}
28
- </span>
29
- <span class="tag is-small is-bold"
30
- :class="cssClass(item)">
31
- {{ item.type }}
32
- </span>
25
+ <div class="level-right">
26
+ <div class="level-item">
27
+ <span class="tag is-small is-info is-bold mr-2"
28
+ v-if="item.isDefault">
29
+ {{ i18n('Default') }}
30
+ </span>
31
+ <span class="tag is-small is-bold"
32
+ :class="cssClass(item)">
33
+ {{ item.type }}
34
+ </span>
35
+ </div>
33
36
  </div>
34
37
  </div>
35
- </div>
36
- </template>
37
- </checkbox-manager>
38
- <button class="button is-success mt-3 is-pulled-right"
39
- @click="update"
40
- :disabled="!canAccess('system.roles.permissions.set')">
41
- {{ i18n("Update") }}
42
- </button>
43
- <div class="is-clearfix"/>
44
- </div>
38
+ </template>
39
+ </checkbox-manager>
40
+ <button class="button is-success mt-3 is-pulled-right"
41
+ @click="update"
42
+ :disabled="!canAccess('system.roles.permissions.set')">
43
+ {{ i18n("Update") }}
44
+ </button>
45
+ <div class="is-clearfix"/>
46
+ </div>
47
+ </fade>
45
48
  </div>
46
49
  </div>
47
50
  </template>
48
51
 
49
52
  <script>
50
- import 'animate.css';
53
+ import { Fade } from '@enso-ui/transitions';
51
54
  import { mapState } from 'vuex';
52
55
  import cssClass from '@enso-ui/permissions/src/bulma/modules/permission';
53
56
  import { CheckboxManager } from '@enso-ui/checkbox/bulma';
@@ -55,9 +58,11 @@ import { CheckboxManager } from '@enso-ui/checkbox/bulma';
55
58
  export default {
56
59
  name: 'Configure',
57
60
 
58
- components: { CheckboxManager },
61
+ components: { CheckboxManager, Fade },
59
62
 
60
- inject: ['canAccess', 'errorHandler', 'i18n', 'route', 'toastr'],
63
+ inject: [
64
+ 'canAccess', 'errorHandler', 'http', 'i18n', 'route', 'toastr',
65
+ ],
61
66
 
62
67
  data: () => ({
63
68
  data: null,
@@ -76,12 +81,12 @@ export default {
76
81
  return cssClass(this.enums.permissionTypes, item);
77
82
  },
78
83
  fetch() {
79
- axios.get(this.route('system.roles.permissions.get', this.$route.params.role))
84
+ this.http.get(this.route('system.roles.permissions.get', this.$route.params.role))
80
85
  .then(({ data }) => (this.data = data))
81
86
  .catch(this.errorHandler);
82
87
  },
83
88
  update() {
84
- axios.post(
89
+ this.http.post(
85
90
  this.route('system.roles.permissions.set', this.$route.params.role),
86
91
  { rolePermissions: this.data.rolePermissions },
87
92
  ).then(({ data }) => this.toastr.success(data.message))
@@ -52,7 +52,9 @@ export default {
52
52
 
53
53
  components: { EnsoForm, Fa },
54
54
 
55
- inject: ['errorHandler', 'i18n', 'route', 'routerErrorHandler', 'toastr'],
55
+ inject: [
56
+ 'errorHandler', 'http', 'i18n', 'route', 'routerErrorHandler', 'toastr',
57
+ ],
56
58
 
57
59
  data: () => ({
58
60
  ready: false,
@@ -60,7 +62,7 @@ export default {
60
62
 
61
63
  methods: {
62
64
  writeConfig() {
63
- axios.post(this.route(
65
+ this.http.post(this.route(
64
66
  'system.roles.permissions.write',
65
67
  this.$refs.form.routeParam('role'),
66
68
  )).then(({ data }) => this.toastr.success(data.message))