Skip to content

Commit 108af3c

Browse files
authored
Merge pull request #1016 from CSCfi/feature/replace-buefy-components
Replace buefy components with csc-ui components
2 parents f53da46 + 7d7f1e4 commit 108af3c

File tree

12 files changed

+133
-188
lines changed

12 files changed

+133
-188
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6262
- (GH #1007) Create new Taginput component to replace Buefy's taginput component
6363
- (GH #1009) Replace buefy toasts with c-toasts from `csc-ui`
6464
- (GH #1014) Replace buefy snackbars with custom c-toasts from `csc-ui`
65+
- (GL #944) Replace buefy b-input with c-text-field from `csc-ui`
66+
- (GL #944) Replace buefy b-button with c-button from `csc-ui`
67+
- (GL #944) Replace buefy b-select with c-select from `csc-ui`
68+
- (GL #944) Replace buefy b-loading with c-loader from `csc-ui` and remove unused b-loading
69+
- (GL #944) Replace buefy b-table with c-data-table from `csc-ui`
6570

6671
### Fixed
6772

swift_browser_ui_frontend/src/common/store.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ const store = new Vuex.Store({
2323
active: {},
2424
uname: "",
2525
multipleProjects: false,
26-
isLoading: false,
27-
isFullPage: true,
2826
objectCache: [], // Only for shared objects
2927
langs: [
3028
{ ph: "In English", value: "en" },
@@ -59,9 +57,6 @@ const store = new Vuex.Store({
5957
uploadAbort: undefined,
6058
},
6159
mutations: {
62-
loading(state, payload) {
63-
state.isLoading = payload;
64-
},
6560
updateObjects(state, objects) {
6661
// Update object cache with the new object listing.
6762
state.objectCache = [...objects];
@@ -86,9 +81,6 @@ const store = new Vuex.Store({
8681
// Update the username in store
8782
state.uname = newUname;
8883
},
89-
setLoading(state, newValue) {
90-
state.isLoading = newValue;
91-
},
9284
setSharingClient(state, newClient) {
9385
state.client = newClient;
9486
},
@@ -248,24 +240,18 @@ const store = new Vuex.Store({
248240
},
249241
actions: {
250242
updateContainers: async function (
251-
{ state, commit, dispatch },
243+
{ state, dispatch },
252244
{ projectID, signal },
253245
) {
254246
const existingContainers = await state.db.containers
255247
.where({ projectID })
256248
.toArray();
257-
if (existingContainers.length === 0) {
258-
commit("loading", true);
259-
}
260249
let containers;
261250
let marker = "";
262251
let newContainers = [];
263252
do {
264253
containers = [];
265-
containers = await getContainers(projectID, marker).catch(() => {
266-
commit("loading", false);
267-
});
268-
commit("loading", false);
254+
containers = await getContainers(projectID, marker).catch(() => {});
269255
if (containers.length > 0) {
270256
containers.forEach(cont => {
271257
cont.tokens = tokenize(cont.name);
@@ -494,7 +480,6 @@ const store = new Vuex.Store({
494480
{ commit, dispatch },
495481
{ project, owner, container, signal },
496482
) {
497-
commit("loading", true);
498483
let sharedObjects = [];
499484
let marker = "";
500485
let objects = [];
@@ -507,7 +492,6 @@ const store = new Vuex.Store({
507492
true,
508493
owner,
509494
).catch(() => {
510-
commit("loading", false);
511495
commit("updateObjects", []);
512496
});
513497

@@ -516,7 +500,6 @@ const store = new Vuex.Store({
516500
marker = objects[objects.length - 1].name;
517501
}
518502
} while (objects.length > 0);
519-
commit("loading", false);
520503
commit("updateObjects", sharedObjects);
521504
dispatch("updateObjectTags", {
522505
projectID: project,

swift_browser_ui_frontend/src/components/CopyFolderModal.vue

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,17 @@
1515
{{ $t("message.replicate.destinationExists") }}
1616
</p>
1717
</c-alert>
18-
<b-field
19-
custom-class="has-text-dark"
18+
<c-text-field
19+
id="new-copy-folderName"
20+
v-csc-model="folderName"
2021
:label="$t('message.replicate.name_newFolder')"
21-
label-for="new-copy-folderName"
22-
>
23-
<b-input
24-
id="new-copy-folderName"
25-
v-model="folderName"
26-
name="foldername"
27-
custom-class="has-text-dark"
28-
:loading="loadingFoldername"
29-
/>
30-
</b-field>
22+
name="foldername"
23+
:loading="loadingFoldername"
24+
/>
3125
<label
3226
class="taginput-label"
3327
label-for="copy-folder-taginput"
34-
>
28+
>
3529
{{ $t('message.tagName') }}
3630
</label>
3731
<TagInput
@@ -307,4 +301,4 @@ c-card-actions {
307301
c-card-actions > c-button {
308302
margin: 0;
309303
}
310-
</style>
304+
</style>

swift_browser_ui_frontend/src/components/CreateFolderModal.vue

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,14 @@
1717
<p class="info-text is-size-6">
1818
{{ $t("message.container_ops.norename") }}
1919
</p>
20-
<b-field
21-
custom-class="has-text-dark"
20+
<c-text-field
21+
id="folderName"
22+
v-csc-model="folderName"
2223
:label="$t('message.container_ops.folderName')"
23-
label-for="folderName"
24-
>
25-
<b-input
26-
id="folderName"
27-
v-model="folderName"
28-
name="foldername"
29-
aria-required="true"
30-
data-testid="folder-name"
31-
/>
32-
</b-field>
24+
name="foldername"
25+
aria-required="true"
26+
data-testid="folder-name"
27+
/>
3328
<label
3429
class="taginput-label"
3530
label-for="create-folder-taginput"

swift_browser_ui_frontend/src/components/ObjectTable.vue

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,18 @@
7979
id="optionsbar"
8080
justify="space-between"
8181
>
82-
<div class="search">
83-
<b-input
84-
v-model="searchQuery"
85-
:placeholder="$t('message.objects.filterBy')"
86-
type="search"
87-
icon="filter-variant"
82+
<c-text-field
83+
id="search"
84+
v-csc-model="searchQuery"
85+
name="search"
86+
:placeholder="$t('message.objects.filterBy')"
87+
type="search"
88+
>
89+
<i
90+
slot="pre"
91+
class="mdi mdi-filter-variant mdi-24px"
8892
/>
89-
</div>
90-
93+
</c-text-field>
9194
<c-menu
9295
:key="optionsKey"
9396
:items.prop="tableOptions"
@@ -764,6 +767,10 @@ export default {
764767
<style scoped lang="scss">
765768
@import "@/css/prod.scss";
766769
770+
#search {
771+
flex: 0.4;
772+
}
773+
767774
.back-link {
768775
display: flex;
769776
padding-bottom: .5rem;

swift_browser_ui_frontend/src/components/SearchBox.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
v-if="searchArray.length > 0 && searchArray[0].length > 1"
3232
class="media empty-search"
3333
>
34-
<b-loading
35-
v-model="isSearching"
36-
:is-full-page="false"
34+
<c-loader
35+
v-show="isSearching"
3736
/>
3837
<div
3938
v-show="!isSearching"

swift_browser_ui_frontend/src/components/UploadModal.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,13 @@
115115
rows="3"
116116
/>
117117
<c-button
118-
type="is-success"
119-
icon-left="lock-plus"
120118
@click="appendPublicKey"
121119
@keyup.enter="appendPublicKey"
122120
>
121+
<i
122+
slot="icon"
123+
class="mdi mdi-lock-plus"
124+
/>
123125
{{ $t("message.encrypt.addkey") }}
124126
</c-button>
125127
<c-data-table

swift_browser_ui_frontend/src/entries/main.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,6 @@ new Vue({
160160
user() {
161161
return this.$store.state.uname;
162162
},
163-
isFullPage() {
164-
return this.$store.state.isFullPage;
165-
},
166-
isLoading() {
167-
return this.$store.state.isLoading;
168-
},
169163
isChunking() {
170164
return this.$store.state.isChunking;
171165
},

swift_browser_ui_frontend/src/entries/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ new Vue ({
2828
loginformname: "Openstack account:",
2929
idb: true,
3030
projects: [],
31-
langs: [{ph: "In English", value: "en"}, {ph: "Suomeksi", value: "fi"}],
31+
langs: [{name: "In English", value: "en"}, {name: "Suomeksi", value: "fi"}],
3232
},
3333
created() {
3434
document.title = this.$t("message.program_name");

swift_browser_ui_frontend/src/pages/BrowserPage.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@
4646
<CopyFolderModal />
4747
</c-modal>
4848
<router-view class="content-wrapper" />
49-
<b-loading
50-
:is-full-page="isFullPage"
51-
:active.sync="isLoading"
52-
:can-cancel="false"
53-
/>
5449
<c-toasts id="toasts" />
5550
<!-- TODO: Move folder toast to programmatical modal -->
5651
<c-toasts

0 commit comments

Comments
 (0)