Added select workaround for all things team🏠

ref #98
This commit is contained in:
2021-03-18 15:47:16 +01:00
parent 0386d4e88a
commit 5ad42d6ca7
2 changed files with 30 additions and 24 deletions

View File

@@ -35,7 +35,9 @@
$: parentGroup = undefined;
$: orgs = [];
RunnerOrganizationService.runnerOrganizationControllerGetAll().then((val) => {
orgs = val;
orgs = val.map((r) => {
return { label: r.name, value: r };
});
});
function submit() {
if (processed_last_submit === true) {
@@ -148,24 +150,18 @@
class="block text-sm font-medium text-gray-700">{$_('organization')}</label>
<Select
containerClasses="rounded-l-md mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2"
getSelectionLabel={(option) => {
return option.name;
}}
getOptionLabel={(option) => {
return option.name;
}}
itemFilter={(label, filterText, option) => label
.toLowerCase()
.includes(
filterText.toLowerCase()
) || option.id
) || option.value.id
.toString()
.startsWith(filterText.toLowerCase())}
items={orgs}
showChevron={true}
placeholder={$_('search-for-an-organization-by-name-or-id')}
noOptionsMessage={$_('no-organizations-found')}
on:select={(selectedValue) => (parentGroup = selectedValue.detail.id)}
on:select={(selectedValue) => (parentGroup = selectedValue.detail.value.id)}
on:clear={() => (parentGroup = null)} />
{#if !parentGroup}
<span