Skip to content

Fix linting in Vue3 #421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 1060-vue3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ module.exports = {
trailingComma: 'all',
},
],
'vue/component-name-in-template-casing': [
'error',
'PascalCase' | 'kebab-case',
],
'vue/component-name-in-template-casing': 'off',
},
ignorePatterns: ['*.timestamp-*.mjs'],
overrides: [
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppHeader/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ getEvents();

const assetTag = computed(() => globalStore.assetTag);
const isNavTagPresent = computed(
() => assetTag.value || globalStore.modelType || globalStore.serialNumber
() => assetTag.value || globalStore.modelType || globalStore.serialNumber,
);
const modelType = computed(() => globalStore.modelType);
const serialNumber = computed(() => globalStore.serialNumber);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Composables/useTableSelectableComposable.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ const useTableSelectableComposable = () => {
};
};

export default useTableSelectableComposable;
export default useTableSelectableComposable;
2 changes: 1 addition & 1 deletion src/components/Composables/useToastComposable.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useToastComposable = () => {
show?.({
props: () => ({
//Success toast autoHideDelay - 10 seconds, Error/Info toast autohidedelay - 30 minutes
interval: statusPassed==="success" ? 10000 : 1800000,
interval: statusPassed === 'success' ? 10000 : 1800000,
}),
component: h(Toast, {
title: title,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Global/FormFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
:disabled="disabled"
:state="state"
plain
@update:model-value="$emit('input', file)"
class="form-control-file"
@update:model-value="$emit('input', file)"
>
</BFormFile>
<span
Expand Down
12 changes: 6 additions & 6 deletions src/components/Global/InfoTooltipPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import { defineProps } from 'vue';
import IconTooltip from '@carbon/icons-vue/es/information/16';

defineProps({
title: {
type: String,
default: '',
},
})
title: {
type: String,
default: '',
},
});
</script>

<style lang="scss" scoped>
Expand All @@ -51,7 +51,7 @@ defineProps({
vertical-align: baseline;
}
}
#tooltip{
#tooltip {
text-align: left !important;
}
</style>
9 changes: 3 additions & 6 deletions src/components/Global/InputPasswordToggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
</div>
</template>


<script setup>
import IconView from '@carbon/icons-vue/es/view/20';
import IconViewOff from '@carbon/icons-vue/es/view--off/20';
Expand All @@ -25,13 +24,11 @@ const togglePasswordLabel = ref(i18n.global.t('global.ariaLabel.showPassword'));
const emit = defineEmits(['updatePassView']);
const toggleVisibility = () => {
isVisible.value = !isVisible.value;
emit('updatePassView',
isVisible.value ? 'text' : 'password'
)
emit('updatePassView', isVisible.value ? 'text' : 'password');
togglePasswordLabel.value = isVisible.value
? i18n.global.t('global.ariaLabel.hidePassword')
: i18n.global.t('global.ariaLabel.showPassword')
}
: i18n.global.t('global.ariaLabel.showPassword');
};
</script>

<style lang="scss" scoped>
Expand Down
86 changes: 43 additions & 43 deletions src/components/Global/TableRowAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,51 +59,51 @@ import { defineProps, computed } from 'vue';
import { omit } from 'lodash';

const props = defineProps({
value: {
type: String,
required: true,
},
enabled: {
type: Boolean,
default: true,
},
title: {
type: String,
default: null,
},
rowData: {
type: Object,
default: () => {},
},
exportName: {
type: String,
default: 'export',
},
downloadLocation: {
type: String,
default: '',
},
btnIconOnly: {
type: Boolean,
default: true,
},
downloadInNewTab: {
type: Boolean,
default: false,
},
showButton: {
type: Boolean,
default: true,
},
});
value: {
type: String,
required: true,
},
enabled: {
type: Boolean,
default: true,
},
title: {
type: String,
default: null,
},
rowData: {
type: Object,
default: () => {},
},
exportName: {
type: String,
default: 'export',
},
downloadLocation: {
type: String,
default: '',
},
btnIconOnly: {
type: Boolean,
default: true,
},
downloadInNewTab: {
type: Boolean,
default: false,
},
showButton: {
type: Boolean,
default: true,
},
});

const dataForExport = computed(() => {
return JSON.stringify(omit(props.rowData, 'actions'));
});
return JSON.stringify(omit(props.rowData, 'actions'));
});
const download = computed(() => {
return `${props.exportName}.json`;
});
return `${props.exportName}.json`;
});
const href = computed(() => {
return `data:text/json;charset=utf-8,${dataForExport.value}`;
return `data:text/json;charset=utf-8,${dataForExport.value}`;
});
</script>
</script>
2 changes: 1 addition & 1 deletion src/layouts/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ onMounted(() => {
});

watch(
() => route
() => route,
// () => {
// nextTick(() => {
// setFocus(focusTarget.value);
Expand Down
8 changes: 6 additions & 2 deletions src/layouts/LoginLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<div class="login-main">
<div>
<div class="login-brand mb-5">
<img width="90px" src="@/assets/images/login-company-logo.svg" :alt="altLogo" />
<img
width="90px"
src="@/assets/images/login-company-logo.svg"
:alt="altLogo"
/>
</div>
<h1 v-if="customizableGuiName" class="h3 mb-5">
{{ customizableGuiName }}
Expand All @@ -27,7 +31,7 @@ import { ref } from 'vue';
// Need to uncomment the below when env based configuration is implemented
// const altLogo = ref(process.env.VUE_APP_COMPANY_NAME || 'OpenBMC');
// const customizableGuiName = ref(process.env.VUE_APP_GUI_NAME || '');
const altLogo = ref('OpenBMC');
const altLogo = ref('OpenBMC');
const customizableGuiName = ref('Advanced System Management Interface (ASMI)');
</script>

Expand Down
10 changes: 4 additions & 6 deletions src/store/modules/Authentication/AuthenticationStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export const AuthenticationStore = defineStore('authentication', {
unauthErrorGetter: (state) => state.unauthError,
isLoggedIn: (state) => {
//Change null to undefined once the cookies value able to get
return (
state.xsrfCookie !== null || state.isAuthenticatedCookie == 'true'
);
return state.xsrfCookie !== null || state.isAuthenticatedCookie == 'true';
},
token: (state) => state.xsrfCookie,
},
Expand Down Expand Up @@ -67,9 +65,9 @@ export const AuthenticationStore = defineStore('authentication', {
};
return api
.post('/logout', { data: [] }, { headers: headers })
.then(()=>{
Cookies.remove('XSRF-TOKEN')
Cookies.remove('IsAuthenticated')
.then(() => {
Cookies.remove('XSRF-TOKEN');
Cookies.remove('IsAuthenticated');
localStorage.removeItem('storedModelType');
localStorage.removeItem('storedUsername');
localStorage.removeItem('storedCurrentUser');
Expand Down
12 changes: 6 additions & 6 deletions src/store/modules/GlobalStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const GlobalStore = defineStore('global', {
this.currentUser = data;
localStorage.setItem(
'storedCurrentUser',
JSON.stringify(this.currentUser)
JSON.stringify(this.currentUser),
);
})
.catch((error) => {
Expand All @@ -136,11 +136,11 @@ export const GlobalStore = defineStore('global', {
async getHmcManaged() {
return await api
.get(
'/redfish/v1/Registries/BiosAttributeRegistry/BiosAttributeRegistry'
'/redfish/v1/Registries/BiosAttributeRegistry/BiosAttributeRegistry',
)
.then(({ data: { RegistryEntries } }) => {
const hmcMananged = RegistryEntries.Attributes.filter(
(Attribute) => Attribute.AttributeName == 'pvm_hmc_managed'
(Attribute) => Attribute.AttributeName == 'pvm_hmc_managed',
);
let hmcManangedValue = hmcMananged[0].CurrentValue;
this.hmcManaged = hmcManangedValue;
Expand Down Expand Up @@ -178,7 +178,7 @@ export const GlobalStore = defineStore('global', {
} else {
this.serverStatus = serverStateMapper(PowerState);
}
}
},
)
.catch((error) => {
console.log(error);
Expand Down Expand Up @@ -209,8 +209,8 @@ export const GlobalStore = defineStore('global', {
});
},
setUtcTime(isUtcDisplay) {
this.isUtcDisplay = isUtcDisplay
}
this.isUtcDisplay = isUtcDisplay;
},
},
});

Expand Down
10 changes: 5 additions & 5 deletions src/store/modules/HardwareStatus/ChassisStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const ChassisStore = defineStore('chassisStore', {
return await api
.get('/redfish/v1/Chassis')
.then(({ data: { Members = [] } }) =>
Members.map((member) => api.get(member['@odata.id']))
Members.map((member) => api.get(member['@odata.id'])),
)
.then((promises) => api.all(promises))
.then((response) => {
Expand All @@ -60,11 +60,11 @@ export const ChassisStore = defineStore('chassisStore', {
this.fetchGetChassisInfo();
if (led.identifyLed) {
return i18n.global.t(
'pageInventory.toast.successEnableIdentifyLed'
'pageInventory.toast.successEnableIdentifyLed',
);
} else {
return i18n.global.t(
'pageInventory.toast.successDisableIdentifyLed'
'pageInventory.toast.successDisableIdentifyLed',
);
}
})
Expand All @@ -73,11 +73,11 @@ export const ChassisStore = defineStore('chassisStore', {
console.log('error', error);
if (led.identifyLed) {
throw new Error(
i18n.global.t('pageInventory.toast.errorEnableIdentifyLed')
i18n.global.t('pageInventory.toast.errorEnableIdentifyLed'),
);
} else {
throw new Error(
i18n.global.t('pageInventory.toast.errorDisableIdentifyLed')
i18n.global.t('pageInventory.toast.errorDisableIdentifyLed'),
);
}
});
Expand Down
Loading