mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-02-23 22:58:09 +00:00
fixed secrets pages w/ burnettk
This commit is contained in:
parent
6cdc53b0e3
commit
4ec0884b6c
@ -69,6 +69,8 @@ function SideNav({
|
|||||||
selectedTab = 2;
|
selectedTab = 2;
|
||||||
} else if (location.pathname === '/newui/messages') {
|
} else if (location.pathname === '/newui/messages') {
|
||||||
selectedTab = 3;
|
selectedTab = 3;
|
||||||
|
} else if (location.pathname.startsWith('/newui/configuration')) {
|
||||||
|
selectedTab = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
const versionInfo = appVersionInfo();
|
const versionInfo = appVersionInfo();
|
||||||
@ -168,6 +170,7 @@ function SideNav({
|
|||||||
{ text: 'START NEW PROCESS', icon: <Add /> },
|
{ text: 'START NEW PROCESS', icon: <Add /> },
|
||||||
{ text: 'DATA STORES' },
|
{ text: 'DATA STORES' },
|
||||||
{ text: 'MESSAGES' },
|
{ text: 'MESSAGES' },
|
||||||
|
{ text: 'CONFIGURATION' },
|
||||||
].map((item, index) => (
|
].map((item, index) => (
|
||||||
<ListItem
|
<ListItem
|
||||||
button
|
button
|
||||||
@ -182,6 +185,8 @@ function SideNav({
|
|||||||
navigate('/newui/data-stores');
|
navigate('/newui/data-stores');
|
||||||
} else if (item.text === 'MESSAGES') {
|
} else if (item.text === 'MESSAGES') {
|
||||||
navigate('/newui/messages');
|
navigate('/newui/messages');
|
||||||
|
} else if (item.text === 'CONFIGURATION') {
|
||||||
|
navigate('/newui/configuration');
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
|
@ -35,7 +35,9 @@ export default function Configuration({ extensionUxElements }: OwnProps) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setPageTitle(['Configuration']);
|
setPageTitle(['Configuration']);
|
||||||
let newSelectedTabIndex = 0;
|
let newSelectedTabIndex = 0;
|
||||||
if (location.pathname.match(/^\/configuration\/authentications\b/)) {
|
if (
|
||||||
|
location.pathname.match(/^\/(newui\/)?configuration\/authentications\b/)
|
||||||
|
) {
|
||||||
newSelectedTabIndex = 1;
|
newSelectedTabIndex = 1;
|
||||||
}
|
}
|
||||||
setSelectedTabIndex(newSelectedTabIndex);
|
setSelectedTabIndex(newSelectedTabIndex);
|
||||||
@ -45,7 +47,7 @@ export default function Configuration({ extensionUxElements }: OwnProps) {
|
|||||||
uxElement: UiSchemaUxElement,
|
uxElement: UiSchemaUxElement,
|
||||||
uxElementIndex: number,
|
uxElementIndex: number,
|
||||||
) => {
|
) => {
|
||||||
const navItemPage = `/configuration/extension${uxElement.page}`;
|
const navItemPage = `/newui/configuration/extension${uxElement.page}`;
|
||||||
|
|
||||||
let pagesToCheck = [uxElement.page];
|
let pagesToCheck = [uxElement.page];
|
||||||
if (
|
if (
|
||||||
@ -56,7 +58,7 @@ export default function Configuration({ extensionUxElements }: OwnProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pagesToCheck.forEach((pageToCheck: string) => {
|
pagesToCheck.forEach((pageToCheck: string) => {
|
||||||
const pageToCheckNavItem = `/configuration/extension${pageToCheck}`;
|
const pageToCheckNavItem = `/newui/configuration/extension${pageToCheck}`;
|
||||||
if (pageToCheckNavItem === location.pathname) {
|
if (pageToCheckNavItem === location.pathname) {
|
||||||
setSelectedTabIndex(uxElementIndex + 2);
|
setSelectedTabIndex(uxElementIndex + 2);
|
||||||
}
|
}
|
||||||
@ -82,13 +84,13 @@ export default function Configuration({ extensionUxElements }: OwnProps) {
|
|||||||
<Can I="GET" a={targetUris.secretListPath} ability={ability}>
|
<Can I="GET" a={targetUris.secretListPath} ability={ability}>
|
||||||
<Tab
|
<Tab
|
||||||
label="Secrets"
|
label="Secrets"
|
||||||
onClick={() => navigate('/configuration/secrets')}
|
onClick={() => navigate('/newui/configuration/secrets')}
|
||||||
/>
|
/>
|
||||||
</Can>
|
</Can>
|
||||||
<Can I="GET" a={targetUris.authenticationListPath} ability={ability}>
|
<Can I="GET" a={targetUris.authenticationListPath} ability={ability}>
|
||||||
<Tab
|
<Tab
|
||||||
label="Authentications"
|
label="Authentications"
|
||||||
onClick={() => navigate('/configuration/authentications')}
|
onClick={() => navigate('/newui/configuration/authentications')}
|
||||||
/>
|
/>
|
||||||
</Can>
|
</Can>
|
||||||
<ExtensionUxElementForDisplay
|
<ExtensionUxElementForDisplay
|
||||||
|
@ -44,7 +44,7 @@ export default function SecretList() {
|
|||||||
!ability.can('GET', targetUris.secretListPath) &&
|
!ability.can('GET', targetUris.secretListPath) &&
|
||||||
ability.can('GET', targetUris.authenticationListPath)
|
ability.can('GET', targetUris.authenticationListPath)
|
||||||
) {
|
) {
|
||||||
navigate('/configuration/authentications');
|
navigate('/newui/configuration/authentications');
|
||||||
} else {
|
} else {
|
||||||
const { page, perPage } = getPageInfoFromSearchParams(searchParams);
|
const { page, perPage } = getPageInfoFromSearchParams(searchParams);
|
||||||
HttpService.makeCallToBackend({
|
HttpService.makeCallToBackend({
|
||||||
@ -79,12 +79,12 @@ export default function SecretList() {
|
|||||||
return (
|
return (
|
||||||
<TableRow key={(row as any).key}>
|
<TableRow key={(row as any).key}>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Link to={`/configuration/secrets/${(row as any).key}`}>
|
<Link to={`/newui/configuration/secrets/${(row as any).key}`}>
|
||||||
{(row as any).id}
|
{(row as any).id}
|
||||||
</Link>
|
</Link>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Link to={`/configuration/secrets/${(row as any).key}`}>
|
<Link to={`/newui/configuration/secrets/${(row as any).key}`}>
|
||||||
{(row as any).key}
|
{(row as any).key}
|
||||||
</Link>
|
</Link>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@ -135,7 +135,7 @@ export default function SecretList() {
|
|||||||
<div>
|
<div>
|
||||||
<h1>Secrets</h1>
|
<h1>Secrets</h1>
|
||||||
{SecretsDisplayArea()}
|
{SecretsDisplayArea()}
|
||||||
<Button variant="contained" href="/configuration/secrets/new">
|
<Button variant="contained" href="/newui/configuration/secrets/new">
|
||||||
Add a secret
|
Add a secret
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,11 +11,11 @@ export default function SecretNew() {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const navigateToSecret = (_result: any) => {
|
const navigateToSecret = (_result: any) => {
|
||||||
navigate(`/configuration/secrets/${key}`);
|
navigate(`/newui/configuration/secrets/${key}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const navigateToSecrets = () => {
|
const navigateToSecrets = () => {
|
||||||
navigate(`/configuration/secrets`);
|
navigate(`/newui/configuration/secrets`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const addSecret = (event: any) => {
|
const addSecret = (event: any) => {
|
||||||
@ -59,7 +59,11 @@ export default function SecretNew() {
|
|||||||
label="Key*"
|
label="Key*"
|
||||||
value={key}
|
value={key}
|
||||||
error={keyIsInvalid}
|
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)}
|
onChange={(e: any) => setKey(e.target.value)}
|
||||||
fullWidth
|
fullWidth
|
||||||
/>
|
/>
|
||||||
@ -68,7 +72,7 @@ export default function SecretNew() {
|
|||||||
label="Value*"
|
label="Value*"
|
||||||
value={value}
|
value={value}
|
||||||
error={valueIsInvalid}
|
error={valueIsInvalid}
|
||||||
helperText={valueIsInvalid ? "The value must be set" : ""}
|
helperText={valueIsInvalid ? 'The value must be set' : ''}
|
||||||
onChange={(e: any) => {
|
onChange={(e: any) => {
|
||||||
setValue(e.target.value);
|
setValue(e.target.value);
|
||||||
}}
|
}}
|
||||||
|
@ -68,7 +68,7 @@ export default function SecretShow() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const navigateToSecrets = (_result: any) => {
|
const navigateToSecrets = (_result: any) => {
|
||||||
navigate(`/configuration/secrets`);
|
navigate(`/newui/configuration/secrets`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteSecret = () => {
|
const deleteSecret = () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user