feat(export): filtered-view export can keep the OpsLog fields too
Same reasoning as the selected-rows export: ExportADIFFiltered was called with includeAppFields=false, so a filtered export lost the award references. A second entry, next to the standard one.
This commit is contained in:
+11
-3
@@ -4219,11 +4219,19 @@ export default function App() {
|
||||
// fields (optional): a chosen ADIF-tag list — the "choose which fields" export.
|
||||
// Empty = the standard/full behaviour (all fields, includeAppFields=false here).
|
||||
async function exportFilteredADIF(fields: string[] = []) {
|
||||
return exportFilteredADIFAs(false, fields);
|
||||
}
|
||||
// The same filtered export, keeping the APP_OPSLOG_* tags — see
|
||||
// exportSelectedADIFFull for why the award references need them.
|
||||
async function exportFilteredADIFFull() {
|
||||
return exportFilteredADIFAs(true, []);
|
||||
}
|
||||
async function exportFilteredADIFAs(includeApp: boolean, fields: string[]) {
|
||||
try {
|
||||
const path = await SaveADIFFile();
|
||||
if (!path) return;
|
||||
const f = buildActiveFilter();
|
||||
const r = await ExportADIFFiltered(path, false, { ...f, limit: 0, offset: 0 } as any, fields);
|
||||
const r = await ExportADIFFiltered(path, includeApp, { ...f, limit: 0, offset: 0 } as any, fields);
|
||||
showToast(`Exported ${r.count} QSO${r.count > 1 ? 's' : ''} → ${r.path}`);
|
||||
} catch (e: any) { setError(String(e?.message ?? e)); }
|
||||
}
|
||||
@@ -6065,7 +6073,7 @@ export default function App() {
|
||||
onBulkEdit={openBulkEdit}
|
||||
onExportSelected={exportSelectedADIF} onExportSelectedFull={exportSelectedADIFFull}
|
||||
onExportSelectedFields={exportSelectedFields}
|
||||
onExportFiltered={exportFilteredADIF}
|
||||
onExportFiltered={exportFilteredADIF} onExportFilteredFull={exportFilteredADIFFull}
|
||||
onDelete={(ids) => setDeletingIds(ids)}
|
||||
onRowSelected={(ids) => { setSelectedIds(ids); setSelectedId(ids[0] ?? null); }}
|
||||
onRowSelectedQso={(r) => setSelQso(r ? { call: String(r.callsign ?? ""), band: String(r.band ?? ""), mode: String(r.mode ?? ""), dxcc: Number(r.dxcc ?? 0) } : null)}
|
||||
@@ -7464,7 +7472,7 @@ export default function App() {
|
||||
onBulkEdit={openBulkEdit}
|
||||
onExportSelected={exportSelectedADIF} onExportSelectedFull={exportSelectedADIFFull}
|
||||
onExportSelectedFields={exportSelectedFields}
|
||||
onExportFiltered={exportFilteredADIF}
|
||||
onExportFiltered={exportFilteredADIF} onExportFilteredFull={exportFilteredADIFFull}
|
||||
onExportCabrilloSelected={exportSelectedCabrillo}
|
||||
onExportCabrilloFiltered={exportFilteredCabrillo}
|
||||
onDelete={(ids) => setDeletingIds(ids)}
|
||||
|
||||
@@ -22,6 +22,7 @@ type Props = {
|
||||
onExportSelectedFull?: (ids: number[]) => void;
|
||||
onExportSelectedFields?: (ids: number[]) => void;
|
||||
onExportFiltered?: () => void;
|
||||
onExportFilteredFull?: () => void;
|
||||
onExportCabrilloSelected?: (ids: number[]) => void;
|
||||
onExportCabrilloFiltered?: () => void;
|
||||
onDelete?: (ids: number[]) => void;
|
||||
@@ -42,7 +43,7 @@ const UPLOAD_TARGETS: { service: string; name: string }[] = [
|
||||
// or picks a command. (We deliberately do NOT close on scroll/resize: the QSO
|
||||
// list auto-refreshes and AG Grid fires internal scroll events on refresh,
|
||||
// which used to dismiss the menu the instant it appeared.)
|
||||
export function QSOContextMenu({ menu, onClose, onUpdateFromCty, onUpdateFromQRZ, onUpdateFromClublog, onUpdateCountyFromULS, onSendTo, onSendRecording, onSendEQSL, onBulkEdit, onExportSelected, onExportSelectedFull, onExportSelectedFields, onExportFiltered, onExportCabrilloSelected, onExportCabrilloFiltered, onDelete }: Props) {
|
||||
export function QSOContextMenu({ menu, onClose, onUpdateFromCty, onUpdateFromQRZ, onUpdateFromClublog, onUpdateCountyFromULS, onSendTo, onSendRecording, onSendEQSL, onBulkEdit, onExportSelected, onExportSelectedFull, onExportSelectedFields, onExportFiltered, onExportFilteredFull, onExportCabrilloSelected, onExportCabrilloFiltered, onDelete }: Props) {
|
||||
const { t } = useI18n();
|
||||
const boxRef = useRef<HTMLDivElement>(null);
|
||||
// Starts at the cursor; the layout effect corrects it once the real size is
|
||||
@@ -224,6 +225,15 @@ export function QSOContextMenu({ menu, onClose, onUpdateFromCty, onUpdateFromQRZ
|
||||
<span>{t('qctx.exportFilteredAdif')}</span>
|
||||
</button>
|
||||
)}
|
||||
{onExportFilteredFull && (
|
||||
<button
|
||||
className="flex w-full items-center gap-2 px-3 py-1.5 text-left hover:bg-accent/50"
|
||||
onClick={() => { onExportFilteredFull(); onClose(); }}
|
||||
>
|
||||
<FileDown className="size-4 text-info" />
|
||||
<span>{t('qctx.exportFilteredAdifFull')}</span>
|
||||
</button>
|
||||
)}
|
||||
{onExportCabrilloSelected && (
|
||||
<button
|
||||
className="flex w-full items-center gap-2 px-3 py-1.5 text-left hover:bg-accent/50"
|
||||
|
||||
@@ -73,6 +73,7 @@ type Props = {
|
||||
onExportSelectedFull?: (ids: number[]) => void;
|
||||
onExportSelectedFields?: (ids: number[]) => void;
|
||||
onExportFiltered?: () => void;
|
||||
onExportFilteredFull?: () => void;
|
||||
onExportCabrilloSelected?: (ids: number[]) => void;
|
||||
onExportCabrilloFiltered?: () => void;
|
||||
onDelete?: (ids: number[]) => void;
|
||||
@@ -318,7 +319,7 @@ const sanitizeAwardCols = (st: any[] | null | undefined): any[] =>
|
||||
return rest;
|
||||
});
|
||||
|
||||
export function RecentQSOsGrid({ rows, myGrid, selectAllSignal, selectRowSignal, rowDragCall, passOrder, onGridApi, storageKey, onRowDoubleClicked, onRowClicked, onRowSelected, onRowSelectedQso, onUpdateFromCty, onUpdateFromQRZ, onUpdateFromClublog, onUpdateCountyFromULS, onSendTo, onSendRecording, onSendEQSL, onBulkEdit, onExportSelected, onExportSelectedFull, onExportSelectedFields, onExportFiltered, onExportCabrilloSelected, onExportCabrilloFiltered, onDelete, onFilteredCountChange, awardCols, rowColors }: Props) {
|
||||
export function RecentQSOsGrid({ rows, myGrid, selectAllSignal, selectRowSignal, rowDragCall, passOrder, onGridApi, storageKey, onRowDoubleClicked, onRowClicked, onRowSelected, onRowSelectedQso, onUpdateFromCty, onUpdateFromQRZ, onUpdateFromClublog, onUpdateCountyFromULS, onSendTo, onSendRecording, onSendEQSL, onBulkEdit, onExportSelected, onExportSelectedFull, onExportSelectedFields, onExportFiltered, onExportFilteredFull, onExportCabrilloSelected, onExportCabrilloFiltered, onDelete, onFilteredCountChange, awardCols, rowColors }: Props) {
|
||||
const { t } = useI18n();
|
||||
const gridRef = useRef<any>(null);
|
||||
const [pickerOpen, setPickerOpen] = useState(false);
|
||||
@@ -753,6 +754,7 @@ export function RecentQSOsGrid({ rows, myGrid, selectAllSignal, selectRowSignal,
|
||||
onExportSelectedFull={onExportSelectedFull}
|
||||
onExportSelectedFields={onExportSelectedFields}
|
||||
onExportFiltered={onExportFiltered}
|
||||
onExportFilteredFull={onExportFilteredFull}
|
||||
onExportCabrilloSelected={onExportCabrilloSelected}
|
||||
onExportCabrilloFiltered={onExportCabrilloFiltered}
|
||||
onDelete={onDelete}
|
||||
|
||||
@@ -471,7 +471,7 @@ const en: Dict = {
|
||||
'awed.importReplace': 'Replace mine',
|
||||
'awed.importCopy': 'Import as {code}-2',
|
||||
// QSO modals (context menu / bulk edit / QSL manager / QSO edit)
|
||||
'qctx.selected': '{n} QSO(s) selected', 'qctx.fixCountry': 'Fix country & zones from cty.dat', 'qctx.updateQrz': 'Update from the callsign databases', 'qctx.updateClublog': 'Update from ClubLog (exceptions)', 'qctx.updateUlsCounty': 'Update US county from the ULS database', 'qctx.updateUlsCountyTitle': 'Re-derives the county of the selected US contacts from the downloaded ULS database, replacing what is stored. Contacts outside the US, and callsigns the database does not hold, are left alone.', 'qctx.fromUlsLabel': 'from the ULS database', 'qctx.sendQslEmail': 'Send OpsLog QSL by e-mail', 'qctx.sendRecording': 'Send recording by e-mail', 'qctx.bulkEdit': 'Bulk edit field… ({n})', 'qctx.exportSelectedAdif': 'Export selected to ADIF ({n})', 'qctx.exportSelectedAdifFull': 'Export {n} QSOs to ADIF with the OpsLog fields (award references)', 'qctx.exportSelectedFields': 'Export selected — choose fields… ({n})', 'qctx.exportFilteredAdif': 'Export filtered view to ADIF (no limit)', 'qctx.exportSelectedCabrillo': 'Export selected to Cabrillo ({n})', 'qctx.exportFilteredCabrillo': 'Export filtered view to Cabrillo (no limit)', 'qctx.sendTo': 'Send to {name}', 'qctx.delete': 'Delete {n} QSO(s)…',
|
||||
'qctx.selected': '{n} QSO(s) selected', 'qctx.fixCountry': 'Fix country & zones from cty.dat', 'qctx.updateQrz': 'Update from the callsign databases', 'qctx.updateClublog': 'Update from ClubLog (exceptions)', 'qctx.updateUlsCounty': 'Update US county from the ULS database', 'qctx.updateUlsCountyTitle': 'Re-derives the county of the selected US contacts from the downloaded ULS database, replacing what is stored. Contacts outside the US, and callsigns the database does not hold, are left alone.', 'qctx.fromUlsLabel': 'from the ULS database', 'qctx.sendQslEmail': 'Send OpsLog QSL by e-mail', 'qctx.sendRecording': 'Send recording by e-mail', 'qctx.bulkEdit': 'Bulk edit field… ({n})', 'qctx.exportSelectedAdif': 'Export selected to ADIF ({n})', 'qctx.exportSelectedAdifFull': 'Export {n} QSOs to ADIF with the OpsLog fields (award references)', 'qctx.exportSelectedFields': 'Export selected — choose fields… ({n})', 'qctx.exportFilteredAdifFull': 'Export filtered view to ADIF with the OpsLog fields (award references)', 'qctx.exportFilteredAdif': 'Export filtered view to ADIF (no limit)', 'qctx.exportSelectedCabrillo': 'Export selected to Cabrillo ({n})', 'qctx.exportFilteredCabrillo': 'Export filtered view to Cabrillo (no limit)', 'qctx.sendTo': 'Send to {name}', 'qctx.delete': 'Delete {n} QSO(s)…',
|
||||
'exp.title': 'Export to ADIF', 'exp.desc': 'Choose which fields to write.',
|
||||
'exp.stdTitle': 'Standard ADIF fields', 'exp.stdDesc': 'Official ADIF 3.1.7 fields only — best for uploading to other logbooks (LoTW, QRZ, Club Log…).',
|
||||
'exp.allTitle': 'All OpsLog fields', 'exp.allDesc': 'Everything, including OpsLog-specific and app-defined tags — a full backup you can re-import here.',
|
||||
@@ -940,7 +940,7 @@ const fr: Dict = {
|
||||
'awed.importKeepMine': 'Garder le mien',
|
||||
'awed.importReplace': 'Remplacer le mien',
|
||||
'awed.importCopy': 'Importer en {code}-2',
|
||||
'qctx.selected': '{n} QSO sélectionné(s)', 'qctx.fixCountry': 'Corriger pays et zones depuis cty.dat', 'qctx.updateQrz': 'Mettre à jour depuis les annuaires', 'qctx.updateClublog': 'Mettre à jour depuis ClubLog (exceptions)', 'qctx.updateUlsCounty': 'Mettre à jour le comté US depuis la base ULS', 'qctx.updateUlsCountyTitle': 'Recalcule le comté des contacts US sélectionnés depuis la base ULS téléchargée, en remplaçant la valeur enregistrée. Les contacts hors US et les indicatifs absents de la base ne sont pas touchés.', 'qctx.fromUlsLabel': 'depuis la base ULS', 'qctx.sendQslEmail': 'Envoyer la QSL OpsLog par e-mail', 'qctx.sendRecording': "Envoyer l'enregistrement par e-mail", 'qctx.bulkEdit': "Édition groupée d'un champ… ({n})", 'qctx.exportSelectedAdif': 'Exporter la sélection en ADIF ({n})', 'qctx.exportSelectedAdifFull': 'Exporter {n} QSO en ADIF avec les champs OpsLog (références de diplômes)', 'qctx.exportSelectedFields': 'Exporter la sélection — choisir les champs… ({n})', 'qctx.exportFilteredAdif': 'Exporter la vue filtrée en ADIF (sans limite)', 'qctx.exportSelectedCabrillo': 'Exporter la sélection en Cabrillo ({n})', 'qctx.exportFilteredCabrillo': 'Exporter la vue filtrée en Cabrillo (sans limite)', 'qctx.sendTo': 'Envoyer vers {name}', 'qctx.delete': 'Supprimer {n} QSO…',
|
||||
'qctx.selected': '{n} QSO sélectionné(s)', 'qctx.fixCountry': 'Corriger pays et zones depuis cty.dat', 'qctx.updateQrz': 'Mettre à jour depuis les annuaires', 'qctx.updateClublog': 'Mettre à jour depuis ClubLog (exceptions)', 'qctx.updateUlsCounty': 'Mettre à jour le comté US depuis la base ULS', 'qctx.updateUlsCountyTitle': 'Recalcule le comté des contacts US sélectionnés depuis la base ULS téléchargée, en remplaçant la valeur enregistrée. Les contacts hors US et les indicatifs absents de la base ne sont pas touchés.', 'qctx.fromUlsLabel': 'depuis la base ULS', 'qctx.sendQslEmail': 'Envoyer la QSL OpsLog par e-mail', 'qctx.sendRecording': "Envoyer l'enregistrement par e-mail", 'qctx.bulkEdit': "Édition groupée d'un champ… ({n})", 'qctx.exportSelectedAdif': 'Exporter la sélection en ADIF ({n})', 'qctx.exportSelectedAdifFull': 'Exporter {n} QSO en ADIF avec les champs OpsLog (références de diplômes)', 'qctx.exportSelectedFields': 'Exporter la sélection — choisir les champs… ({n})', 'qctx.exportFilteredAdifFull': 'Exporter la vue filtrée en ADIF avec les champs OpsLog (références de diplômes)', 'qctx.exportFilteredAdif': 'Exporter la vue filtrée en ADIF (sans limite)', 'qctx.exportSelectedCabrillo': 'Exporter la sélection en Cabrillo ({n})', 'qctx.exportFilteredCabrillo': 'Exporter la vue filtrée en Cabrillo (sans limite)', 'qctx.sendTo': 'Envoyer vers {name}', 'qctx.delete': 'Supprimer {n} QSO…',
|
||||
'exp.title': 'Exporter en ADIF', 'exp.desc': 'Choisissez les champs à écrire.',
|
||||
'exp.stdTitle': 'Champs ADIF standard', 'exp.stdDesc': 'Uniquement les champs officiels ADIF 3.1.7 — idéal pour l’envoi vers d’autres carnets (LoTW, QRZ, Club Log…).',
|
||||
'exp.allTitle': 'Tous les champs OpsLog', 'exp.allDesc': 'Tout, y compris les champs spécifiques à OpsLog et les balises applicatives — une sauvegarde complète ré-importable ici.',
|
||||
|
||||
Reference in New Issue
Block a user