added configuration nav item to help reduce nav items w/ burnettk
This commit is contained in:
parent
b66e42d2b6
commit
606c61efa2
|
@ -1597,7 +1597,7 @@ def add_secret(body: Dict) -> Response:
|
|||
|
||||
def update_secret(key: str, body: dict) -> Response:
|
||||
"""Update secret."""
|
||||
SecretService().update_secret(key, body["value"], body["user_id"])
|
||||
SecretService().update_secret(key, body["value"], g.user.id)
|
||||
return Response(json.dumps({"ok": True}), status=200, mimetype="application/json")
|
||||
|
||||
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
import React from 'react';
|
||||
import HttpService from '../services/HttpService';
|
||||
import { modifyProcessModelPath } from '../helpers';
|
||||
|
||||
type Props = {
|
||||
processGroupId: string;
|
||||
processModelId: string;
|
||||
onUploadedCallback?: (..._args: any[]) => any;
|
||||
};
|
||||
|
||||
export default class FileInput extends React.Component<Props> {
|
||||
fileInput: any;
|
||||
|
||||
processGroupId: any;
|
||||
|
||||
processModelId: any;
|
||||
|
||||
onUploadedCallback: any;
|
||||
|
||||
constructor({ processGroupId, processModelId, onUploadedCallback }: Props) {
|
||||
super({ processGroupId, processModelId, onUploadedCallback });
|
||||
this.handleSubmit = this.handleSubmit.bind(this);
|
||||
this.fileInput = React.createRef();
|
||||
this.processGroupId = processGroupId;
|
||||
this.processModelId = processModelId;
|
||||
this.onUploadedCallback = onUploadedCallback;
|
||||
}
|
||||
|
||||
handleSubmit(event: any) {
|
||||
event.preventDefault();
|
||||
const modifiedProcessModelId = modifyProcessModelPath(
|
||||
`${this.processGroupId}/${this.processModelId}`
|
||||
);
|
||||
const url = `/process-models/${modifiedProcessModelId}/files`;
|
||||
const formData = new FormData();
|
||||
formData.append('file', this.fileInput.current.files[0]);
|
||||
formData.append('fileName', this.fileInput.current.files[0].name);
|
||||
HttpService.makeCallToBackend({
|
||||
path: url,
|
||||
successCallback: this.onUploadedCallback,
|
||||
httpMethod: 'POST',
|
||||
postBody: formData,
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<form onSubmit={this.handleSubmit}>
|
||||
<label>
|
||||
Upload file:
|
||||
<input type="file" ref={this.fileInput} />
|
||||
</label>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
}
|
|
@ -44,10 +44,8 @@ export default function NavigationBar() {
|
|||
newActiveKey = '/admin/process-instances/reports';
|
||||
} else if (location.pathname.match(/^\/admin\/process-instances\b/)) {
|
||||
newActiveKey = '/admin/process-instances';
|
||||
} else if (location.pathname.match(/^\/admin\/secrets\b/)) {
|
||||
newActiveKey = '/admin/secrets';
|
||||
} else if (location.pathname.match(/^\/admin\/authentications\b/)) {
|
||||
newActiveKey = '/admin/authentications';
|
||||
} else if (location.pathname.match(/^\/admin\/configuration\b/)) {
|
||||
newActiveKey = '/admin/configuration';
|
||||
} else if (location.pathname === '/') {
|
||||
newActiveKey = '/';
|
||||
} else if (location.pathname.match(/^\/tasks\b/)) {
|
||||
|
@ -112,16 +110,10 @@ export default function NavigationBar() {
|
|||
Messages
|
||||
</HeaderMenuItem>
|
||||
<HeaderMenuItem
|
||||
href="/admin/secrets"
|
||||
isCurrentPage={isActivePage('/admin/secrets')}
|
||||
href="/admin/configuration"
|
||||
isCurrentPage={isActivePage('/admin/configuration')}
|
||||
>
|
||||
Secrets
|
||||
</HeaderMenuItem>
|
||||
<HeaderMenuItem
|
||||
href="/admin/authentications"
|
||||
isCurrentPage={isActivePage('/admin/authentications')}
|
||||
>
|
||||
Authentications
|
||||
Configuration
|
||||
</HeaderMenuItem>
|
||||
<HeaderMenuItem
|
||||
href="/admin/process-instances/reports"
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
import Nav from 'react-bootstrap/Nav';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
export default function SubNavigation() {
|
||||
const location = useLocation();
|
||||
const [activeKey, setActiveKey] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
let newActiveKey = '/admin/process-groups';
|
||||
if (location.pathname.match(/^\/admin\/messages\b/)) {
|
||||
newActiveKey = '/admin/messages';
|
||||
} else if (
|
||||
location.pathname.match(/^\/admin\/process-instances\/reports\b/)
|
||||
) {
|
||||
newActiveKey = '/admin/process-instances/reports';
|
||||
} else if (location.pathname.match(/^\/admin\/process-instances\b/)) {
|
||||
newActiveKey = '/admin/process-instances';
|
||||
} else if (location.pathname.match(/^\/admin\/secrets\b/)) {
|
||||
newActiveKey = '/admin/secrets';
|
||||
} else if (location.pathname.match(/^\/admin\/authentications\b/)) {
|
||||
newActiveKey = '/admin/authentications';
|
||||
} else if (location.pathname === '/') {
|
||||
newActiveKey = '/';
|
||||
} else if (location.pathname.match(/^\/tasks\b/)) {
|
||||
newActiveKey = '/';
|
||||
}
|
||||
setActiveKey(newActiveKey);
|
||||
}, [location]);
|
||||
|
||||
if (activeKey) {
|
||||
return (
|
||||
<Nav variant="tabs" activeKey={activeKey}>
|
||||
<Nav.Item data-qa="nav-home">
|
||||
<Nav.Link href="/">Home</Nav.Link>
|
||||
</Nav.Item>
|
||||
<Nav.Item>
|
||||
<Nav.Link href="/admin/process-groups">Process Models</Nav.Link>
|
||||
</Nav.Item>
|
||||
<Nav.Item>
|
||||
<Nav.Link href="/admin/process-instances">Process Instances</Nav.Link>
|
||||
</Nav.Item>
|
||||
<Nav.Item>
|
||||
<Nav.Link href="/admin/messages">Messages</Nav.Link>
|
||||
</Nav.Item>
|
||||
<Nav.Item>
|
||||
<Nav.Link href="/admin/secrets">Secrets</Nav.Link>
|
||||
</Nav.Item>
|
||||
<Nav.Item>
|
||||
<Nav.Link href="/admin/authentications">Authentications</Nav.Link>
|
||||
</Nav.Item>
|
||||
<Nav.Item>
|
||||
<Nav.Link href="/admin/process-instances/reports">Reports</Nav.Link>
|
||||
</Nav.Item>
|
||||
</Nav>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
|
@ -24,6 +24,7 @@ import SecretList from './SecretList';
|
|||
import SecretNew from './SecretNew';
|
||||
import SecretShow from './SecretShow';
|
||||
import AuthenticationList from './AuthenticationList';
|
||||
import Configuration from './Configuration';
|
||||
|
||||
export default function AdminRoutes() {
|
||||
const location = useLocation();
|
||||
|
@ -110,10 +111,7 @@ export default function AdminRoutes() {
|
|||
/>
|
||||
<Route path="process-instances" element={<ProcessInstanceList />} />
|
||||
<Route path="messages" element={<MessageInstanceList />} />
|
||||
<Route path="secrets" element={<SecretList />} />
|
||||
<Route path="secrets/new" element={<SecretNew />} />
|
||||
<Route path="secrets/:key" element={<SecretShow />} />
|
||||
<Route path="authentications" element={<AuthenticationList />} />
|
||||
<Route path="/configuration/*" element={<Configuration />} />
|
||||
</Routes>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
import { useContext, useEffect, useState } from 'react';
|
||||
import { Route, Routes, useLocation, useNavigate } from 'react-router-dom';
|
||||
// @ts-ignore
|
||||
import { Tabs, TabList, Tab } from '@carbon/react';
|
||||
import TaskShow from './TaskShow';
|
||||
import ErrorContext from '../contexts/ErrorContext';
|
||||
import MyTasks from './MyTasks';
|
||||
import GroupedTasks from './GroupedTasks';
|
||||
import CompletedInstances from './CompletedInstances';
|
||||
import SecretList from './SecretList';
|
||||
import SecretNew from './SecretNew';
|
||||
import SecretShow from './SecretShow';
|
||||
import AuthenticationList from './AuthenticationList';
|
||||
|
||||
export default function Configuration() {
|
||||
const location = useLocation();
|
||||
const setErrorMessage = (useContext as any)(ErrorContext)[1];
|
||||
const [selectedTabIndex, setSelectedTabIndex] = useState<number>(0);
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
setErrorMessage(null);
|
||||
let newSelectedTabIndex = 0;
|
||||
if (location.pathname.match(/^\/admin\/configuration\/authentications\b/)) {
|
||||
newSelectedTabIndex = 1;
|
||||
}
|
||||
setSelectedTabIndex(newSelectedTabIndex);
|
||||
}, [location, setErrorMessage]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tabs selectedIndex={selectedTabIndex}>
|
||||
<TabList aria-label="List of tabs">
|
||||
<Tab onClick={() => navigate('/admin/configuration/secrets')}>
|
||||
Secrets
|
||||
</Tab>
|
||||
<Tab onClick={() => navigate('/admin/configuration/authentications')}>
|
||||
Authentications
|
||||
</Tab>
|
||||
</TabList>
|
||||
</Tabs>
|
||||
<br />
|
||||
<Routes>
|
||||
<Route path="/" element={<SecretList />} />
|
||||
<Route path="secrets" element={<SecretList />} />
|
||||
<Route path="secrets/new" element={<SecretNew />} />
|
||||
<Route path="secrets/:key" element={<SecretShow />} />
|
||||
<Route path="authentications" element={<AuthenticationList />} />
|
||||
</Routes>
|
||||
</>
|
||||
);
|
||||
}
|
|
@ -122,7 +122,7 @@ export default function MyTasks() {
|
|||
});
|
||||
return (
|
||||
<>
|
||||
<h1>Processes I can start</h1>
|
||||
<h1>Recently viewed process models</h1>
|
||||
<Table striped bordered>
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -169,6 +169,7 @@ export default function MyTasks() {
|
|||
return (
|
||||
<>
|
||||
{tasksWaitingForMe}
|
||||
<br />
|
||||
{relevantProcessModelSection}
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -30,7 +30,7 @@ import {
|
|||
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
|
||||
import HttpService from '../services/HttpService';
|
||||
import ErrorContext from '../contexts/ErrorContext';
|
||||
import { modifyProcessModelPath, unModifyProcessModelPath } from '../helpers';
|
||||
import { modifyProcessModelPath } from '../helpers';
|
||||
import { ProcessFile, ProcessModel, RecentProcessModel } from '../interfaces';
|
||||
import ButtonWithConfirmation from '../components/ButtonWithConfirmation';
|
||||
import ProcessInstanceListTable from '../components/ProcessInstanceListTable';
|
||||
|
@ -353,27 +353,6 @@ export default function ProcessModelShow() {
|
|||
);
|
||||
};
|
||||
|
||||
const processInstancesUl = () => {
|
||||
const unmodifiedProcessModelId: String = unModifyProcessModelPath(
|
||||
`${params.process_model_id}`
|
||||
);
|
||||
if (!processModel) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<ul>
|
||||
<li>
|
||||
<Link
|
||||
to={`/admin/process-instances?process_model_identifier=${unmodifiedProcessModelId}`}
|
||||
data-qa="process-instance-list-link"
|
||||
>
|
||||
List
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
);
|
||||
};
|
||||
|
||||
const handleFileUploadCancel = () => {
|
||||
setShowFileUploadModal(false);
|
||||
};
|
||||
|
|
|
@ -42,12 +42,12 @@ export default function SecretList() {
|
|||
return (
|
||||
<tr key={(row as any).key}>
|
||||
<td>
|
||||
<Link to={`/admin/secrets/${(row as any).key}`}>
|
||||
<Link to={`/admin/configuration/secrets/${(row as any).key}`}>
|
||||
{(row as any).id}
|
||||
</Link>
|
||||
</td>
|
||||
<td>
|
||||
<Link to={`/admin/secrets/${(row as any).key}`}>
|
||||
<Link to={`/admin/configuration/secrets/${(row as any).key}`}>
|
||||
{(row as any).key}
|
||||
</Link>
|
||||
</td>
|
||||
|
@ -96,7 +96,7 @@ export default function SecretList() {
|
|||
<div>
|
||||
<h1>Secrets</h1>
|
||||
{SecretsDisplayArea()}
|
||||
<Button href="/admin/secrets/new">Add a secret</Button>
|
||||
<Button href="/admin/configuration/secrets/new">Add a secret</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@ export default function SecretNew() {
|
|||
const navigate = useNavigate();
|
||||
|
||||
const navigateToSecret = (_result: any) => {
|
||||
navigate(`/admin/secrets/${key}`);
|
||||
navigate(`/admin/configuration/secrets/${key}`);
|
||||
};
|
||||
|
||||
const navigateToSecrets = () => {
|
||||
navigate(`/admin/secrets`);
|
||||
navigate(`/admin/configuration/secrets`);
|
||||
};
|
||||
|
||||
const changeSpacesToDash = (someString: string) => {
|
||||
|
|
|
@ -26,10 +26,6 @@ export default function SecretShow() {
|
|||
}
|
||||
};
|
||||
|
||||
// const reloadSecret = (_result: any) => {
|
||||
// window.location.reload();
|
||||
// };
|
||||
|
||||
const updateSecretValue = () => {
|
||||
if (secret && secretValue) {
|
||||
secret.value = secretValue;
|
||||
|
@ -48,7 +44,7 @@ export default function SecretShow() {
|
|||
};
|
||||
|
||||
const navigateToSecrets = (_result: any) => {
|
||||
navigate(`/admin/secrets`);
|
||||
navigate(`/admin/configuration/secrets`);
|
||||
};
|
||||
|
||||
const deleteSecret = () => {
|
||||
|
|
Loading…
Reference in New Issue