Skip to content

Commit

Permalink
add 'Danger Zone' section
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jul 4, 2024
1 parent b5fc990 commit 1dcf1ef
Show file tree
Hide file tree
Showing 16 changed files with 859 additions and 18 deletions.
148 changes: 148 additions & 0 deletions webui/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,80 @@
"name": "Mutation",
"description": null,
"fields": [
{
"name": "archiveProject",
"description": null,
"args": [
{
"name": "id",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
"kind": "OBJECT",
"name": "Project",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "changeProjectVisibility",
"description": null,
"args": [
{
"name": "id",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "isPublic",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
"kind": "OBJECT",
"name": "Project",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "createAccessToken",
"description": null,
Expand Down Expand Up @@ -794,6 +868,39 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "deleteProject",
"description": null,
"args": [
{
"name": "id",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "linkRepository",
"description": null,
Expand Down Expand Up @@ -978,6 +1085,35 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "unarchiveProject",
"description": null,
"args": [
{
"name": "id",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
"kind": "OBJECT",
"name": "Project",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "unlinkRepository",
"description": null,
Expand Down Expand Up @@ -1417,6 +1553,18 @@
"name": "Project",
"description": "A project is a collection of projects.",
"fields": [
{
"name": "archived",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "buildsPerWeek",
"description": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ const ModuleSettings: FC<ModuleSettingsProps> = (props) => {
>
<label style={{ opacity: 0.6 }}>Github</label>
<div>
<a href={plugin.githubUrl} style={{ fontSize: 16 }} target="_blank">
<a
href={plugin.githubUrl}
style={{ fontSize: 16, color: "#fff" }}
target="_blank"
>
{plugin.githubUrl}
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { FC } from "react";
import {
Modal,
ModalHeader,
ModalBody,
ModalFooter,
ModalButton,
} from "baseui/modal";
import { SIZE } from "baseui/button";
import styles, { ModalTitle } from "./styles";
import { Input } from "baseui/input";

export type ConfirmArchiveProjectModalProps = {
isOpen: boolean;
close: () => void;
onArchive: () => void;
projectSlug: string;
isArchived: boolean;
};

const ConfirmArchiveProjectModal: FC<ConfirmArchiveProjectModalProps> = (
props
) => {
const { isOpen, close, onArchive, projectSlug, isArchived } = props;

return (
<Modal onClose={close} isOpen={isOpen} overrides={styles.Modal}>
<ModalHeader>
<ModalTitle>Are you sure?</ModalTitle>
</ModalHeader>
<ModalBody style={{ fontFamily: "Lexend" }}>
<div>
If you want to proceed, please type in the slug of this pipeline:{" "}
<span style={{ fontWeight: 600, color: "#fff" }}>{projectSlug}</span>
</div>
<Input size="mini" overrides={styles.Input} />
</ModalBody>
<ModalFooter>
<ModalButton
kind="tertiary"
onClick={close}
size={SIZE.compact}
style={{ fontFamily: "Lexend", backgroundColor: "initial" }}
>
Cancel
</ModalButton>
<ModalButton
onClick={() => onArchive()}
size={SIZE.compact}
overrides={{
BaseButton: {
style: {
fontFamily: "Lexend",
backgroundColor: "#FF0000",
":hover": {
backgroundColor: "#FF0000",
},
},
},
}}
>
{isArchived ? "Unarchive" : "Archive"}
</ModalButton>
</ModalFooter>
</Modal>
);
};

export default ConfirmArchiveProjectModal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ConfirmArchiveProjectModal from "./ConfirmArchiveProjectModal";

export default ConfirmArchiveProjectModal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import styled from "@emotion/styled";

export const ModalTitle = styled.h2`
font-family: Lexend;
font-size: 16px;
font-weight: 600;
margin: 0;
`;

export default {
Modal: {
Dialog: {
style: {
backgroundColor: "#0f0124",
fontFamily: "Lexend",
},
},
},
Input: {
Root: {
style: {
marginTop: "8px",
border: "1px solid #24ffb5",
},
},
Input: {
style: {
fontFamily: "Lexend",
},
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { FC } from "react";
import {
Modal,
ModalHeader,
ModalBody,
ModalFooter,
ModalButton,
} from "baseui/modal";
import { SIZE } from "baseui/button";
import styles, { ModalTitle } from "./styles";
import { Input } from "baseui/input";

export type ConfirmDeleteProjectModalProps = {
isOpen: boolean;
close: () => void;
onDelete: () => void;
projectSlug: string;
};

const ConfirmDeleteProjectModal: FC<ConfirmDeleteProjectModalProps> = (
props
) => {
const { isOpen, close, onDelete, projectSlug } = props;

return (
<Modal onClose={close} isOpen={isOpen} overrides={styles.Modal}>
<ModalHeader>
<ModalTitle>Are you sure?</ModalTitle>
</ModalHeader>
<ModalBody style={{ fontFamily: "Lexend" }}>
<div>
This action cannot be undone. If you want to proceed, please type in
the slug of this pipeline:{" "}
<span style={{ fontWeight: 600, color: "#fff" }}>{projectSlug}</span>
</div>
<Input size="mini" overrides={styles.Input} />
</ModalBody>
<ModalFooter>
<ModalButton
kind="tertiary"
onClick={close}
size={SIZE.compact}
style={{ fontFamily: "Lexend", backgroundColor: "initial" }}
>
Cancel
</ModalButton>
<ModalButton
onClick={() => onDelete()}
size={SIZE.compact}
overrides={{
BaseButton: {
style: {
fontFamily: "Lexend",
backgroundColor: "#FF0000",
":hover": {
backgroundColor: "#FF0000",
},
},
},
}}
>
Delete
</ModalButton>
</ModalFooter>
</Modal>
);
};

export default ConfirmDeleteProjectModal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ConfirmDeleteProjectModal from "./ConfirmDeleteProjectModal";

export default ConfirmDeleteProjectModal;
Loading

0 comments on commit 1dcf1ef

Please sign in to comment.