fixed secrets pages w/ burnettk

This commit is contained in:
jasquat 2025-01-27 14:24:23 -05:00
parent 6cdc53b0e3
commit 4ec0884b6c
No known key found for this signature in database
5 changed files with 25 additions and 14 deletions

View File

@ -69,6 +69,8 @@ function SideNav({
selectedTab = 2;
} else if (location.pathname === '/newui/messages') {
selectedTab = 3;
} else if (location.pathname.startsWith('/newui/configuration')) {
selectedTab = 4;
}
const versionInfo = appVersionInfo();
@ -168,6 +170,7 @@ function SideNav({
{ text: 'START NEW PROCESS', icon: <Add /> },
{ text: 'DATA STORES' },
{ text: 'MESSAGES' },
{ text: 'CONFIGURATION' },
].map((item, index) => (
<ListItem
button
@ -182,6 +185,8 @@ function SideNav({
navigate('/newui/data-stores');
} else if (item.text === 'MESSAGES') {
navigate('/newui/messages');
} else if (item.text === 'CONFIGURATION') {
navigate('/newui/configuration');
}
}}
sx={{

View File

@ -35,7 +35,9 @@ export default function Configuration({ extensionUxElements }: OwnProps) {
useEffect(() => {
setPageTitle(['Configuration']);
let newSelectedTabIndex = 0;
if (location.pathname.match(/^\/configuration\/authentications\b/)) {
if (
location.pathname.match(/^\/(newui\/)?configuration\/authentications\b/)
) {
newSelectedTabIndex = 1;
}
setSelectedTabIndex(newSelectedTabIndex);
@ -45,7 +47,7 @@ export default function Configuration({ extensionUxElements }: OwnProps) {
uxElement: UiSchemaUxElement,
uxElementIndex: number,
) => {
const navItemPage = `/configuration/extension${uxElement.page}`;
const navItemPage = `/newui/configuration/extension${uxElement.page}`;
let pagesToCheck = [uxElement.page];
if (
@ -56,7 +58,7 @@ export default function Configuration({ extensionUxElements }: OwnProps) {
}
pagesToCheck.forEach((pageToCheck: string) => {
const pageToCheckNavItem = `/configuration/extension${pageToCheck}`;
const pageToCheckNavItem = `/newui/configuration/extension${pageToCheck}`;
if (pageToCheckNavItem === location.pathname) {
setSelectedTabIndex(uxElementIndex + 2);
}
@ -82,13 +84,13 @@ export default function Configuration({ extensionUxElements }: OwnProps) {
<Can I="GET" a={targetUris.secretListPath} ability={ability}>
<Tab
label="Secrets"
onClick={() => navigate('/configuration/secrets')}
onClick={() => navigate('/newui/configuration/secrets')}
/>
</Can>
<Can I="GET" a={targetUris.authenticationListPath} ability={ability}>
<Tab
label="Authentications"
onClick={() => navigate('/configuration/authentications')}
onClick={() => navigate('/newui/configuration/authentications')}
/>
</Can>
<ExtensionUxElementForDisplay

View File

@ -44,7 +44,7 @@ export default function SecretList() {
!ability.can('GET', targetUris.secretListPath) &&
ability.can('GET', targetUris.authenticationListPath)
) {
navigate('/configuration/authentications');
navigate('/newui/configuration/authentications');
} else {
const { page, perPage } = getPageInfoFromSearchParams(searchParams);
HttpService.makeCallToBackend({
@ -79,12 +79,12 @@ export default function SecretList() {
return (
<TableRow key={(row as any).key}>
<TableCell>
<Link to={`/configuration/secrets/${(row as any).key}`}>
<Link to={`/newui/configuration/secrets/${(row as any).key}`}>
{(row as any).id}
</Link>
</TableCell>
<TableCell>
<Link to={`/configuration/secrets/${(row as any).key}`}>
<Link to={`/newui/configuration/secrets/${(row as any).key}`}>
{(row as any).key}
</Link>
</TableCell>
@ -135,7 +135,7 @@ export default function SecretList() {
<div>
<h1>Secrets</h1>
{SecretsDisplayArea()}
<Button variant="contained" href="/configuration/secrets/new">
<Button variant="contained" href="/newui/configuration/secrets/new">
Add a secret
</Button>
</div>

View File

@ -11,11 +11,11 @@ export default function SecretNew() {
const navigate = useNavigate();
const navigateToSecret = (_result: any) => {
navigate(`/configuration/secrets/${key}`);
navigate(`/newui/configuration/secrets/${key}`);
};
const navigateToSecrets = () => {
navigate(`/configuration/secrets`);
navigate(`/newui/configuration/secrets`);
};
const addSecret = (event: any) => {
@ -59,7 +59,11 @@ export default function SecretNew() {
label="Key*"
value={key}
error={keyIsInvalid}
helperText={keyIsInvalid ? "The key must be alphanumeric characters and underscores" : ""}
helperText={
keyIsInvalid
? 'The key must be alphanumeric characters and underscores'
: ''
}
onChange={(e: any) => setKey(e.target.value)}
fullWidth
/>
@ -68,7 +72,7 @@ export default function SecretNew() {
label="Value*"
value={value}
error={valueIsInvalid}
helperText={valueIsInvalid ? "The value must be set" : ""}
helperText={valueIsInvalid ? 'The value must be set' : ''}
onChange={(e: any) => {
setValue(e.target.value);
}}

View File

@ -68,7 +68,7 @@ export default function SecretShow() {
};
const navigateToSecrets = (_result: any) => {
navigate(`/configuration/secrets`);
navigate(`/newui/configuration/secrets`);
};
const deleteSecret = () => {