fix a few secrets issues
This commit is contained in:
parent
fb6bb03716
commit
ce3993b11c
|
@ -0,0 +1,5 @@
|
|||
export interface Secret {
|
||||
key: string;
|
||||
value: string;
|
||||
username: string;
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
import { Link, useSearchParams } from 'react-router-dom';
|
||||
import { Button, Table } from 'react-bootstrap';
|
||||
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
|
||||
import PaginationForTable from '../components/PaginationForTable';
|
||||
import HttpService from '../services/HttpService';
|
||||
import { getPageInfoFromSearchParams } from '../helpers';
|
||||
|
@ -66,7 +65,7 @@ export default function SecretList() {
|
|||
/>
|
||||
);
|
||||
} else {
|
||||
displayText = <p>No Groups To Display</p>;
|
||||
displayText = <p>No Secrets to Display</p>;
|
||||
}
|
||||
return displayText;
|
||||
};
|
||||
|
@ -74,7 +73,6 @@ export default function SecretList() {
|
|||
if (pagination) {
|
||||
return (
|
||||
<main style={{ padding: '1rem 0' }}>
|
||||
<ProcessBreadcrumb />
|
||||
<Button href="/admin/secrets/new">Add a secret</Button>
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -2,7 +2,6 @@ import { useState } from 'react';
|
|||
import { useNavigate } from 'react-router-dom';
|
||||
import Button from 'react-bootstrap/Button';
|
||||
import Form from 'react-bootstrap/Form';
|
||||
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
|
||||
import HttpService from '../services/HttpService';
|
||||
|
||||
export default function SecretNew() {
|
||||
|
@ -29,7 +28,6 @@ export default function SecretNew() {
|
|||
|
||||
return (
|
||||
<main style={{ padding: '1rem 0' }}>
|
||||
<ProcessBreadcrumb />
|
||||
<h2>Add Secret</h2>
|
||||
<Form onSubmit={addSecret}>
|
||||
<Form.Group className="mb-3" controlId="formDisplayName">
|
||||
|
|
|
@ -2,13 +2,14 @@ import { useEffect, useState } from 'react';
|
|||
import { useParams, useNavigate } from 'react-router-dom';
|
||||
import { Stack, Table } from 'react-bootstrap';
|
||||
import HttpService from '../services/HttpService';
|
||||
import { Secret } from '../interfaces';
|
||||
import ButtonWithConfirmation from '../components/ButtonWithConfirmation';
|
||||
|
||||
export default function SecretShow() {
|
||||
const navigate = useNavigate();
|
||||
const params = useParams();
|
||||
|
||||
const [secret, setSecret] = useState(null);
|
||||
const [secret, setSecret] = useState<Secret | null>(null);
|
||||
|
||||
const navigateToSecrets = (_result: any) => {
|
||||
navigate(`/admin/secrets`);
|
||||
|
@ -22,15 +23,17 @@ export default function SecretShow() {
|
|||
}, [params]);
|
||||
|
||||
const deleteSecret = () => {
|
||||
if (secret === null) {
|
||||
return;
|
||||
}
|
||||
HttpService.makeCallToBackend({
|
||||
path: `/process-models/${params.process_group_id}/${params.process_model_id}/process-instances/${params.process_instance_id}`,
|
||||
path: `/secrets/${secret.key}`,
|
||||
successCallback: navigateToSecrets,
|
||||
httpMethod: 'DELETE',
|
||||
});
|
||||
};
|
||||
|
||||
if (secret) {
|
||||
console.log('secret: ', secret);
|
||||
const secretToUse = secret as any;
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue