Skip to content
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

Fix E2E Test Failures in SelectList Test Suites #428

Merged
merged 1 commit into from
Jul 8, 2024
Merged
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
35 changes: 0 additions & 35 deletions src/components/FormSelectList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ export default {
countWithoutFilter: null,
};
},
mounted() {
this.$root.$on("selectListOptionsUpdated", this.onSelectListOptionsUpdated);
},
beforeDestroy() {
this.$root.$off("selectListOptionsUpdated", this.onSelectListOptionsUpdated);
},
computed: {
selectListOptionsWithSelected() {
if (this.selectedOption && !this.selectListOptions.some(o => o.value === this.selectedOption.value)) {
Expand Down Expand Up @@ -234,14 +228,6 @@ export default {
}
}
},
value: {
deep: true,
handler(newValue) {
if (newValue && typeof newValue === "object" && this.isMultiSelectDisabled()) {
this.updateOption(newValue);
}
}
}
},
methods: {
/**
Expand All @@ -252,26 +238,6 @@ export default {
isMultiSelectDisabled() {
return this.options.allowMultiSelect === false;
},

/**
* Updates the specified option with the provided updated value.
*
* @param {Object} updatedValue - The updated value of the option.
*/
updateOption(updatedValue) {
const index = this.selectListOptions.findIndex((option) => option.id === updatedValue.id);
if (index !== -1) {
this.$set(this.selectListOptions, index, updatedValue);
}
},
/**
* If the value is an object, it updates the selected option if necessary.
*/
onSelectListOptionsUpdated() {
if (this.value && typeof this.value === "object" && this.isMultiSelectDisabled()) {
this.updateOption(this.value);
}
},
renderPmql(pmql) {
if (typeof pmql !== "undefined" && pmql !== "" && pmql !== null) {
const data = this.makeProxyData();
Expand Down Expand Up @@ -342,7 +308,6 @@ export default {
const list = dataName ? get(response.data, dataName) : response.data;
const transformedList = this.transformOptions(list);
this.selectListOptions = transformedList;
this.$root.$emit("selectListOptionsUpdated", transformedList);
return true;
} catch (err) {
/* Ignore error */
Expand Down
Loading