Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
MiquelAdell committed Nov 26, 2024
2 parents 626facc + ac1c4af commit 50f5a86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bulk-load",
"description": "Bulk importing made easy",
"version": "3.24.2",
"version": "3.24.3",
"license": "GPL-3.0",
"author": "EyeSeeTea team",
"homepage": ".",
Expand Down
14 changes: 8 additions & 6 deletions src/webapp/components/template-selector/TemplateSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const TemplateSelector = ({
};

const onTemplateChange = ({ value }: SelectOption) => {
const [dataFormId, templateId] = value.split("-");
const [dataFormId, templateId] = value.split(/-(.+)/).map(str => str.trim());

if (dataSource) {
const {
Expand Down Expand Up @@ -429,7 +429,7 @@ export const TemplateSelector = ({
/>
)}

{themeOptions.length > 0 && state.templateType !== "custom" && (
{themeOptions.length > 0 && (
<div className={classes.row}>
<div className={classes.select}>
<Select
Expand Down Expand Up @@ -600,10 +600,12 @@ function modelToSelectOption<T extends { id: string; name: string }>(array: T[])
}

function dataFormsToSelectOptions(forms: DataFormTemplate[]) {
return forms.map(form => ({
value: getOptionValue(form),
label: form.name,
}));
return forms
.map(form => ({
value: getOptionValue(form),
label: form.name,
}))
.sort((formA, formB) => formA.label.localeCompare(formB.label));
}

function getOptionValue<T extends { id: Id; templateId: Id }>(form: T) {
Expand Down

0 comments on commit 50f5a86

Please sign in to comment.