Skip to content

Commit

Permalink
Fix a bug with undefined parsing and update breadcrumbs for edit page…
Browse files Browse the repository at this point in the history
…s, fixes test

Signed-off-by: Derek Ho <dxho@amazon.com>
  • Loading branch information
derek-ho committed Aug 29, 2024
1 parent 6319814 commit 9949cb6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 23 deletions.
7 changes: 4 additions & 3 deletions public/apps/configuration/app-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ export const allNavPanelUrls = (multitenancyEnabled: boolean) =>
...(multitenancyEnabled ? [buildUrl(ResourceType.tenantsConfigureTab)] : []),
]);

function decodeParams(params: { [k: string]: string }): any {
return Object.keys(params).reduce((obj: { [k: string]: string }, key: string) => {
obj[key] = decodeURIComponent(params[key]);
function decodeParams(params: { [k: string]: string | undefined }): any {
return Object.keys(params).reduce((obj: { [k: string]: string | undefined }, key: string) => {
const value = params[key];
obj[key] = value !== undefined ? decodeURIComponent(value) : undefined;
return obj;
}, {});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,20 +273,22 @@ exports[`Audit logs render when AuditLoggingSettings.enabled is true 1`] = `
}
}
fallBackComponent={
<EuiPageHeader>
<EuiText
size="s"
>
<h1>
Audit logging
</h1>
</EuiText>
</EuiPageHeader>
<React.Fragment>
<EuiPageHeader>
<EuiText
size="s"
>
<h1>
Audit logging
</h1>
</EuiText>
</EuiPageHeader>
<EuiSpacer />
</React.Fragment>
}
navigation={Object {}}
resourceType="auditLogging"
/>
<EuiSpacer />
<EuiPanel>
<EuiForm>
<EuiDescribedFormGroup
Expand Down Expand Up @@ -705,20 +707,22 @@ exports[`Audit logs should load access error component 1`] = `
}
}
fallBackComponent={
<EuiPageHeader>
<EuiText
size="s"
>
<h1>
Audit logging
</h1>
</EuiText>
</EuiPageHeader>
<React.Fragment>
<EuiPageHeader>
<EuiText
size="s"
>
<h1>
Audit logging
</h1>
</EuiText>
</EuiPageHeader>
<EuiSpacer />
</React.Fragment>
}
navigation={Object {}}
resourceType="auditLogging"
/>
<EuiSpacer />
<AccessErrorComponent
loading={false}
message="You do not have permissions to configure audit logging settings"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export function InternalUserEdit(props: InternalUserEditDeps) {
}
resourceType={ResourceType.users}
subAction={TITLE_TEXT_DICT[props.action]}
pageTitle={props.sourceUserName}
/>
<PanelWithHeader headerText="Credentials">
<EuiForm>
Expand Down
1 change: 1 addition & 0 deletions public/apps/configuration/panels/role-edit/role-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ export function RoleEdit(props: RoleEditDeps) {
descriptionControls={descriptionData}
resourceType={ResourceType.roles}
subAction={TITLE_TEXT_DICT[props.action]}
pageTitle={props.sourceRoleName}
/>
<PanelWithHeader headerText="Name">
<EuiForm>
Expand Down

0 comments on commit 9949cb6

Please sign in to comment.