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(vuetify): add patch for expandable panels with v-model #624

Merged
merged 1 commit into from
Jul 16, 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
33 changes: 30 additions & 3 deletions src/components/DataBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,36 @@ export default defineComponent({
() => imageStore.idList.filter((id) => isRegularImage(id)).length > 0
);

const panels = ref<string[]>([SAMPLE_DATA_KEY, DICOM_WEB_KEY]);
const panels = ref<string[]>([SAMPLE_DATA_KEY]);

watch(patients, (newPatients, oldPatients) => {
// Remove from panels to avoid error in vuetify group.ts
oldPatients.forEach((oldPatient) => {
if (!newPatients.find((p) => p.key === oldPatient.key)) {
removeFromArray(panels.value, oldPatient.key);
}
});
});

const hideSampleData = computed(() => dataBrowserStore.hideSampleData);
watch(hideSampleData, (hide) => {
if (hide) {
// Remove from panels to avoid error in vuetify group.ts
removeFromArray(panels.value, SAMPLE_DATA_KEY);
}
});

watch(
computed(() => dicomWeb.isConfigured),
(configured) => {
if (configured) {
panels.value.push(DICOM_WEB_KEY);
} else {
// Remove from panels to avoid error in vuetify group.ts
removeFromArray(panels.value, DICOM_WEB_KEY);
}
}
);

watch(
[hasAnonymousImages, patients] as const,
Expand All @@ -64,8 +93,6 @@ export default defineComponent({
}
);

const hideSampleData = computed(() => dataBrowserStore.hideSampleData);

const deletePatient = (key: string) => {
dicomStore.patientStudies[key]
.flatMap((study) => dicomStore.studyVolumes[study])
Expand Down
Loading