From 602e98aa32f82fd3b0c3d250c7cc1f8da971db24 Mon Sep 17 00:00:00 2001 From: Derick Montague Date: Wed, 21 Oct 2020 16:20:00 -0500 Subject: Update linting packages to use latest - 99% of changes were small syntax changes that were changed by the lint command. There were a couple of small manual changes to meet the property order patterns established as part of the vue:recommended guidelines. There are rules that were set from errors to warnings and new stories are being opened to address those issues. Testing: - Successfully ran npm run serve - Successfully ran npm run lint - Verified functionality works as expected, e.g. success and failure use cases - Resolved any JavaScript errors thrown to the console Signed-off-by: Derick Montague Change-Id: Ie082f31c73ccbe8a60afa8f88a9ef6dbf33d9fd2 --- .../FirmwareSingleImageStore.js | 58 +++++++++++----------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'src/env/store') diff --git a/src/env/store/FirmwareSingleImage/FirmwareSingleImageStore.js b/src/env/store/FirmwareSingleImage/FirmwareSingleImageStore.js index 98f86fd5..ffc4bc4b 100644 --- a/src/env/store/FirmwareSingleImage/FirmwareSingleImageStore.js +++ b/src/env/store/FirmwareSingleImage/FirmwareSingleImageStore.js @@ -7,23 +7,23 @@ const FirmwareSingleImageStore = { activeFirmware: { version: '--', id: null, - location: null + location: null, }, backupFirmware: { version: '--', id: null, location: null, - status: '--' + status: '--', }, - applyTime: null + applyTime: null, }, getters: { - systemFirmwareVersion: state => state.activeFirmware.version, - backupFirmwareVersion: state => state.backupFirmware.version, - backupFirmwareStatus: state => state.backupFirmware.status, - isRebootFromBackupAvailable: state => + systemFirmwareVersion: (state) => state.activeFirmware.version, + backupFirmwareVersion: (state) => state.backupFirmware.version, + backupFirmwareStatus: (state) => state.backupFirmware.status, + isRebootFromBackupAvailable: (state) => state.backupFirmware.id ? true : false, - bmcFirmwareCurrentVersion: state => state.activeFirmware.version //this getter is needed for the Overview page + bmcFirmwareCurrentVersion: (state) => state.activeFirmware.version, //this getter is needed for the Overview page }, mutations: { setActiveFirmware: (state, { version, id, location }) => { @@ -37,7 +37,7 @@ const FirmwareSingleImageStore = { state.backupFirmware.location = location; state.backupFirmware.status = status; }, - setApplyTime: (state, applyTime) => (state.applyTime = applyTime) + setApplyTime: (state, applyTime) => (state.applyTime = applyTime), }, actions: { async getFirmwareInformation({ commit }) { @@ -47,8 +47,8 @@ const FirmwareSingleImageStore = { const currentLocation = Links.ActiveSoftwareImage['@odata.id']; // Check SoftwareImages list for not ActiveSoftwareImage id const backupLocation = Links.SoftwareImages.map( - item => item['@odata.id'] - ).find(location => { + (item) => item['@odata.id'] + ).find((location) => { const id = location.split('/').pop(); const currentId = currentLocation.split('/').pop(); return id !== currentId; @@ -66,16 +66,16 @@ const FirmwareSingleImageStore = { commit('setActiveFirmware', { version: currentData?.data?.Version, id: currentData?.data?.Id, - location: currentData?.data?.['@odata.id'] + location: currentData?.data?.['@odata.id'], }); commit('setBackupFirmware', { version: backupData.data?.Version, id: backupData.data?.Id, location: backupData.data?.['@odata.id'], - status: backupData.data?.Status?.State + status: backupData.data?.Status?.State, }); }) - .catch(error => console.log(error)); + .catch((error) => console.log(error)); }, getUpdateServiceApplyTime({ commit }) { api @@ -85,20 +85,20 @@ const FirmwareSingleImageStore = { data.HttpPushUriOptions.HttpPushUriApplyTime.ApplyTime; commit('setApplyTime', applyTime); }) - .catch(error => console.log(error)); + .catch((error) => console.log(error)); }, setApplyTimeImmediate({ commit }) { const data = { HttpPushUriOptions: { HttpPushUriApplyTime: { - ApplyTime: 'Immediate' - } - } + ApplyTime: 'Immediate', + }, + }, }; return api .patch('/redfish/v1/UpdateService', data) .then(() => commit('setApplyTime', 'Immediate')) - .catch(error => console.log(error)); + .catch((error) => console.log(error)); }, async uploadFirmware({ state, dispatch }, image) { if (state.applyTime !== 'Immediate') { @@ -108,11 +108,11 @@ const FirmwareSingleImageStore = { } return await api .post('/redfish/v1/UpdateService', image, { - headers: { 'Content-Type': 'application/octet-stream' } + headers: { 'Content-Type': 'application/octet-stream' }, }) .then(() => dispatch('getSystemFirwareVersion')) .then(() => i18n.t('pageFirmware.toast.successUploadMessage')) - .catch(error => { + .catch((error) => { console.log(error); throw new Error(i18n.t('pageFirmware.toast.errorUploadAndReboot')); }); @@ -120,7 +120,7 @@ const FirmwareSingleImageStore = { async uploadFirmwareTFTP({ state, dispatch }, { address, filename }) { const data = { TransferProtocol: 'TFTP', - ImageURI: `${address}/${filename}` + ImageURI: `${address}/${filename}`, }; if (state.applyTime !== 'Immediate') { // ApplyTime must be set to Immediate before making @@ -134,7 +134,7 @@ const FirmwareSingleImageStore = { ) .then(() => dispatch('getSystemFirwareVersion')) .then(() => i18n.t('pageFirmware.toast.successUploadMessage')) - .catch(error => { + .catch((error) => { console.log(error); throw new Error(i18n.t('pageFirmware.toast.errorUploadAndReboot')); }); @@ -144,19 +144,19 @@ const FirmwareSingleImageStore = { const data = { Links: { ActiveSoftwareImage: { - '@odata.id': backupLoaction - } - } + '@odata.id': backupLoaction, + }, + }, }; return await api .patch('/redfish/v1/Managers/bmc', data) .then(() => i18n.t('pageFirmware.toast.successRebootFromBackup')) - .catch(error => { + .catch((error) => { console.log(error); throw new Error(i18n.t('pageFirmware.toast.errorRebootFromBackup')); }); - } - } + }, + }, }; export default FirmwareSingleImageStore; -- cgit v1.2.3