@enso-ui/teams 4.0.8 → 4.0.12
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/teams",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.12",
|
|
4
4
|
"description": "Basic teams package",
|
|
5
5
|
"main": "src/bulma/pages/teams/Index.vue",
|
|
6
6
|
"scripts": {
|
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
"@enso-ui/select": "^3.0",
|
|
26
26
|
"@enso-ui/transitions": "^2.0",
|
|
27
27
|
"@enso-ui/ui": "^5.0",
|
|
28
|
+
"@enso-ui/users": "^2.0",
|
|
28
29
|
"@fortawesome/fontawesome-svg-core": "^1.2.2",
|
|
29
|
-
"@fortawesome/free-solid-svg-icons": "^5.2
|
|
30
|
+
"@fortawesome/free-solid-svg-icons": "^5.11.2",
|
|
30
31
|
"@fortawesome/vue-fontawesome": "3.0.0-5",
|
|
31
32
|
"vue": "^3.0"
|
|
32
33
|
},
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
@create="teams.unshift($event); team = null"/>
|
|
45
45
|
</div>
|
|
46
46
|
<div class="column is-one-third-widescreen is-half-tablet"
|
|
47
|
-
v-for="(
|
|
47
|
+
v-for="(filteredTeam, index) in filteredTeams"
|
|
48
48
|
:key="index">
|
|
49
|
-
<team :team="
|
|
49
|
+
<team :team="filteredTeam"
|
|
50
50
|
@destroy="teams.splice(index, 1)"/>
|
|
51
51
|
</div>
|
|
52
52
|
<div class="column"
|
|
@@ -70,10 +70,10 @@ library.add(faPlus, faSearch, faSpinner);
|
|
|
70
70
|
export default {
|
|
71
71
|
name: 'Index',
|
|
72
72
|
|
|
73
|
-
inject: ['errorHandler', 'i18n', 'route'],
|
|
74
|
-
|
|
75
73
|
components: { Fa, Team },
|
|
76
74
|
|
|
75
|
+
inject: ['errorHandler', 'http', 'i18n', 'route'],
|
|
76
|
+
|
|
77
77
|
data: () => ({
|
|
78
78
|
loading: false,
|
|
79
79
|
ready: false,
|
|
@@ -99,7 +99,7 @@ export default {
|
|
|
99
99
|
fetch() {
|
|
100
100
|
this.loading = true;
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
this.http.get(this.route('administration.teams.index'))
|
|
103
103
|
.then(({ data }) => {
|
|
104
104
|
this.teams = data;
|
|
105
105
|
this.loading = false;
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
</span>
|
|
41
41
|
</a>
|
|
42
42
|
<a class="button is-naked is-success is-outlined"
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
@click="store();"
|
|
44
|
+
v-if="team.name">
|
|
45
45
|
<span class="icon">
|
|
46
46
|
<fa icon="check"
|
|
47
47
|
size="sm"/>
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
</a>
|
|
50
50
|
<a class="button is-naked is-danger is-outlined"
|
|
51
51
|
@click="destroy"
|
|
52
|
-
v-if="team.id !== null">
|
|
52
|
+
v-if="team.id !== null && team.users.length === 0">
|
|
53
53
|
<span class="icon">
|
|
54
54
|
<fa icon="trash"/>
|
|
55
55
|
</span>
|
|
@@ -98,11 +98,13 @@ library.add([faBan, faPencilAlt, faTrash, faCheck]);
|
|
|
98
98
|
export default {
|
|
99
99
|
name: 'Team',
|
|
100
100
|
|
|
101
|
-
inject: ['errorHandler', 'i18n', 'route', 'toastr'],
|
|
102
|
-
|
|
103
101
|
directives: { focus },
|
|
104
102
|
|
|
105
|
-
components: {
|
|
103
|
+
components: {
|
|
104
|
+
AvatarList, EnsoSelect, Fa, Fade,
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
inject: ['errorHandler', 'http', 'i18n', 'route', 'toastr'],
|
|
106
108
|
|
|
107
109
|
props: {
|
|
108
110
|
team: {
|
|
@@ -111,6 +113,8 @@ export default {
|
|
|
111
113
|
},
|
|
112
114
|
},
|
|
113
115
|
|
|
116
|
+
emits: ['cancel', 'create', 'destroy'],
|
|
117
|
+
|
|
114
118
|
data: () => ({
|
|
115
119
|
loading: false,
|
|
116
120
|
}),
|
|
@@ -119,7 +123,7 @@ export default {
|
|
|
119
123
|
store() {
|
|
120
124
|
this.loading = true;
|
|
121
125
|
|
|
122
|
-
|
|
126
|
+
this.http.post(this.route('administration.teams.store'), this.team)
|
|
123
127
|
.then(({ data }) => {
|
|
124
128
|
this.loading = false;
|
|
125
129
|
this.toastr.success(data.message);
|
|
@@ -127,7 +131,7 @@ export default {
|
|
|
127
131
|
this.team.id = data.team.id;
|
|
128
132
|
this.team.edit = false;
|
|
129
133
|
this.$emit('create', this.team);
|
|
130
|
-
}).catch(
|
|
134
|
+
}).catch(error => {
|
|
131
135
|
if (error.response.status === 422) {
|
|
132
136
|
this.toastr.warning(this.i18n('Choose another name'));
|
|
133
137
|
return;
|
|
@@ -138,7 +142,7 @@ export default {
|
|
|
138
142
|
destroy() {
|
|
139
143
|
this.loading = true;
|
|
140
144
|
|
|
141
|
-
|
|
145
|
+
this.http.delete(this.route('administration.teams.destroy', this.team.id))
|
|
142
146
|
.then(({ data }) => {
|
|
143
147
|
this.loading = false;
|
|
144
148
|
this.toastr.success(data.message);
|