mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-02 12:11:58 +00:00
feat: add ownership and base model filtering, unify asset/dropdown types (#8497)
Add ownership and base model filtering to AssetBrowserModal and FormDropdown widgets. ## Changes - **Ownership filter**: Filter by All/My Models/Public Models (uses `is_immutable` field) - **Base model filter**: Multi-select filter with Clear Filters button - **Type unification**: Replace `AssetDropdownItem` with `FormDropdownItem` - **Sorting unification**: Extract shared utilities to `assetSortUtils.ts` - **UI refactor**: Use `Button` component, Vue 3.5 prop shorthand, i18n improvements --------- Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -3,8 +3,15 @@ import { mount } from '@vue/test-utils'
|
||||
import PrimeVue from 'primevue/config'
|
||||
import type { SelectProps } from 'primevue/select'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { createI18n } from 'vue-i18n'
|
||||
|
||||
import SelectPlus from '@/components/primevueOverride/SelectPlus.vue'
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: 'en',
|
||||
messages: { en: {} }
|
||||
})
|
||||
import type { ComboInputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
||||
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
|
||||
import WidgetSelect from '@/renderer/extensions/vueNodes/widgets/components/WidgetSelect.vue'
|
||||
@@ -74,7 +81,7 @@ describe('WidgetSelect Value Binding', () => {
|
||||
readonly
|
||||
},
|
||||
global: {
|
||||
plugins: [PrimeVue, createTestingPinia()],
|
||||
plugins: [PrimeVue, createTestingPinia(), i18n],
|
||||
components: { SelectPlus }
|
||||
}
|
||||
})
|
||||
@@ -226,7 +233,7 @@ describe('WidgetSelect Value Binding', () => {
|
||||
nodeType: 'CheckpointLoaderSimple'
|
||||
},
|
||||
global: {
|
||||
plugins: [PrimeVue, createTestingPinia()],
|
||||
plugins: [PrimeVue, createTestingPinia(), i18n],
|
||||
components: { SelectPlus }
|
||||
}
|
||||
})
|
||||
@@ -245,7 +252,7 @@ describe('WidgetSelect Value Binding', () => {
|
||||
nodeType: 'KSampler'
|
||||
},
|
||||
global: {
|
||||
plugins: [PrimeVue, createTestingPinia()],
|
||||
plugins: [PrimeVue, createTestingPinia(), i18n],
|
||||
components: { SelectPlus }
|
||||
}
|
||||
})
|
||||
@@ -269,7 +276,7 @@ describe('WidgetSelect Value Binding', () => {
|
||||
nodeType: 'CheckpointLoaderSimple'
|
||||
},
|
||||
global: {
|
||||
plugins: [PrimeVue, createTestingPinia()],
|
||||
plugins: [PrimeVue, createTestingPinia(), i18n],
|
||||
components: { SelectPlus }
|
||||
}
|
||||
})
|
||||
@@ -288,7 +295,7 @@ describe('WidgetSelect Value Binding', () => {
|
||||
nodeType: 'CheckpointLoaderSimple'
|
||||
},
|
||||
global: {
|
||||
plugins: [PrimeVue, createTestingPinia()],
|
||||
plugins: [PrimeVue, createTestingPinia(), i18n],
|
||||
components: { SelectPlus }
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user