mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-30 18:13:23 +08:00
Fix DOMPurify sanitize TypeError in Library components
Vue 2's initMethods calls .bind(vm) on every method, which creates a new function that loses custom properties. The DOMPurify default export is a callable function with .sanitize() as a property, so binding it strips sanitize entirely, causing "TypeError: e.purify.sanitize is not a function" at runtime. Move purify out of methods/data and into setup() which returns values to the template without binding. Also fix an import ordering lint issue in DataTables.vue. Fixes #22239
This commit is contained in:
@@ -60,13 +60,15 @@ export default {
|
||||
type: Boolean,
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
return { purify };
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
maxDescriptionLength: MAX_DESCRIPTION_LENGTH,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
purify,
|
||||
updateValue(value) {
|
||||
this.$emit("update:changedValue", value);
|
||||
},
|
||||
|
||||
@@ -330,6 +330,9 @@ export default {
|
||||
required: false,
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
return { purify };
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
...initialFolderState(),
|
||||
@@ -349,8 +352,6 @@ export default {
|
||||
faTimes,
|
||||
faUnlock,
|
||||
faUsers,
|
||||
// Utilities
|
||||
purify,
|
||||
// Data
|
||||
currentPage: 1,
|
||||
sortBy: "name",
|
||||
@@ -396,7 +397,6 @@ export default {
|
||||
this.getFolder(this.folder_id, this.page);
|
||||
},
|
||||
methods: {
|
||||
purify,
|
||||
getFolder(folder_id, page) {
|
||||
this.currentFolderId = folder_id;
|
||||
this.currentPage = page;
|
||||
|
||||
Reference in New Issue
Block a user