sonar low

This commit is contained in:
Cindy Chang
2024-07-26 11:16:05 +08:00
parent a5f271ccc8
commit 47da80b424
4 changed files with 33 additions and 27 deletions

View File

@@ -122,16 +122,16 @@ export default {
case 'Map':
case 'CheckMap':
// 沒有 filter Id, 沒有暫存 tempFilterId Id 就不能存檔
return this.tempFilterId ? false : true;
return !this.tempFilterId;
case 'Conformance':
case 'CheckConformance':
return this.conformanceFilterTempCheckId || this.conformanceLogTempCheckId ? false : true;
return !(this.conformanceFilterTempCheckId || this.conformanceLogTempCheckId);
}
},
showIcon: function() {
let result = true;
result = ['FILES', 'UPLOAD'].includes(this.navViewName) ? false : true;
result = !['FILES', 'UPLOAD'].includes(this.navViewName);
return result;
},
noShowSaveButton: function() {
@@ -157,7 +157,7 @@ export default {
if(this.$route.params.type === 'filter') {
this.createFilterId= this.$route.params.fileId;
}
this.showNavbarBreadcrumb = this.$route.matched[0].name !== ('AuthContainer') ? true : false;
this.showNavbarBreadcrumb = this.$route.matched[0].name !== ('AuthContainer');
this.getNavViewName();
},
methods: {
@@ -251,9 +251,12 @@ export default {
break;
case 'COMPARE':
switch(name) {
case 'dummy':
case 'CompareDashboard':
valueToSet = 'DASHBOARD';
break;
default:
break;
}
break;
}
@@ -274,7 +277,6 @@ export default {
*/
async saveModal() {
// 協助判斷 MAP, CONFORMANCE 儲存有「送出」或「取消」。
let isSaved;
// 傳給 Map通知 Sidebar 要關閉。
this.$emitter.emit('saveModal', false);

View File

@@ -70,7 +70,7 @@ export async function saveFilter(addFilterId, next = null) {
* @param { string } value File's name
*/
export async function savedSuccessfully(value) {
value = value ? value : '';
value = value || '';
await Swal.fire({
title: 'SAVE COMPLETE',
html: `<span class="text-primary">${value}</span> has been saved in Lucia.`,

View File

@@ -214,7 +214,7 @@ export default defineStore('filesStore', {
break;
}
try {
const response = await axios.put(api, data);
await axios.put(api, data);
this.uploadFileName = null;
await this.fetchAllFiles();
} catch(error) {

View File

@@ -116,9 +116,12 @@
</ul>
</div>
<!-- All Files type of grid -->
<draggable tag="ul" :list="compareData" :group="{ name: 'files' }" itemKey="name" class="flex justify-start items-start gap-4 flex-wrap overflow-y-scroll overflow-x-hidden max-h-[calc(100vh_-_440px)] scrollbar" id="compareGridCards">
<ul>
<draggable tag="ul" :list="compareData" :group="{ name: 'files' }" itemKey="name" class="flex justify-start items-start gap-4
flex-wrap overflow-y-scroll overflow-x-hidden max-h-[calc(100vh_-_440px)] scrollbar" id="compareGridCards">
<template #item="{ element, index }">
<li class="w-[216px] h-[168px] p-4 border rounded border-neutral-300 hover:bg-primary/10 hover:border-primary duration-300 flex flex-col justify-between cursor-pointer" :title="element.name" :id="'compareFile' + index">
<li class="w-[216px] h-[168px] p-4 border rounded border-neutral-300 hover:bg-primary/10 hover:border-primary duration-300
flex flex-col justify-between cursor-pointer" :title="element.name" :id="'compareFile' + index">
<div>
<span class="material-symbols-outlined mb-2 !text-[32px] block">
{{ element.icon }}
@@ -136,6 +139,7 @@
</li>
</template>
</draggable>
</ul>
</section>
<!-- All & Discover -->
<section v-else>
@@ -320,7 +324,7 @@
* Compare Submit button disabled
*/
isCompareDisabledButton: function() {
let result = this.primaryDragData.length === 0 || this.secondaryDragData.length === 0 ? true : false;
let result = this.primaryDragData.length === 0 || this.secondaryDragData.length === 0;
return result;
},
/**