Fix checkbox state not updating + ran prettier
Forgot a comma and to load back the wikilink with new properties
This commit is contained in:
parent
95035e5eac
commit
f8b6ae8761
6 changed files with 18 additions and 16 deletions
|
|
@ -584,7 +584,9 @@ export default class MediaDbPlugin extends Plugin {
|
||||||
newProperties.push(defaultProperty);
|
newProperties.push(defaultProperty);
|
||||||
} else {
|
} else {
|
||||||
// newProperty is just an object and take locked status from default property
|
// newProperty is just an object and take locked status from default property
|
||||||
newProperties.push(new PropertyMapping(newProperty.property, newProperty.newProperty, newProperty.mapping, defaultProperty.locked));
|
newProperties.push(
|
||||||
|
new PropertyMapping(newProperty.property, newProperty.newProperty, newProperty.mapping, defaultProperty.locked, newProperty.wikilink ?? false),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,7 @@ export class PropertyMapper {
|
||||||
if (typeof value === 'string') {
|
if (typeof value === 'string') {
|
||||||
finalValue = `[[${value}]]`;
|
finalValue = `[[${value}]]`;
|
||||||
} else if (Array.isArray(value)) {
|
} else if (Array.isArray(value)) {
|
||||||
finalValue = value.map(v =>
|
finalValue = value.map(v => (typeof v === 'string' ? `[[${v}]]` : v));
|
||||||
typeof v === 'string' ? `[[${v}]]` : v
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (propertyMapping.mapping === PropertyMappingOption.Map) {
|
if (propertyMapping.mapping === PropertyMappingOption.Map) {
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ export function getDefaultSettings(plugin: MediaDbPlugin): MediaDbPluginSettings
|
||||||
PropertyMappingOption.Default,
|
PropertyMappingOption.Default,
|
||||||
lockedPropertyMappings.contains(key),
|
lockedPropertyMappings.contains(key),
|
||||||
false, // wikilink default
|
false, // wikilink default
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ export class FileSuggest extends AbstractInputSuggest<TFile> {
|
||||||
const lowerCaseInputStr = query.toLowerCase();
|
const lowerCaseInputStr = query.toLowerCase();
|
||||||
|
|
||||||
// we do two filters because otherwise TS type inference does convert the array to TFile[]
|
// we do two filters because otherwise TS type inference does convert the array to TFile[]
|
||||||
return this.app.vault.getAllLoadedFiles()
|
return this.app.vault
|
||||||
|
.getAllLoadedFiles()
|
||||||
.filter(file => file instanceof TFile)
|
.filter(file => file instanceof TFile)
|
||||||
.filter(file => file.path.toLowerCase().contains(lowerCaseInputStr));
|
.filter(file => file.path.toLowerCase().contains(lowerCaseInputStr));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ export class FolderSuggest extends AbstractInputSuggest<TFolder> {
|
||||||
const lowerCaseInputStr = query.toLowerCase();
|
const lowerCaseInputStr = query.toLowerCase();
|
||||||
|
|
||||||
// we do two filters because otherwise TS type inference does convert the array to TFolder[]
|
// we do two filters because otherwise TS type inference does convert the array to TFolder[]
|
||||||
return this.app.vault.getAllLoadedFiles()
|
return this.app.vault
|
||||||
|
.getAllLoadedFiles()
|
||||||
.filter(file => file instanceof TFolder)
|
.filter(file => file instanceof TFolder)
|
||||||
.filter(file => file.path.toLowerCase().contains(lowerCaseInputStr));
|
.filter(file => file.path.toLowerCase().contains(lowerCaseInputStr));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue