diff --git a/nest_frontend/PageSwitcher.js b/nest_frontend/PageSwitcher.js index 7a7e9d9..db7332f 100644 --- a/nest_frontend/PageSwitcher.js +++ b/nest_frontend/PageSwitcher.js @@ -13,6 +13,7 @@ import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons" import makeIcon from "./utils/makeIcon" import useStrings from "./hooks/useStrings" import Alert from "./components/base/Alert" +import PageRepositoryAlertsCreate from "./routes/PageRepositoryAlertsCreate" export default function PageSwitcher({ ...props }) { @@ -23,6 +24,9 @@ export default function PageSwitcher({ ...props }) { + + + diff --git a/nest_frontend/routes/PageRepositoryAlerts.js b/nest_frontend/routes/PageRepositoryAlerts.js index 114c8cd..02a2a1f 100644 --- a/nest_frontend/routes/PageRepositoryAlerts.js +++ b/nest_frontend/routes/PageRepositoryAlerts.js @@ -9,7 +9,7 @@ import ButtonHeader from "../components/base/ButtonHeader" import makeIcon from "../utils/makeIcon" -export default function PageRepositoryAlerts({ ...props }) { +export default function PageRepositoryAlerts() { const { strings } = useContext(ContextLanguage) const { id } = useParams() const history = useHistory() diff --git a/nest_frontend/routes/PageRepositoryAlertsCreate.js b/nest_frontend/routes/PageRepositoryAlertsCreate.js new file mode 100644 index 0000000..bd3ea08 --- /dev/null +++ b/nest_frontend/routes/PageRepositoryAlertsCreate.js @@ -0,0 +1,44 @@ +import React, { useContext } from "react" +import BoxFull from "../components/base/BoxFull" +import ContextLanguage from "../contexts/ContextLanguage" +import BoxHeader from "../components/base/BoxHeader" +import { useHistory, useParams } from "react-router" +import { faPlus } from "@fortawesome/free-solid-svg-icons" +import PageWithHeader from "../components/base/layout/PageWithHeader" +import makeIcon from "../utils/makeIcon" +import useBackendViewset from "../hooks/useBackendViewset" + + +export default function PageRepositoryAlertsCreate() { + const { strings } = useContext(ContextLanguage) + const { id } = useParams() + const history = useHistory() + + const {createResource} = useBackendViewset( + `/api/v1/repositories/${id}/alerts/`, + "name", + { + list: false, + create: true, + retrieve: false, + edit: false, + destroy: false, + command: false, + action: false, + } + ) + + return ( + + {makeIcon(faPlus)} {strings.alertCreate} + + } + > + + {strings.notImplemented} + + + ) +}