Issue 2702 — References upload through the shared import dialog; upload cards accept a dropped CSV¶
Problem¶
- Clicking "Upload Reference" opened the native file picker and uploaded
immediately. Factors, Data and Reduction objectives open the import
dialog first.
UploadCardReferences.vue(from the original #741 work) re-implemented card style, job info, error details and download locally, so it never got the year-sync guard (#867), the pipeline phase label, or the abort button that the shared card gained since. - Uploading a CSV took five gestures: button, dialog, file field, picker, Save.
Delivered¶
UploadCardReferences.vuemirrorsUploadCardFactors.vue: a wrapper aroundUploadCard.vueemittinguploadwithTargetType.REFERENCE_DATA.SubmoduleItem.vueroutes it through the injectedopenDataEntryDialoglike its siblings. Net: about 400 lines deleted.lastJobForTarget(row, targetType)(leaf module) is the single lookup for "last job of this target type", used by the dialog's overwrite warning and the threedownloadLastCsvcopies.TargetTypemoved toconstant/ingestion.ts(re-exported from the store) so pure specs can import it.UploadCard.vuehandlesdragenter/dragover/dropon the card and shows a dashed "Drop CSV here" overlay while a file hovers. The overlay covers every child sodragleavefires only when the cursor leaves the card. Disabled cards ignore drops. The dropped file rides the existinguploadevent as an optional third argument.- Both dialog openers (
DataManagementPage.vuefor reduction objectives,ModuleConfig.vuefor module and submodule cards) accept the file and pass it asdropFile;DataEntryDialogContent.vuethen runs itsuploadFiles()path without showing the dialog and releases the parent's v-model. Follow-up (PR after #2703): the first cut opened the dialog pre-filled; the maintainer chose the Gmail-style direct upload, accepting that a drop skips the overwrite warning. - Enter in the dialog: QFile owns Enter (it re-opens the picker), so after a pick the dialog moves focus to the Save button and Enter clicks it natively.
- The pipeline-scoping computeds moved unchanged from
UploadCard.vueintouseCardPipelineScope.tsto keep the component under 500 lines. FileObject(aBlobwith a fictionalpath) is gone; the files store takes browserFileobjects, which is whatq-fileemits.- i18n:
REFERENCE_DATAdialog title noun anddata_management_drop_csv_here, en and fr.
Tests¶
tests/unit/last-job-for-target.spec.ts— pure lookup per target type.tests/integration/data-management.spec.ts5c — references upload through the dialog dispatchestarget_type: 3.- 5d — a synthetic drop on the headcount factors card dispatches without opening the dialog.
- 5e — Enter after picking a file dispatches.
- 5f — a drop on a reduction-objective card carries the file and the
reduction_objective_type_id.
The e2e suite serves the prebuilt dist/spa; run quasar build before
npm run test:e2e or the tests exercise the previous bundle.