Skip to content

Commit e714ab3

Browse files
committed
loading screen added
1 parent 16d0889 commit e714ab3

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

vue-frontend/warehouse-frontend/src/components/AppNavbar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<span class="navbar-brand">
77
<img src="@/assets/logo_new.png" alt="Turing Trust Logo" height="30">
88
</span>
9-
<button class="logout btn btn-link text-white" @click="logout"><i class="bi bi-box-arrow-left" style="padding-right: 5px;"></i>Home</button>
9+
<button class="logout btn btn-link text-white" @click="logout"><i class="bi bi-box-arrow-left" style="padding-right: 5px;"></i>Logout</button>
1010
</nav>
1111
</template>
1212

vue-frontend/warehouse-frontend/src/views/ModePage.vue

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default {
4141
</script>
4242

4343
<template>
44-
<div class="container">
44+
<div class="container" v-if="operationModes.length > 0" >
4545
<h4 class="section-title">Select a mode</h4>
4646
<p style="color: #075976;">Begin palleting or by selecting a mode below.</p>
4747

@@ -60,7 +60,12 @@ export default {
6060
</div>
6161
</div>
6262

63-
</div>
63+
</div>
64+
65+
<div class="loading-screen" v-if="operationModes.length === 0" >
66+
<div class="spinner"></div>
67+
<h4>Loading, please wait...</h4>
68+
</div>
6469
</template>
6570

6671
<style scoped>
@@ -96,6 +101,30 @@ export default {
96101
border-bottom-width: 3px;
97102
border-bottom-color: #04A27D;
98103
}
104+
105+
/* loading screen css*/
106+
.loading-screen {
107+
display: flex;
108+
flex-direction: column;
109+
align-items: center;
110+
justify-content: center;
111+
height: 100vh;
112+
}
113+
114+
.spinner {
115+
width: 50px;
116+
height: 50px;
117+
border: 5px solid #ddd;
118+
border-top: 5px solid #0b4c62;
119+
border-radius: 50%;
120+
animation: spin 1s linear infinite;
121+
}
122+
123+
@keyframes spin {
124+
0% { transform: rotate(0deg); }
125+
100% { transform: rotate(360deg); }
126+
}
127+
99128
</style>
100129

101130
<!--<template>-->

vue-frontend/warehouse-frontend/src/views/ParentPage.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ export default {
3333
this.$router.push("/transaction");
3434
} else {
3535
playErrorSound();
36-
this.errorMessage = data.message;
36+
if(data.message) {
37+
this.errorMessage = data.message;
38+
} else {
39+
this.errorMessage = "Invalid scan detected";
40+
}
41+
3742
}
3843
} catch (error) {
3944
console.error("API Error:", error);
@@ -42,6 +47,9 @@ export default {
4247
finally {
4348
this.isLoading = false;
4449
}
50+
},
51+
goBack(){
52+
this.$router.push("/");
4553
}
4654
}
4755
};
@@ -77,7 +85,7 @@ function playSuccessSound(){
7785
</div>
7886

7987
<div class="form-group">
80-
<button class="btn btn-primary" @click="scanParentId" style="width: 237px; margin-right: 8px">Cancel</button>
88+
<button class="btn btn-primary" @click="goBack" style="width: 237px; margin-right: 8px">Cancel</button>
8189
<button class="btn btn-primary" @click="scanParentId" style="width: 237px">
8290
<span v-if="isLoading" class="spinner-border spinner-border-sm"></span>
8391
<span v-else>Continue</span>

0 commit comments

Comments
 (0)