Skip to content

Commit c2ced94

Browse files
Removed Buefy styles from Users page and refctor table
1 parent 6852f9f commit c2ced94

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

app/server/static/components/users.vue

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@
1313
v-bind:type="{ 'is-danger': getAddUserMessage }"
1414
v-bind:message="getAddUserMessage"
1515
)
16-
b-autocomplete(
17-
v-model="newRoleMapping.username"
16+
b-select(
1817
placeholder="e.g. Anne"
19-
open-on-focus=true
20-
v-bind:data="otherUsers"
21-
field="username"
22-
v-on:select="option => {selected = option; newRoleMapping.userid = selected.id}"
23-
v-on:input="value => checkValidExistingUser(value)"
24-
)
18+
v-model="newRoleMapping.username"
19+
v-on:input="option => {checkValidExistingUser(option); newRoleMapping.userid = option}"
20+
)
21+
option(v-for="otherUser in otherUsers", v-bind:value="otherUser.id", v-bind:key="otherUser.id")
22+
| {{ otherUser.username }}
2523

2624
div.column
2725
b-field(label="Role")
@@ -68,10 +66,23 @@
6866
span Delete
6967
</template>
7068

71-
<style scoped>
69+
<style>
7270
.user-table {
7371
padding: 40px 20px;
7472
}
73+
74+
.user-table .table {
75+
width: 100%;
76+
}
77+
78+
.user-table .card {
79+
padding: 20px 20px;
80+
}
81+
82+
.user-table .has-addons {
83+
display: none;
84+
}
85+
7586
</style>
7687

7788
<script>
@@ -138,7 +149,7 @@ export default {
138149
},
139150
140151
checkValidExistingUser(inputValue) {
141-
this.hasNewUserError = !this.otherUsers.some(user => user.username === inputValue);
152+
this.hasNewUserError = !this.otherUsers.some(user => user.id === inputValue);
142153
return inputValue;
143154
},
144155

app/server/static/pages/users.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Vue from 'vue';
22
import Buefy from 'buefy';
33
import Users from '../components/users.vue';
4-
import 'buefy/dist/buefy.css';
54

65
Vue.use(Buefy);
76

0 commit comments

Comments
 (0)