Skip to content

Commit

Permalink
fix ts warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis-toboggan-md committed Jan 3, 2024
1 parent 0d75a66 commit b7b4cae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions pkg/capi/components/CCVariables/Variable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
import KeyValue from '@shell/components/form/KeyValue.vue';
import ArrayList from '@shell/components/form/ArrayList.vue';
import LabeledSelect from '@shell/components/form/LabeledSelect.vue';
import { Validator } from '@shell/utils/validators/formRules';
import { mapGetters } from 'vuex';
import { Translation } from '@rancher/shell/types/t';
import type { ClusterClassVariable } from '../../types/clusterClass';
import { isDefined, openAPIV3SchemaValidators } from '../../util/validators';
export default defineComponent({
name: 'CCVariable',
Expand Down Expand Up @@ -43,6 +45,7 @@ export default defineComponent({
},
computed: {
...mapGetters({ t: 'i18n/t' }),
componentForType() {
const { type } = this.schema;
let out = null;
Expand Down Expand Up @@ -98,12 +101,13 @@ export default defineComponent({
},
validationRules() {
const out = openAPIV3SchemaValidators(this.$store.getters['i18n/t'], { key: this.variable.name }, this.schema);
const t = this.t as Translation;
const out = openAPIV3SchemaValidators(t, { key: this.variable.name }, this.schema);
const required = this.variable?.required;
if (required && this.validateRequired) {
out.push(val => !isDefined(val) ? this.$store.getters['i18n/t']('validation.required', { key: this.variable.name }) : null);
out.push(val => !isDefined(val) ? t('validation.required', { key: this.variable.name }) : undefined);
}
return out;
Expand Down
2 changes: 1 addition & 1 deletion pkg/capi/edit/cluster.x-k8s.io.cluster.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { defineComponent } from 'vue';
import Tabbed from '@shell/components/Tabbed.vue';
import Tabbed from '@shell/components/Tabbed/index.vue';
import Tab from '@shell/components/Tabbed/Tab.vue';
import LabeledSelect from '@shell/components/form/LabeledSelect.vue';
import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
Expand Down

0 comments on commit b7b4cae

Please sign in to comment.