Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 1 addition & 65 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "View your Jetbrains Space issues from Deskpro and link them to tickets you are working on",
"appStoreUrl": "https://www.deskpro.com/product-embed/apps/jetbrain-space",
"version": "1.0.9",
"isDeprecated": true,
"scope": "agent",
"isSingleInstall": false,
"hasDevMode": true,
Expand All @@ -17,71 +18,6 @@
}
},
"settings": {
"space_url": {
"title": "Space Instance URL",
"description": "Enter the URL of your Space instance, or \"https://<my_company>.jetbrains.space\"",
"validationPattern": "^https?:\\/\\/.+\\..+\\w$",
"type": "string",
"isRequired": true,
"isBackendOnly": false,
"order": 10
},
"client_id": {
"title": "Client ID",
"type": "string",
"isRequired": true,
"isBackendOnly": false,
"order": 20
},
"client_secret": {
"title": "Client Secret",
"type": "string",
"isRequired": true,
"isBackendOnly": true,
"order": 30
},
"callback_url": {
"title": "Callback URL",
"type": "app_embedded",
"options": { "entrypoint": "#/admin/callback" },
"isRequired": false,
"isBackendOnly": true,
"order": 40
},
"add_comment_when_linking": {
"title": "Leave a comment on the issue in Space when it is linked to a ticket in Deskpro",
"description": "",
"type": "boolean",
"default": true,
"isRequired": false,
"isBackendOnly": false,
"order": 50
},
"default_comment_on_ticket_reply": {
"title": "Ticket reply as comment",
"description": "Enable option to add Deskpro replies as task comments when a Space issue is linked to a Deskpro ticket",
"type": "boolean",
"isRequired": false,
"isBackendOnly": false,
"order": 60
},
"default_comment_on_ticket_note": {
"title": "Ticket note as comment",
"description": "Enable option to add Deskpro notes as task comments when a Space issue is linked to a Deskpro ticket",
"type": "boolean",
"isRequired": false,
"isBackendOnly": false,
"order": 70
},
"add_deskpro_tag": {
"title": "Add \"Deskpro\" tag when creating or linking Issue",
"description": "Automatically adding a tag to indicate in Space that the issue is currently linked to a Deskpro ticket",
"type": "boolean",
"default": true,
"isRequired": false,
"isBackendOnly": false,
"order": 80
}
},
"proxy": {
"whitelist": [
Expand Down
76 changes: 3 additions & 73 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,78 +1,8 @@
import { Routes, Route, useNavigate } from "react-router-dom";
import { useDebouncedCallback } from "use-debounce";
import { match } from "ts-pattern";
import {
LoadingSpinner,
useDeskproElements,
useDeskproAppClient,
useDeskproAppEvents,
} from "@deskpro/app-sdk";
import { useLogout, useUnlinkIssue } from "./hooks";
import {
isUnlinkPayload,
isNavigatePayload,
} from "./utils";
import {
HomePage,
LoginPage,
ViewIssuePage,
EditIssuePage,
LinkIssuesPage,
LoadingAppPage,
CreateIssuePage,
AdminCallbackPage,
CreateIssueCommentPage,
} from "./pages";
import type { FC } from "react";
import type { EventPayload } from "./types";

const App: FC = () => {
const navigate = useNavigate();
const { client } = useDeskproAppClient();
const { logout, isLoading: isLoadingLogout } = useLogout();
const { unlink, isLoading: isLoadingUnlink } = useUnlinkIssue();
const isLoading = [isLoadingLogout, isLoadingUnlink].some((isLoading) => isLoading);

useDeskproElements(({ registerElement }) => {
registerElement("refresh", { type: "refresh_button" });
});

const debounceElementEvent = useDebouncedCallback((_, __, payload: EventPayload) => {
return match(payload.type)
.with("changePage", () => isNavigatePayload(payload) && navigate(payload.path))
.with("logout", logout)
.with("unlink", () => isUnlinkPayload(payload) && unlink(payload.issue))
.run();
}, 500);

useDeskproAppEvents({
onShow: () => {
client && setTimeout(() => client.resize(), 200);
},
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
onElementEvent: debounceElementEvent,
}, [client]);

if (!client || isLoading) {
return (
<LoadingSpinner />
);
}
import DeprecationNotice from "./components/DeprecationNotice";

export function App(){
return (
<Routes>
<Route path="/admin/callback" element={<AdminCallbackPage />} />
<Route path="/login" element={<LoginPage />} />
<Route path="/home" element={<HomePage />} />
<Route path="/issues/link" element={<LinkIssuesPage />} />
<Route path="/issues/view/:issueId" element={<ViewIssuePage />} />
<Route path="/issues/create" element={<CreateIssuePage />} />
<Route path="/issues/edit/:issueId" element={<EditIssuePage />} />
<Route path="/issues/:issueId/comments/new" element={<CreateIssueCommentPage />} />
<Route index element={<LoadingAppPage />} />
</Routes>
<DeprecationNotice/>
);
};

export { App };
17 changes: 17 additions & 0 deletions src/components/DeprecationNotice/DeprecationNotice.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Link } from "@deskpro/app-sdk";
import { P1, Stack } from "@deskpro/deskpro-ui";

export default function DeprecationNotice(): JSX.Element {

return (
<Stack vertical padding={12} gap={20}>
<P1>
Jetbrains have announced the decision to deprecate Space: <Link style={{textDecoration: "underline"}} target="_blank" href={"https://blog.jetbrains.com/space/2024/05/27/the-future-of-space/"}>The Future of Space</Link>.
</P1>
<P1>
Ask your admin to uninstall this app from your help desk as it will no longer
be supported by Deskpro.
</P1>
</Stack>
)
}
1 change: 1 addition & 0 deletions src/components/DeprecationNotice/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./DeprecationNotice"
Loading