@awes-io/nuxt-admin 2.3.7 → 2.3.11

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/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.3.11](https://github.com/awes-io/client/compare/@awes-io/nuxt-admin@2.3.10...@awes-io/nuxt-admin@2.3.11) (2021-11-26)
7
+
8
+ **Note:** Version bump only for package @awes-io/nuxt-admin
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.3.10](https://github.com/awes-io/client/compare/@awes-io/nuxt-admin@2.3.9...@awes-io/nuxt-admin@2.3.10) (2021-11-25)
15
+
16
+ **Note:** Version bump only for package @awes-io/nuxt-admin
17
+
18
+
19
+
20
+
21
+
22
+ ## [2.3.9](https://github.com/awes-io/client/compare/@awes-io/nuxt-admin@2.3.8...@awes-io/nuxt-admin@2.3.9) (2021-11-25)
23
+
24
+ **Note:** Version bump only for package @awes-io/nuxt-admin
25
+
26
+
27
+
28
+
29
+
30
+ ## [2.3.8](https://github.com/awes-io/client/compare/@awes-io/nuxt-admin@2.3.7...@awes-io/nuxt-admin@2.3.8) (2021-11-17)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * admin module ([8dba202](https://github.com/awes-io/client/commit/8dba20237dcd710d22f29f3b8f5203fdd334b485))
36
+
37
+
38
+
39
+
40
+
6
41
  ## [2.3.7](https://github.com/awes-io/client/compare/@awes-io/nuxt-admin@2.3.6...@awes-io/nuxt-admin@2.3.7) (2021-11-15)
7
42
 
8
43
  **Note:** Version bump only for package @awes-io/nuxt-admin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/nuxt-admin",
3
- "version": "2.3.7",
3
+ "version": "2.3.11",
4
4
  "description": "Administration of roles and permissions for Awes.io v1",
5
5
  "homepage": "https://awes.io",
6
6
  "bugs": {
@@ -55,8 +55,8 @@
55
55
  ]
56
56
  },
57
57
  "dependencies": {
58
- "@awes-io/nuxt-auth": "^2.4.7",
59
- "@awes-io/ui": "^2.33.0",
58
+ "@awes-io/nuxt-auth": "^2.4.10",
59
+ "@awes-io/ui": "^2.34.2",
60
60
  "@awes-io/vue-mc": "^0.6.0",
61
61
  "rambdax": "^7.2.0"
62
62
  },
@@ -92,5 +92,5 @@
92
92
  "vue-jest": "^3.0.4",
93
93
  "vue-template-compiler": "^2.6.10"
94
94
  },
95
- "gitHead": "a606ff331a97cd5cff79579935f12bde2ec2eedb"
95
+ "gitHead": "00c9d7a17f45c384bc15d55e3c7a5d2025b54956"
96
96
  }
@@ -1,145 +1,155 @@
1
1
  <template>
2
2
  <AwPage :title="title" :breadcrumb="breadcrumb" container="small">
3
- <AwGrid>
4
- <AwIsland :title="$t('AwesIoNuxtAdmin.information')" expanded>
5
- <template v-if="!model.isNew()" #options>
6
- <AwSwitcher
7
- v-model="model.statusBoolean"
8
- v-tooltip="$t(`AwesIoNuxtAdmin.status_${model.status}`)"
9
- inactive-color="error"
10
- />
11
- </template>
12
-
13
- <AwGrid>
14
- <AwInfo :label="$t('AwesIoNuxtAdmin.gender')">
15
- <AwRadio
16
- class="inline-block"
17
- v-model="model.profile.sex"
18
- :label="$t('AwesIoNuxtAdmin.male')"
19
- value="male"
20
- :error="model.errors['profile.sex']"
3
+ <AwModelEdit :model="model">
4
+ <AwGrid>
5
+ <AwIsland :title="$t('AwesIoNuxtAdmin.information')" expanded>
6
+ <template v-if="!model.isNew() && isRolesEditable" #options>
7
+ <AwSwitcher
8
+ v-model="model.statusBoolean"
9
+ v-tooltip="
10
+ $t(`AwesIoNuxtAdmin.status_${model.status}`)
11
+ "
12
+ inactive-color="error"
21
13
  />
22
- <AwRadio
23
- class="inline-block ml-3"
24
- v-model="model.profile.sex"
25
- :label="$t('AwesIoNuxtAdmin.female')"
26
- value="female"
14
+ </template>
15
+
16
+ <AwGrid>
17
+ <AwInfo :label="$t('AwesIoNuxtAdmin.gender')">
18
+ <AwRadio
19
+ class="inline-block"
20
+ v-model="model.profile.sex"
21
+ :label="$t('AwesIoNuxtAdmin.male')"
22
+ value="male"
23
+ :error="model.errors['profile.sex']"
24
+ />
25
+ <AwRadio
26
+ class="inline-block ml-3"
27
+ v-model="model.profile.sex"
28
+ :label="$t('AwesIoNuxtAdmin.female')"
29
+ value="female"
30
+ />
31
+ <AwRadio
32
+ class="inline-block ml-3"
33
+ v-model="model.profile.sex"
34
+ :label="$t('AwesIoNuxtAdmin.divers')"
35
+ value="divers"
36
+ />
37
+ </AwInfo>
38
+
39
+ <AwInput
40
+ v-model="model.profile.first_name"
41
+ name="first_name"
42
+ :label="$t('AwesIoNuxtAdmin.first_name')"
43
+ :error="model.errors['profile.first_name']"
44
+ autocomplete="given-name"
27
45
  />
28
- <AwRadio
29
- class="inline-block ml-3"
30
- v-model="model.profile.sex"
31
- :label="$t('AwesIoNuxtAdmin.divers')"
32
- value="divers"
46
+ <AwInput
47
+ v-model="model.profile.last_name"
48
+ :label="$t('AwesIoNuxtAdmin.last_name')"
49
+ name="last_name"
50
+ :error="model.errors['profile.last_name']"
51
+ autocomplete="family-name"
33
52
  />
34
- </AwInfo>
35
-
36
- <AwInput
37
- v-model="model.profile.first_name"
38
- name="first_name"
39
- :label="$t('AwesIoNuxtAdmin.first_name')"
40
- :error="model.errors['profile.first_name']"
41
- autocomplete="given-name"
42
- />
43
- <AwInput
44
- v-model="model.profile.last_name"
45
- :label="$t('AwesIoNuxtAdmin.last_name')"
46
- name="last_name"
47
- :error="model.errors['profile.last_name']"
48
- autocomplete="family-name"
49
- />
50
53
 
51
- <AwInput
52
- :label="$t('AwesIoNuxtAdmin.email')"
53
- v-model="model.email"
54
- name="email"
55
- :error="model.errors.email"
56
- autocomplete="email"
57
- />
58
-
59
- <template v-if="model.isNew()">
60
- <AwPassword
61
- :label="$t('AwesIoNuxtAdmin.password')"
62
- v-model="model.password"
54
+ <AwInput
55
+ :label="$t('AwesIoNuxtAdmin.email')"
56
+ v-model="model.email"
63
57
  name="email"
64
- :error="model.errors.password"
65
- autocomplete="password"
58
+ :error="model.errors.email"
59
+ autocomplete="email"
66
60
  />
67
61
 
68
- <AwPassword
69
- v-if="model.isNew()"
70
- :label="$t('AwesIoNuxtAdmin.password_confirmation')"
71
- v-model="model.password_confirmation"
72
- name="email"
73
- :error="model.errors.password"
74
- autocomplete="password"
62
+ <template v-if="model.isNew()">
63
+ <AwPassword
64
+ :label="$t('AwesIoNuxtAdmin.password')"
65
+ v-model="model.password"
66
+ name="email"
67
+ :error="model.errors.password"
68
+ autocomplete="password"
69
+ />
70
+
71
+ <AwPassword
72
+ v-if="model.isNew()"
73
+ :label="
74
+ $t('AwesIoNuxtAdmin.password_confirmation')
75
+ "
76
+ v-model="model.password_confirmation"
77
+ name="email"
78
+ :error="model.errors.password"
79
+ autocomplete="password"
80
+ />
81
+ </template>
82
+
83
+ <AwTel
84
+ :label="$t('AwesIoNuxtAdmin.phone')"
85
+ v-model="model.profile.phone"
86
+ name="phone"
87
+ :error="model.errors['profile.phone']"
88
+ autocomplete="tel"
75
89
  />
76
- </template>
77
90
 
78
- <AwTel
79
- :label="$t('AwesIoNuxtAdmin.phone')"
80
- v-model="model.profile.phone"
81
- name="phone"
82
- :error="model.errors['profile.phone']"
83
- autocomplete="tel"
84
- />
91
+ <AwInput
92
+ :label="$t('AwesIoNuxtAdmin.position')"
93
+ v-model="model.profile.position"
94
+ name="position"
95
+ :error="model.errors['profile.position']"
96
+ />
97
+ </AwGrid>
98
+ </AwIsland>
85
99
 
86
- <AwInput
87
- :label="$t('AwesIoNuxtAdmin.position')"
88
- v-model="model.profile.position"
89
- name="position"
90
- :error="model.errors['profile.position']"
91
- />
92
- </AwGrid>
93
- </AwIsland>
94
-
95
- <AwIsland :title="$t('AwesIoNuxtAdmin.permissions_title')" expanded>
96
- <AwSelect
97
- v-model="model.role.id"
98
- :label="$t('AwesIoNuxtAdmin.role')"
99
- :options="
100
- (text) => `/api/admin/roles?name=${text}&limit=100`
101
- "
102
- option-label="name"
103
- track-by="id"
104
- :error="model.errors['role.id']"
105
- />
106
- </AwIsland>
107
-
108
- <AwIsland :title="$t('AwesIoNuxtAdmin.details_title')" expanded>
109
- <AwTextarea
110
- :label="$t('AwesIoNuxtAdmin.description')"
111
- v-model="model.profile.description"
112
- name="description"
113
- :error="model.errors['profile.description']"
114
- />
115
- </AwIsland>
116
-
117
- <div class="flex">
118
- <AwButton
119
- class="mt-5"
120
- @click="updateUser"
121
- :loading="model.saving"
122
- :disabled="!model.changed()"
123
- >
124
- {{
125
- model.isNew()
126
- ? $t('AwesIoNuxtAdmin.create')
127
- : $t('AwesIoNuxtAdmin.update')
128
- }}
129
- </AwButton>
130
-
131
- <AwButton
132
- v-if="!model.isNew()"
133
- class="mt-5 ml-3"
134
- theme="ghost"
135
- color="default"
136
- @click="model.reset()"
137
- :disabled="!model.changed()"
100
+ <AwIsland
101
+ v-if="isRolesEditable"
102
+ :title="$t('AwesIoNuxtAdmin.permissions_title')"
103
+ expanded
138
104
  >
139
- {{ $t('AwesIoNuxtAdmin.reset') }}
140
- </AwButton>
141
- </div>
142
- </AwGrid>
105
+ <AwSelect
106
+ v-model="model.role.id"
107
+ :label="$t('AwesIoNuxtAdmin.role')"
108
+ :options="
109
+ (text) => `/api/admin/roles?name=${text}&limit=100`
110
+ "
111
+ option-label="name"
112
+ track-by="id"
113
+ :error="model.errors['role.id']"
114
+ />
115
+ </AwIsland>
116
+
117
+ <AwIsland :title="$t('AwesIoNuxtAdmin.details_title')" expanded>
118
+ <AwTextarea
119
+ :label="$t('AwesIoNuxtAdmin.description')"
120
+ v-model="model.profile.description"
121
+ name="description"
122
+ :error="model.errors['profile.description']"
123
+ />
124
+ </AwIsland>
125
+
126
+ <!-- <div class="flex">
127
+ <AwButton
128
+ class="mt-5"
129
+ @click="updateUser"
130
+ :loading="model.saving"
131
+ :disabled="!model.changed()"
132
+ >
133
+ {{
134
+ model.isNew()
135
+ ? $t('AwesIoNuxtAdmin.create')
136
+ : $t('AwesIoNuxtAdmin.update')
137
+ }}
138
+ </AwButton>
139
+
140
+ <AwButton
141
+ v-if="!model.isNew()"
142
+ class="mt-5 ml-3"
143
+ theme="ghost"
144
+ color="default"
145
+ @click="model.reset()"
146
+ :disabled="!model.changed()"
147
+ >
148
+ {{ $t('AwesIoNuxtAdmin.reset') }}
149
+ </AwButton>
150
+ </div> -->
151
+ </AwGrid>
152
+ </AwModelEdit>
143
153
  </AwPage>
144
154
  </template>
145
155
 
@@ -169,6 +179,11 @@ export default {
169
179
 
170
180
  breadcrumb() {
171
181
  return { href: `/admin/users/${this.model.id || ''}` }
182
+ },
183
+
184
+ isRolesEditable() {
185
+ if (!this.$auth.user.is_super_admin) return false
186
+ return parseInt(this.$route.params.id) !== this.$auth.user.id
172
187
  }
173
188
  },
174
189
 
@@ -17,13 +17,17 @@
17
17
  />
18
18
  </template>
19
19
 
20
- <AwButtonNav :items="filters" />
20
+ <div class="flex items-center justify-between flex-wrap">
21
+ <AwButtonNav :items="filters" />
22
+
23
+ <!-- <AwSearch class="w-full md:w-auto ml-4" :exclude="['status']" /> -->
24
+ </div>
21
25
 
22
26
  <AwTableBuilder
23
27
  :collection="users"
24
28
  @click:row="showUser"
25
- :orderable="{ param: 'order' }"
26
- :watch-params="['status', 'search', 'order']"
29
+ :orderable="{ param: 'orderBy' }"
30
+ :watch-params="['status', 'search']"
27
31
  class="mt-8"
28
32
  >
29
33
  <AwTableCol :title="$t('AwesIoNuxtAdmin.employee')">
@@ -64,7 +68,7 @@
64
68
  <AwTableCol
65
69
  field="last_activity"
66
70
  :title="$t('AwesIoNuxtAdmin.last_activity')"
67
- orderable
71
+ :orderable="{ templateValue: 'last_login_at' }"
68
72
  >
69
73
  <template #default="{ cell }">
70
74
  {{ cell ? $dayjs().to(cell) : '—' }}