mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
Parse #tags column:
This commit is contained in:
parent
ee2570624a
commit
fc31478196
3 changed files with 14 additions and 1 deletions
|
@ -136,6 +136,11 @@ impl Collection {
|
|||
metadata.deck = Some(CsvDeck::DeckColumn(n));
|
||||
}
|
||||
}
|
||||
"tags column" => {
|
||||
if let Ok(n) = value.trim().parse() {
|
||||
metadata.tags_column = n;
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
let dupeResolution: ImportExport.ImportCsvRequest.DupeResolution;
|
||||
let lastNotetypeId = globalNotetype?.id;
|
||||
|
||||
$: columnOptions = getColumnOptions(columnLabels, notetypeColumn, deckColumn);
|
||||
$: columnOptions = getColumnOptions(
|
||||
columnLabels,
|
||||
notetypeColumn,
|
||||
deckColumn,
|
||||
tagsColumn,
|
||||
);
|
||||
$: getCsvMetadata(path, delimiter).then((meta) => {
|
||||
columnLabels = meta.columnLabels;
|
||||
preview = meta.preview;
|
||||
|
|
|
@ -19,6 +19,7 @@ export function getColumnOptions(
|
|||
columnLabels: string[],
|
||||
notetypeColumn: number | null,
|
||||
deckColumn: number | null,
|
||||
tagsColumn: number,
|
||||
): ColumnOption[] {
|
||||
return [{ label: tr.changeNotetypeNothing(), value: 0, disabled: false }].concat(
|
||||
columnLabels.map((label, index) => {
|
||||
|
@ -27,6 +28,8 @@ export function getColumnOptions(
|
|||
return columnOption(tr.notetypesNotetype(), true, index);
|
||||
} else if (index === deckColumn) {
|
||||
return columnOption(tr.decksDeck(), true, index);
|
||||
} else if (index === tagsColumn) {
|
||||
return columnOption(tr.editingTags(), false, index);
|
||||
} else if (label === "") {
|
||||
return columnOption(index, false, index);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue