Skip to content

Commit

Permalink
Merge pull request #248 from UnityFoundation-io/bugfix/selected-group…
Browse files Browse the repository at this point in the history
…-in-breadcrumb

Bugfix/Selected Group is not shown on initial selection
  • Loading branch information
zsbrown97 authored Apr 24, 2024
2 parents dabfe2a + 68c1ae4 commit 0201821
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions frontend/src/routes/groups/[group_id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@
import ServiceListItem from '$lib/components/ServiceDefinitionEditor/ServiceListItem.svelte';
import DragAndDrop from '$lib/components/DragAndDrop.svelte';
interface Crumb {
label: string;
href: string;
let groupId = Number($page.params.group_id);
let groupName = '';
async function getGroupName(groupId: number) {
const groups = await libre311.getGroupList();
const group = groups.find((group) => group.id === groupId);
if (group) groupName = group.name;
}
const crumbs: Crumb[] = [
{ label: 'Groups', href: '/groups' },
$: crumbs = [
{ label: `Groups: ${groupName}`, href: '/groups' },
{ label: 'Services', href: `/groups/${$page.params.group_id}` }
];
Expand All @@ -33,10 +38,10 @@
let serviceList: AsyncResult<GetServiceListResponse> = ASYNC_IN_PROGRESS;
let isDropDownVisable = false;
let groupId = Number($page.params.group_id);
let newServiceName: FormInputValue<string> = createInput();
function fetchServiceList() {
getGroupName(groupId);
libre311
.getServiceList()
.then((res) => {
Expand Down

0 comments on commit 0201821

Please sign in to comment.