From 48191cb7a0246b13ab714a081100dd2bc4f71411 Mon Sep 17 00:00:00 2001 From: Kim Date: Tue, 29 Aug 2023 11:02:12 +0200 Subject: [PATCH] Hiding write key and secret if the user is no admin --- .../components/Installations/Detail/Installation.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/typescript/Frontend/src/components/Installations/Detail/Installation.tsx b/typescript/Frontend/src/components/Installations/Detail/Installation.tsx index 008556738..3429076c7 100644 --- a/typescript/Frontend/src/components/Installations/Detail/Installation.tsx +++ b/typescript/Frontend/src/components/Installations/Detail/Installation.tsx @@ -5,6 +5,8 @@ import axiosConfig from "../../../config/axiosConfig"; import { I_Folder, I_Installation } from "../../../util/types"; import InstallationForm from "./InstallationForm"; import MoveDialog from "../../Groups/Detail/MoveDialog"; +import {useContext} from "react"; +import {UserContext} from "../../Context/UserContextProvider"; interface I_InstallationProps { loading?: boolean; @@ -17,6 +19,7 @@ const Installation = (props: I_InstallationProps) => { const { values, loading, error } = props; const { id } = useParams(); const theme = useTheme(); + const { getCurrentUser } = useContext(UserContext); const handleSubmit = (data: I_Folder, formikValues: Partial) => { return axiosConfig.put("/UpdateInstallation", { ...data, ...formikValues }); @@ -45,11 +48,9 @@ const Installation = (props: I_InstallationProps) => { handleSubmit={handleSubmit} additionalButtons={props.hasMoveButton ? [moveDialog] : undefined} /> - - {values.s3WriteKey &&
{`Write key: ${values.s3WriteKey}`}
} - {values.s3WriteSecret && ( -
{`Write secret: ${values.s3WriteSecret}`}
- )} +
);