Rename UpdateFrameworkPage -> EditFrameworkPage
Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import { CreateFrameworkPage } from "./frameworks/CreateFrameworkPage";
|
|||||||
import { FrameworkLayout } from "./frameworks/FrameworkLayout";
|
import { FrameworkLayout } from "./frameworks/FrameworkLayout";
|
||||||
import { FrameworkListPage } from "./frameworks/FrameworkListPage";
|
import { FrameworkListPage } from "./frameworks/FrameworkListPage";
|
||||||
import { FrameworkPage } from "./frameworks/FrameworkPage";
|
import { FrameworkPage } from "./frameworks/FrameworkPage";
|
||||||
import { UpdateFrameworkPage } from "./frameworks/UpdateFrameworkPage";
|
import { EditFrameworkPage } from "./frameworks/EditFrameworkPage";
|
||||||
import { ControlPage } from "./frameworks/controls/ControlPage";
|
import { ControlPage } from "./frameworks/controls/ControlPage";
|
||||||
import { EditMitigationPage } from "./mitigations/EditMitigationPage";
|
import { EditMitigationPage } from "./mitigations/EditMitigationPage";
|
||||||
import { MitigationListPage } from "./mitigations/MitigationListPage";
|
import { MitigationListPage } from "./mitigations/MitigationListPage";
|
||||||
@@ -44,7 +44,7 @@ export function OrganizationsRoutes() {
|
|||||||
<Route index element={<FrameworkPage />} />
|
<Route index element={<FrameworkPage />} />
|
||||||
<Route path="controls/:controlId" element={<ControlPage />} />
|
<Route path="controls/:controlId" element={<ControlPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="edit" element={<UpdateFrameworkPage />} />
|
<Route path="edit" element={<EditFrameworkPage />} />
|
||||||
<Route path="*" element={<NotFoundPage />} />
|
<Route path="*" element={<NotFoundPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="mitigations" element={<MitigationListPage />} />
|
<Route path="mitigations" element={<MitigationListPage />} />
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import { lazy } from "@probo/react-lazy";
|
|||||||
import { useLocation } from "react-router";
|
import { useLocation } from "react-router";
|
||||||
import { ErrorBoundaryWithLocation } from "../ErrorBoundary";
|
import { ErrorBoundaryWithLocation } from "../ErrorBoundary";
|
||||||
|
|
||||||
const UpdateFrameworkView = lazy(() => import("./UpdateFrameworkView"));
|
const EditFrameworkView = lazy(() => import("./EditFrameworkView"));
|
||||||
|
|
||||||
export function UpdateFrameworkViewSkeleton() {
|
export function EditFrameworkViewSkeleton() {
|
||||||
return (
|
return (
|
||||||
<PageTemplateSkeleton
|
<PageTemplateSkeleton
|
||||||
title="Update Framework"
|
title="Update Framework"
|
||||||
@@ -17,16 +17,13 @@ export function UpdateFrameworkViewSkeleton() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function UpdateFrameworkPage() {
|
export function EditFrameworkPage() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense
|
<Suspense key={location.pathname} fallback={<EditFrameworkViewSkeleton />}>
|
||||||
key={location.pathname}
|
|
||||||
fallback={<UpdateFrameworkViewSkeleton />}
|
|
||||||
>
|
|
||||||
<ErrorBoundaryWithLocation>
|
<ErrorBoundaryWithLocation>
|
||||||
<UpdateFrameworkView />
|
<EditFrameworkView />
|
||||||
</ErrorBoundaryWithLocation>
|
</ErrorBoundaryWithLocation>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
@@ -15,13 +15,13 @@ import { Textarea } from "@/components/ui/textarea";
|
|||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/hooks/use-toast";
|
||||||
import { HelpCircle } from "lucide-react";
|
import { HelpCircle } from "lucide-react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { UpdateFrameworkViewUpdateFrameworkMutation } from "./__generated__/UpdateFrameworkViewUpdateFrameworkMutation.graphql";
|
import { EditFrameworkViewUpdateFrameworkMutation } from "./__generated__/EditFrameworkViewUpdateFrameworkMutation.graphql";
|
||||||
import { UpdateFrameworkViewQuery as UpdateFrameworkViewQueryType } from "./__generated__/UpdateFrameworkViewQuery.graphql";
|
import { EditFrameworkViewQuery } from "./__generated__/EditFrameworkViewQuery.graphql";
|
||||||
import { PageTemplate } from "@/components/PageTemplate";
|
import { PageTemplate } from "@/components/PageTemplate";
|
||||||
import { UpdateFrameworkViewSkeleton } from "./UpdateFrameworkPage";
|
import { EditFrameworkViewSkeleton } from "./EditFrameworkPage";
|
||||||
|
|
||||||
const updateFrameworkMutation = graphql`
|
const updateFrameworkMutation = graphql`
|
||||||
mutation UpdateFrameworkViewUpdateFrameworkMutation(
|
mutation EditFrameworkViewUpdateFrameworkMutation(
|
||||||
$input: UpdateFrameworkInput!
|
$input: UpdateFrameworkInput!
|
||||||
) {
|
) {
|
||||||
updateFramework(input: $input) {
|
updateFramework(input: $input) {
|
||||||
@@ -34,8 +34,8 @@ const updateFrameworkMutation = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const updateFrameworkQuery = graphql`
|
const editFrameworkQuery = graphql`
|
||||||
query UpdateFrameworkViewQuery($frameworkId: ID!) {
|
query EditFrameworkViewQuery($frameworkId: ID!) {
|
||||||
node(id: $frameworkId) {
|
node(id: $frameworkId) {
|
||||||
... on Framework {
|
... on Framework {
|
||||||
id
|
id
|
||||||
@@ -107,15 +107,15 @@ function EditableField({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateFrameworkViewContent({
|
function EditFrameworkViewContent({
|
||||||
queryRef,
|
queryRef,
|
||||||
}: {
|
}: {
|
||||||
queryRef: PreloadedQuery<UpdateFrameworkViewQueryType>;
|
queryRef: PreloadedQuery<EditFrameworkViewQuery>;
|
||||||
}) {
|
}) {
|
||||||
const { organizationId, frameworkId } = useParams();
|
const { organizationId, frameworkId } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const data = usePreloadedQuery(updateFrameworkQuery, queryRef);
|
const data = usePreloadedQuery(editFrameworkQuery, queryRef);
|
||||||
const [, setEditedFields] = useState<Set<string>>(new Set());
|
const [, setEditedFields] = useState<Set<string>>(new Set());
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
name: "",
|
name: "",
|
||||||
@@ -132,7 +132,7 @@ function UpdateFrameworkViewContent({
|
|||||||
}, [data.node]);
|
}, [data.node]);
|
||||||
|
|
||||||
const [commit, isInFlight] =
|
const [commit, isInFlight] =
|
||||||
useMutation<UpdateFrameworkViewUpdateFrameworkMutation>(
|
useMutation<EditFrameworkViewUpdateFrameworkMutation>(
|
||||||
updateFrameworkMutation
|
updateFrameworkMutation
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -232,10 +232,10 @@ function UpdateFrameworkViewContent({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function UpdateFrameworkView() {
|
export default function EditFrameworkView() {
|
||||||
const { frameworkId } = useParams();
|
const { frameworkId } = useParams();
|
||||||
const [queryRef, loadQuery] =
|
const [queryRef, loadQuery] =
|
||||||
useQueryLoader<UpdateFrameworkViewQueryType>(updateFrameworkQuery);
|
useQueryLoader<EditFrameworkViewQuery>(editFrameworkQuery);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (frameworkId) {
|
if (frameworkId) {
|
||||||
@@ -244,12 +244,12 @@ export default function UpdateFrameworkView() {
|
|||||||
}, [frameworkId, loadQuery]);
|
}, [frameworkId, loadQuery]);
|
||||||
|
|
||||||
if (!queryRef) {
|
if (!queryRef) {
|
||||||
return <UpdateFrameworkViewSkeleton />;
|
return <EditFrameworkViewSkeleton />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<UpdateFrameworkViewSkeleton />}>
|
<Suspense fallback={<EditFrameworkViewSkeleton />}>
|
||||||
<UpdateFrameworkViewContent queryRef={queryRef} />
|
<EditFrameworkViewContent queryRef={queryRef} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<f6c5cb8b7001a4cee689302191d06ad9>>
|
* @generated SignedSource<<893e92f87ebfab909780d937879680d9>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,19 +9,19 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type UpdateFrameworkViewQuery$variables = {
|
export type EditFrameworkViewQuery$variables = {
|
||||||
frameworkId: string;
|
frameworkId: string;
|
||||||
};
|
};
|
||||||
export type UpdateFrameworkViewQuery$data = {
|
export type EditFrameworkViewQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly description?: string;
|
readonly description?: string;
|
||||||
readonly id?: string;
|
readonly id?: string;
|
||||||
readonly name?: string;
|
readonly name?: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type UpdateFrameworkViewQuery = {
|
export type EditFrameworkViewQuery = {
|
||||||
response: UpdateFrameworkViewQuery$data;
|
response: EditFrameworkViewQuery$data;
|
||||||
variables: UpdateFrameworkViewQuery$variables;
|
variables: EditFrameworkViewQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -65,7 +65,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "UpdateFrameworkViewQuery",
|
"name": "EditFrameworkViewQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -96,7 +96,7 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "UpdateFrameworkViewQuery",
|
"name": "EditFrameworkViewQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -129,16 +129,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "5c423e61373989c4576989cb6c732547",
|
"cacheID": "2a55a5cc00d16dcb7d978dfcfbfcf8e6",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "UpdateFrameworkViewQuery",
|
"name": "EditFrameworkViewQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query UpdateFrameworkViewQuery(\n $frameworkId: ID!\n) {\n node(id: $frameworkId) {\n __typename\n ... on Framework {\n id\n name\n description\n }\n id\n }\n}\n"
|
"text": "query EditFrameworkViewQuery(\n $frameworkId: ID!\n) {\n node(id: $frameworkId) {\n __typename\n ... on Framework {\n id\n name\n description\n }\n id\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "416b7f0dbf33cbfe39578fc3243bf423";
|
(node as any).hash = "b5a785e12393d6b16ddcc1750a6aa381";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<9c98acb5c320005e303cd815550c0d74>>
|
* @generated SignedSource<<eccd1c8953dd5a4b93817a53ed43e3c4>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -14,10 +14,10 @@ export type UpdateFrameworkInput = {
|
|||||||
id: string;
|
id: string;
|
||||||
name?: string | null | undefined;
|
name?: string | null | undefined;
|
||||||
};
|
};
|
||||||
export type UpdateFrameworkViewUpdateFrameworkMutation$variables = {
|
export type EditFrameworkViewUpdateFrameworkMutation$variables = {
|
||||||
input: UpdateFrameworkInput;
|
input: UpdateFrameworkInput;
|
||||||
};
|
};
|
||||||
export type UpdateFrameworkViewUpdateFrameworkMutation$data = {
|
export type EditFrameworkViewUpdateFrameworkMutation$data = {
|
||||||
readonly updateFramework: {
|
readonly updateFramework: {
|
||||||
readonly framework: {
|
readonly framework: {
|
||||||
readonly description: string;
|
readonly description: string;
|
||||||
@@ -26,9 +26,9 @@ export type UpdateFrameworkViewUpdateFrameworkMutation$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type UpdateFrameworkViewUpdateFrameworkMutation = {
|
export type EditFrameworkViewUpdateFrameworkMutation = {
|
||||||
response: UpdateFrameworkViewUpdateFrameworkMutation$data;
|
response: EditFrameworkViewUpdateFrameworkMutation$data;
|
||||||
variables: UpdateFrameworkViewUpdateFrameworkMutation$variables;
|
variables: EditFrameworkViewUpdateFrameworkMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -95,7 +95,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "UpdateFrameworkViewUpdateFrameworkMutation",
|
"name": "EditFrameworkViewUpdateFrameworkMutation",
|
||||||
"selections": (v1/*: any*/),
|
"selections": (v1/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -104,20 +104,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "UpdateFrameworkViewUpdateFrameworkMutation",
|
"name": "EditFrameworkViewUpdateFrameworkMutation",
|
||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "8a41e224572c2419fc49c7fef6908d63",
|
"cacheID": "672c40ecde91237ef059320284b9d1c6",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "UpdateFrameworkViewUpdateFrameworkMutation",
|
"name": "EditFrameworkViewUpdateFrameworkMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation UpdateFrameworkViewUpdateFrameworkMutation(\n $input: UpdateFrameworkInput!\n) {\n updateFramework(input: $input) {\n framework {\n id\n name\n description\n }\n }\n}\n"
|
"text": "mutation EditFrameworkViewUpdateFrameworkMutation(\n $input: UpdateFrameworkInput!\n) {\n updateFramework(input: $input) {\n framework {\n id\n name\n description\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "9b201a966e844a77d3d920a7e0165d15";
|
(node as any).hash = "8fe1fd5bf26bce25a31cb724bcedec9f";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
Reference in New Issue
Block a user