Vue migration - remove Vuew.set & this.$set; add vue-migrate script

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia
2024-10-23 17:00:48 +02:00
parent c983ed8384
commit ea12a81174
85 changed files with 938 additions and 256 deletions
@@ -5,7 +5,7 @@ import { BadgeState } from '@components/BadgeState';
import { Banner } from '@components/Banner';
import { RadioGroup, RadioButton } from '@components/Form/Radio';
import HarvesterDisk from '../../mixins/harvester-disk';
import Tags from '../../components/DiskTags';
import DiskTags from '../../components/DiskTags';
import { HCI } from '../../types';
import { LONGHORN_SYSTEM } from './index';
@@ -17,7 +17,7 @@ export default {
Banner,
RadioGroup,
RadioButton,
Tags,
DiskTags,
},
mixins: [
@@ -171,7 +171,7 @@ export default {
<div v-if="!value.isNew">
<div class="row">
<div class="col span-12">
<Tags
<DiskTags
v-model="value.tags"
:label="t('harvester.host.disk.tags.label')"
:add-label="t('harvester.host.disk.tags.addLabel')"
@@ -92,7 +92,7 @@ export default {
methods: {
async saveKsmtuned() {
this.spec.mergeAcrossNodes = this.enableMergeAcrossNodes ? 1 : 0;
this.$set(this.ksmtuned, 'spec', this.spec);
this.ksmtuned['spec'] = this.spec;
await this.ksmtuned.save().catch((reason) => {
if (reason?.type === 'error') {
@@ -123,8 +123,8 @@ export default {
} else {
const [namespace, name] = value.split('/');
this.$set(this.value.spec.baseboardSpec.connection.authSecretRef, 'namespace', namespace);
this.$set(this.value.spec.baseboardSpec.connection.authSecretRef, 'name', name);
this.value.spec.baseboardSpec.connection.authSecretRef['namespace'] = namespace;
this.value.spec.baseboardSpec.connection.authSecretRef['name'] = name;
}
},
},
@@ -135,7 +135,7 @@ export default {
},
set(value) {
this.$set(this.secret.data, 'username', base64Encode(value));
this.secret.data['username'] = base64Encode(value);
}
},
@@ -145,7 +145,7 @@ export default {
},
set(value) {
this.$set(this.secret.data, 'password', base64Encode(value));
this.secret.data['password'] = base64Encode(value);
}
},
},
@@ -25,7 +25,7 @@ import { _EDIT } from '@shell/config/query-params';
import { sortBy } from '@shell/utils/sort';
import { Banner } from '@components/Banner';
import { HCI } from '../../types';
import Tags from '../../components/DiskTags';
import DiskTags from '../../components/DiskTags';
import HarvesterDisk from './HarvesterDisk';
import HarvesterSeeder from './HarvesterSeeder';
import HarvesterKsmtuned from './HarvesterKsmtuned';
@@ -46,7 +46,7 @@ export default {
ButtonDropdown,
KeyValue,
Banner,
Tags,
DiskTags,
Loading,
HarvesterSeeder,
MessageLink,
@@ -546,7 +546,7 @@ export default {
class="row mb-20"
>
<div class="col span-12">
<Tags
<DiskTags
v-model="longhornNode.spec.tags"
:label="t('harvester.host.tags.label')"
:add-label="t('harvester.host.tags.addLabel')"