@backstage-community/plugin-announcements 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/dist/alpha/Router.esm.js +74 -0
- package/dist/alpha/Router.esm.js.map +1 -0
- package/dist/alpha/components/admin/AnnouncementsAdminPage.esm.js +43 -0
- package/dist/alpha/components/admin/AnnouncementsAdminPage.esm.js.map +1 -0
- package/dist/alpha/navItems.esm.js +1 -1
- package/dist/alpha/navItems.esm.js.map +1 -1
- package/dist/alpha/pages.esm.js +1 -1
- package/dist/alpha/pages.esm.js.map +1 -1
- package/dist/alpha.d.ts +5 -13
- package/dist/alpha.esm.js +1 -1
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/Admin/AnnouncementsContent/AnnouncementsContent.esm.js +14 -22
- package/dist/components/Admin/AnnouncementsContent/AnnouncementsContent.esm.js.map +1 -1
- package/dist/components/Admin/CategoriesContent/CategoriesContent.esm.js +26 -19
- package/dist/components/Admin/CategoriesContent/CategoriesContent.esm.js.map +1 -1
- package/dist/components/Admin/TagsContent/TagsContent.esm.js +31 -19
- package/dist/components/Admin/TagsContent/TagsContent.esm.js.map +1 -1
- package/dist/components/Admin/shared/DeleteDialog/DeleteDialog.esm.js +30 -0
- package/dist/components/Admin/shared/DeleteDialog/DeleteDialog.esm.js.map +1 -0
- package/dist/components/Admin/{TagsContent/useDeleteTagDialogState.esm.js → shared/DeleteDialog/useDeleteDialogState.esm.js} +7 -7
- package/dist/components/Admin/shared/DeleteDialog/useDeleteDialogState.esm.js.map +1 -0
- package/dist/components/Admin/shared/TitleForm/TitleForm.esm.js +71 -0
- package/dist/components/Admin/shared/TitleForm/TitleForm.esm.js.map +1 -0
- package/dist/components/AnnouncementsCard/AnnouncementsCard.esm.js +3 -8
- package/dist/components/AnnouncementsCard/AnnouncementsCard.esm.js.map +1 -1
- package/dist/components/AnnouncementsPage/AnnouncementsPage.esm.js +3 -5
- package/dist/components/AnnouncementsPage/AnnouncementsPage.esm.js.map +1 -1
- package/dist/index.d.ts +14 -6
- package/dist/plugin.esm.js.map +1 -1
- package/dist/routes.esm.js +14 -4
- package/dist/routes.esm.js.map +1 -1
- package/package.json +19 -18
- package/dist/components/Admin/AnnouncementsContent/DeleteAnnouncementDialog.esm.js +0 -31
- package/dist/components/Admin/AnnouncementsContent/DeleteAnnouncementDialog.esm.js.map +0 -1
- package/dist/components/Admin/AnnouncementsContent/useDeleteAnnouncementDialogState.esm.js +0 -29
- package/dist/components/Admin/AnnouncementsContent/useDeleteAnnouncementDialogState.esm.js.map +0 -1
- package/dist/components/Admin/CategoriesContent/CategoriesForm.esm.js +0 -75
- package/dist/components/Admin/CategoriesContent/CategoriesForm.esm.js.map +0 -1
- package/dist/components/Admin/CategoriesContent/DeleteCategoryDialog.esm.js +0 -16
- package/dist/components/Admin/CategoriesContent/DeleteCategoryDialog.esm.js.map +0 -1
- package/dist/components/Admin/CategoriesContent/useDeleteCategoryDialogState.esm.js +0 -29
- package/dist/components/Admin/CategoriesContent/useDeleteCategoryDialogState.esm.js.map +0 -1
- package/dist/components/Admin/TagsContent/DeleteTagDialog.esm.js +0 -16
- package/dist/components/Admin/TagsContent/DeleteTagDialog.esm.js.map +0 -1
- package/dist/components/Admin/TagsContent/TagsForm.esm.js +0 -85
- package/dist/components/Admin/TagsContent/TagsForm.esm.js.map +0 -1
- package/dist/components/Admin/TagsContent/useDeleteTagDialogState.esm.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as _backstage_core_components from '@backstage/core-components';
|
|
3
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
3
|
import { IndexableDocument, ResultHighlight } from '@backstage/plugin-search-common';
|
|
5
4
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
5
|
+
import { JSX } from 'react';
|
|
6
6
|
import { SearchResultListItemExtensionProps } from '@backstage/plugin-search-react';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -78,9 +78,6 @@ declare const announcementsPlugin: _backstage_core_plugin_api.BackstagePlugin<{
|
|
|
78
78
|
*/
|
|
79
79
|
declare const AnnouncementsPage: (props: {
|
|
80
80
|
themeId?: string | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* @public
|
|
83
|
-
*/
|
|
84
81
|
title?: string | undefined;
|
|
85
82
|
subtitle?: string | undefined;
|
|
86
83
|
category?: string | undefined;
|
|
@@ -97,7 +94,14 @@ declare const AnnouncementsPage: (props: {
|
|
|
97
94
|
defaultInactive?: boolean | undefined;
|
|
98
95
|
}) => react_jsx_runtime.JSX.Element;
|
|
99
96
|
/**
|
|
100
|
-
* @public
|
|
97
|
+
* @public @deprecated
|
|
98
|
+
*
|
|
99
|
+
* This exported component will not be migrated to new frontend system.
|
|
100
|
+
*
|
|
101
|
+
* Access will be via the context menu on the root announcements page and dedicated routes
|
|
102
|
+
* (`/announcements/admin`, `/announcements/admin/categories`, `/announcements/admin/tags`)
|
|
103
|
+
*
|
|
104
|
+
* Please open an issue if you have concerns about this.
|
|
101
105
|
*/
|
|
102
106
|
declare const AnnouncementsAdminPortal: (props?: {
|
|
103
107
|
themeId?: string | undefined;
|
|
@@ -106,7 +110,11 @@ declare const AnnouncementsAdminPortal: (props?: {
|
|
|
106
110
|
defaultInactive?: boolean | undefined;
|
|
107
111
|
} | undefined) => react_jsx_runtime.JSX.Element;
|
|
108
112
|
/**
|
|
109
|
-
* @public
|
|
113
|
+
* @public @deprecated
|
|
114
|
+
*
|
|
115
|
+
* This exported component will not be migrated to new frontend system.
|
|
116
|
+
*
|
|
117
|
+
* Please open an issue if you have concerns about this.
|
|
110
118
|
*/
|
|
111
119
|
declare const AnnouncementsTimeline: ({ maxResults, timelineAlignment, timelineMinWidth, hideInactive, sortBy, order, current, }: AnnouncementsTimelineProps) => react_jsx_runtime.JSX.Element;
|
|
112
120
|
/**
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n errorApiRef,\n identityApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n createSearchResultListItemExtension,\n SearchResultListItemExtensionProps,\n} from '@backstage/plugin-search-react';\nimport { AnnouncementSearchResultProps } from './components/AnnouncementSearchResultListItem';\nimport { rootRouteRef } from './routes';\nimport {\n announcementsApiRef,\n AnnouncementsClient,\n} from '@backstage-community/plugin-announcements-react';\n\n/**\n * @public\n */\nexport const announcementsPlugin = createPlugin({\n id: 'announcements',\n routes: {\n root: rootRouteRef,\n },\n apis: [\n createApiFactory({\n api: announcementsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n identityApi: identityApiRef,\n errorApi: errorApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, identityApi, errorApi, fetchApi }) => {\n return new AnnouncementsClient({\n discoveryApi: discoveryApi,\n identityApi: identityApi,\n errorApi: errorApi,\n fetchApi: fetchApi,\n });\n },\n }),\n ],\n});\n\n/**\n * @public\n */\nexport const AnnouncementsPage = announcementsPlugin.provide(\n createRoutableExtension({\n name: 'AnnouncementsPage',\n component: () => import('./components/Router').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const AnnouncementsAdminPortal = announcementsPlugin.provide(\n createComponentExtension({\n name: 'AnnouncementsAdminPortal',\n component: {\n lazy: () => import('./components/Admin').then(m => m.AdminPortal),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const AnnouncementsTimeline = announcementsPlugin.provide(\n createComponentExtension({\n name: 'AnnouncementsTimeline',\n component: {\n lazy: () => import('./components').then(m => m.AnnouncementsTimeline),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const AnnouncementsCard = announcementsPlugin.provide(\n createComponentExtension({\n name: 'AnnouncementsCard',\n component: {\n lazy: () =>\n import('./components/AnnouncementsCard').then(m => m.AnnouncementsCard),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const NewAnnouncementBanner = announcementsPlugin.provide(\n createComponentExtension({\n name: 'NewAnnouncementBanner',\n component: {\n lazy: () =>\n import('./components/NewAnnouncementBanner').then(\n m => m.NewAnnouncementBanner,\n ),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const AnnouncementSearchResultListItem: (\n props: SearchResultListItemExtensionProps<AnnouncementSearchResultProps>,\n) => JSX.Element | null = announcementsPlugin.provide(\n createSearchResultListItemExtension({\n name: 'AnnouncementSearchResultListItem',\n component: () =>\n import('./components/AnnouncementSearchResultListItem').then(\n m => m.AnnouncementSearchResultListItem,\n ),\n predicate: result => result.type === 'announcements',\n }),\n);\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { JSX } from 'react';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n errorApiRef,\n identityApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n createSearchResultListItemExtension,\n SearchResultListItemExtensionProps,\n} from '@backstage/plugin-search-react';\nimport { AnnouncementSearchResultProps } from './components/AnnouncementSearchResultListItem';\nimport { rootRouteRef } from './routes';\nimport {\n announcementsApiRef,\n AnnouncementsClient,\n} from '@backstage-community/plugin-announcements-react';\n\n/**\n * @public\n */\nexport const announcementsPlugin = createPlugin({\n id: 'announcements',\n routes: {\n root: rootRouteRef,\n },\n apis: [\n createApiFactory({\n api: announcementsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n identityApi: identityApiRef,\n errorApi: errorApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, identityApi, errorApi, fetchApi }) => {\n return new AnnouncementsClient({\n discoveryApi: discoveryApi,\n identityApi: identityApi,\n errorApi: errorApi,\n fetchApi: fetchApi,\n });\n },\n }),\n ],\n});\n\n/**\n * @public\n */\nexport const AnnouncementsPage = announcementsPlugin.provide(\n createRoutableExtension({\n name: 'AnnouncementsPage',\n component: () => import('./components/Router').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public @deprecated\n *\n * This exported component will not be migrated to new frontend system.\n *\n * Access will be via the context menu on the root announcements page and dedicated routes\n * (`/announcements/admin`, `/announcements/admin/categories`, `/announcements/admin/tags`)\n *\n * Please open an issue if you have concerns about this.\n */\nexport const AnnouncementsAdminPortal = announcementsPlugin.provide(\n createComponentExtension({\n name: 'AnnouncementsAdminPortal',\n component: {\n lazy: () => import('./components/Admin').then(m => m.AdminPortal),\n },\n }),\n);\n\n/**\n * @public @deprecated\n *\n * This exported component will not be migrated to new frontend system.\n *\n * Please open an issue if you have concerns about this.\n */\nexport const AnnouncementsTimeline = announcementsPlugin.provide(\n createComponentExtension({\n name: 'AnnouncementsTimeline',\n component: {\n lazy: () => import('./components').then(m => m.AnnouncementsTimeline),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const AnnouncementsCard = announcementsPlugin.provide(\n createComponentExtension({\n name: 'AnnouncementsCard',\n component: {\n lazy: () =>\n import('./components/AnnouncementsCard').then(m => m.AnnouncementsCard),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const NewAnnouncementBanner = announcementsPlugin.provide(\n createComponentExtension({\n name: 'NewAnnouncementBanner',\n component: {\n lazy: () =>\n import('./components/NewAnnouncementBanner').then(\n m => m.NewAnnouncementBanner,\n ),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const AnnouncementSearchResultListItem: (\n props: SearchResultListItemExtensionProps<AnnouncementSearchResultProps>,\n) => JSX.Element | null = announcementsPlugin.provide(\n createSearchResultListItemExtension({\n name: 'AnnouncementSearchResultListItem',\n component: () =>\n import('./components/AnnouncementSearchResultListItem').then(\n m => m.AnnouncementSearchResultListItem,\n ),\n predicate: result => result.type === 'announcements',\n }),\n);\n"],"names":[],"mappings":";;;;;AAwCO,MAAM,sBAAsB,YAAa,CAAA;AAAA,EAC9C,EAAI,EAAA,eAAA;AAAA,EACJ,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA;AAAA,GACR;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,mBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,WAAa,EAAA,cAAA;AAAA,QACb,QAAU,EAAA,WAAA;AAAA,QACV,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,SAAS,CAAC,EAAE,cAAc,WAAa,EAAA,QAAA,EAAU,UAAe,KAAA;AAC9D,QAAA,OAAO,IAAI,mBAAoB,CAAA;AAAA,UAC7B,YAAA;AAAA,UACA,WAAA;AAAA,UACA,QAAA;AAAA,UACA;AAAA,SACD,CAAA;AAAA;AACH,KACD;AAAA;AAEL,CAAC;AAKM,MAAM,oBAAoB,mBAAoB,CAAA,OAAA;AAAA,EACnD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,mBAAA;AAAA,IACN,SAAA,EAAW,MAAM,OAAO,4BAAqB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,MAAM,CAAA;AAAA,IACjE,UAAY,EAAA;AAAA,GACb;AACH;AAYO,MAAM,2BAA2B,mBAAoB,CAAA,OAAA;AAAA,EAC1D,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,0BAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,iCAAoB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,WAAW;AAAA;AAClE,GACD;AACH;AASO,MAAM,wBAAwB,mBAAoB,CAAA,OAAA;AAAA,EACvD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,2BAAc,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,qBAAqB;AAAA;AACtE,GACD;AACH;AAKO,MAAM,oBAAoB,mBAAoB,CAAA,OAAA;AAAA,EACnD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,mBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,6CAAgC,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,iBAAiB;AAAA;AAC1E,GACD;AACH;AAKO,MAAM,wBAAwB,mBAAoB,CAAA,OAAA;AAAA,EACvD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,iDAAoC,CAAE,CAAA,IAAA;AAAA,QAC3C,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;AAKO,MAAM,mCAEa,mBAAoB,CAAA,OAAA;AAAA,EAC5C,mCAAoC,CAAA;AAAA,IAClC,IAAM,EAAA,kCAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,4DAA+C,CAAE,CAAA,IAAA;AAAA,MACtD,OAAK,CAAE,CAAA;AAAA,KACT;AAAA,IACF,SAAA,EAAW,CAAU,MAAA,KAAA,MAAA,CAAO,IAAS,KAAA;AAAA,GACtC;AACH;;;;"}
|
package/dist/routes.esm.js
CHANGED
|
@@ -3,16 +3,26 @@ import { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api';
|
|
|
3
3
|
const rootRouteRef = createRouteRef({
|
|
4
4
|
id: "announcements"
|
|
5
5
|
});
|
|
6
|
+
const announcementViewRouteRef = createSubRouteRef({
|
|
7
|
+
id: "announcements/view",
|
|
8
|
+
path: "/view/:id",
|
|
9
|
+
parent: rootRouteRef
|
|
10
|
+
});
|
|
6
11
|
const announcementAdminRouteRef = createSubRouteRef({
|
|
7
12
|
id: "announcements/admin",
|
|
8
13
|
path: "/admin",
|
|
9
14
|
parent: rootRouteRef
|
|
10
15
|
});
|
|
11
|
-
const
|
|
12
|
-
id: "announcements
|
|
13
|
-
path: "/
|
|
16
|
+
const adminCategoriesRouteRef = createSubRouteRef({
|
|
17
|
+
id: "announcements-admin-categories",
|
|
18
|
+
path: "/admin/categories",
|
|
19
|
+
parent: rootRouteRef
|
|
20
|
+
});
|
|
21
|
+
const adminTagsRouteRef = createSubRouteRef({
|
|
22
|
+
id: "announcements-admin-tags",
|
|
23
|
+
path: "/admin/tags",
|
|
14
24
|
parent: rootRouteRef
|
|
15
25
|
});
|
|
16
26
|
|
|
17
|
-
export { announcementAdminRouteRef, announcementViewRouteRef, rootRouteRef };
|
|
27
|
+
export { adminCategoriesRouteRef, adminTagsRouteRef, announcementAdminRouteRef, announcementViewRouteRef, rootRouteRef };
|
|
18
28
|
//# sourceMappingURL=routes.esm.js.map
|
package/dist/routes.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'announcements',\n});\n\nexport const announcementAdminRouteRef = createSubRouteRef({\n id: 'announcements/admin',\n path: '/admin',\n parent: rootRouteRef,\n});\n\nexport const
|
|
1
|
+
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api';\n\n/**\n * The root route for the announcements plugin\n */\nexport const rootRouteRef = createRouteRef({\n id: 'announcements',\n});\n\n/**\n * The route for viewing a single announcement\n */\nexport const announcementViewRouteRef = createSubRouteRef({\n id: 'announcements/view',\n path: '/view/:id',\n parent: rootRouteRef,\n});\n\n/**\n * The route for the admin portal, defaulting to the announcements tab\n */\nexport const announcementAdminRouteRef = createSubRouteRef({\n id: 'announcements/admin',\n path: '/admin',\n parent: rootRouteRef,\n});\n\n/**\n * The route for the categories tab in the admin portal\n */\nexport const adminCategoriesRouteRef = createSubRouteRef({\n id: 'announcements-admin-categories',\n path: '/admin/categories',\n parent: rootRouteRef,\n});\n\n/**\n * The route for the tags tab in the admin portal\n */\nexport const adminTagsRouteRef = createSubRouteRef({\n id: 'announcements-admin-tags',\n path: '/admin/tags',\n parent: rootRouteRef,\n});\n"],"names":[],"mappings":";;AAoBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA;AACN,CAAC;AAKM,MAAM,2BAA2B,iBAAkB,CAAA;AAAA,EACxD,EAAI,EAAA,oBAAA;AAAA,EACJ,IAAM,EAAA,WAAA;AAAA,EACN,MAAQ,EAAA;AACV,CAAC;AAKM,MAAM,4BAA4B,iBAAkB,CAAA;AAAA,EACzD,EAAI,EAAA,qBAAA;AAAA,EACJ,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA;AACV,CAAC;AAKM,MAAM,0BAA0B,iBAAkB,CAAA;AAAA,EACvD,EAAI,EAAA,gCAAA;AAAA,EACJ,IAAM,EAAA,mBAAA;AAAA,EACN,MAAQ,EAAA;AACV,CAAC;AAKM,MAAM,oBAAoB,iBAAkB,CAAA;AAAA,EACjD,EAAI,EAAA,0BAAA;AAAA,EACJ,IAAM,EAAA,aAAA;AAAA,EACN,MAAQ,EAAA;AACV,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-announcements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"main": "./dist/index.esm.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -61,21 +61,22 @@
|
|
|
61
61
|
"postpack": "backstage-cli package postpack"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@backstage-community/plugin-announcements-common": "^0.
|
|
65
|
-
"@backstage-community/plugin-announcements-react": "^0.
|
|
64
|
+
"@backstage-community/plugin-announcements-common": "^0.14.0",
|
|
65
|
+
"@backstage-community/plugin-announcements-react": "^0.17.0",
|
|
66
66
|
"@backstage/catalog-model": "^1.7.6",
|
|
67
|
-
"@backstage/core-app-api": "^1.19.
|
|
68
|
-
"@backstage/core-compat-api": "^0.5.
|
|
69
|
-
"@backstage/core-components": "^0.18.
|
|
70
|
-
"@backstage/core-plugin-api": "^1.12.
|
|
67
|
+
"@backstage/core-app-api": "^1.19.3",
|
|
68
|
+
"@backstage/core-compat-api": "^0.5.5",
|
|
69
|
+
"@backstage/core-components": "^0.18.4",
|
|
70
|
+
"@backstage/core-plugin-api": "^1.12.1",
|
|
71
71
|
"@backstage/errors": "^1.2.7",
|
|
72
|
-
"@backstage/frontend-plugin-api": "^0.13.
|
|
73
|
-
"@backstage/plugin-catalog-react": "^1.21.
|
|
74
|
-
"@backstage/plugin-permission-react": "^0.4.
|
|
72
|
+
"@backstage/frontend-plugin-api": "^0.13.2",
|
|
73
|
+
"@backstage/plugin-catalog-react": "^1.21.4",
|
|
74
|
+
"@backstage/plugin-permission-react": "^0.4.39",
|
|
75
75
|
"@backstage/plugin-search-common": "^1.2.21",
|
|
76
|
-
"@backstage/plugin-search-react": "^1.10.
|
|
77
|
-
"@backstage/plugin-signals-react": "^0.0.
|
|
78
|
-
"@backstage/theme": "^0.7.
|
|
76
|
+
"@backstage/plugin-search-react": "^1.10.1",
|
|
77
|
+
"@backstage/plugin-signals-react": "^0.0.18",
|
|
78
|
+
"@backstage/theme": "^0.7.1",
|
|
79
|
+
"@backstage/ui": "^0.9.1",
|
|
79
80
|
"@material-ui/core": "^4.12.2",
|
|
80
81
|
"@material-ui/icons": "^4.11.3",
|
|
81
82
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -94,11 +95,11 @@
|
|
|
94
95
|
"react-router-dom": "^6.3.0"
|
|
95
96
|
},
|
|
96
97
|
"devDependencies": {
|
|
97
|
-
"@backstage/cli": "^0.
|
|
98
|
-
"@backstage/dev-utils": "^1.1.
|
|
99
|
-
"@backstage/frontend-test-utils": "^0.4.
|
|
100
|
-
"@backstage/plugin-signals": "^0.0.
|
|
101
|
-
"@backstage/test-utils": "^1.7.
|
|
98
|
+
"@backstage/cli": "^0.35.0",
|
|
99
|
+
"@backstage/dev-utils": "^1.1.18",
|
|
100
|
+
"@backstage/frontend-test-utils": "^0.4.2",
|
|
101
|
+
"@backstage/plugin-signals": "^0.0.26",
|
|
102
|
+
"@backstage/test-utils": "^1.7.14",
|
|
102
103
|
"@testing-library/jest-dom": "^6.3.0",
|
|
103
104
|
"@testing-library/react": "^14.0.0",
|
|
104
105
|
"@testing-library/user-event": "^14.5.1",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { usePermission } from '@backstage/plugin-permission-react';
|
|
3
|
-
import { Dialog, DialogTitle, DialogActions, Button } from '@material-ui/core';
|
|
4
|
-
import { announcementDeletePermission } from '@backstage-community/plugin-announcements-common';
|
|
5
|
-
import { useAnnouncementsTranslation } from '@backstage-community/plugin-announcements-react';
|
|
6
|
-
|
|
7
|
-
const DeleteAnnouncementDialog = (props) => {
|
|
8
|
-
const { open, onConfirm, onCancel } = props;
|
|
9
|
-
const { loading: loadingDeletePermission, allowed: canDeleteAnnouncement } = usePermission({
|
|
10
|
-
permission: announcementDeletePermission
|
|
11
|
-
});
|
|
12
|
-
const { t } = useAnnouncementsTranslation();
|
|
13
|
-
return /* @__PURE__ */ jsxs(Dialog, { open, onClose: onCancel, children: [
|
|
14
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: t("deleteDialog.title") }),
|
|
15
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
16
|
-
/* @__PURE__ */ jsx(Button, { onClick: onCancel, children: t("deleteDialog.cancel") }),
|
|
17
|
-
/* @__PURE__ */ jsx(
|
|
18
|
-
Button,
|
|
19
|
-
{
|
|
20
|
-
disabled: loadingDeletePermission || !canDeleteAnnouncement,
|
|
21
|
-
onClick: onConfirm,
|
|
22
|
-
color: "secondary",
|
|
23
|
-
children: t("deleteDialog.delete")
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
] })
|
|
27
|
-
] });
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export { DeleteAnnouncementDialog };
|
|
31
|
-
//# sourceMappingURL=DeleteAnnouncementDialog.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteAnnouncementDialog.esm.js","sources":["../../../../src/components/Admin/AnnouncementsContent/DeleteAnnouncementDialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { Button, Dialog, DialogActions, DialogTitle } from '@material-ui/core';\nimport { announcementDeletePermission } from '@backstage-community/plugin-announcements-common';\nimport { useAnnouncementsTranslation } from '@backstage-community/plugin-announcements-react';\n\ntype DeleteAnnouncementDialogProps = {\n open: boolean;\n onConfirm: () => any;\n onCancel: () => any;\n};\n\nexport const DeleteAnnouncementDialog = (\n props: DeleteAnnouncementDialogProps,\n) => {\n const { open, onConfirm, onCancel } = props;\n\n const { loading: loadingDeletePermission, allowed: canDeleteAnnouncement } =\n usePermission({\n permission: announcementDeletePermission,\n });\n const { t } = useAnnouncementsTranslation();\n\n return (\n <Dialog open={open} onClose={onCancel}>\n <DialogTitle>{t('deleteDialog.title')}</DialogTitle>\n <DialogActions>\n <Button onClick={onCancel}>{t('deleteDialog.cancel')}</Button>\n\n <Button\n disabled={loadingDeletePermission || !canDeleteAnnouncement}\n onClick={onConfirm}\n color=\"secondary\"\n >\n {t('deleteDialog.delete')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;AA0Ba,MAAA,wBAAA,GAA2B,CACtC,KACG,KAAA;AACH,EAAA,MAAM,EAAE,IAAA,EAAM,SAAW,EAAA,QAAA,EAAa,GAAA,KAAA;AAEtC,EAAA,MAAM,EAAE,OAAS,EAAA,uBAAA,EAAyB,OAAS,EAAA,qBAAA,KACjD,aAAc,CAAA;AAAA,IACZ,UAAY,EAAA;AAAA,GACb,CAAA;AACH,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,2BAA4B,EAAA;AAE1C,EAAA,uBACG,IAAA,CAAA,MAAA,EAAA,EAAO,IAAY,EAAA,OAAA,EAAS,QAC3B,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,WAAA,EAAA,EAAa,QAAE,EAAA,CAAA,CAAA,oBAAoB,CAAE,EAAA,CAAA;AAAA,yBACrC,aACC,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,MAAO,EAAA,EAAA,OAAA,EAAS,QAAW,EAAA,QAAA,EAAA,CAAA,CAAE,qBAAqB,CAAE,EAAA,CAAA;AAAA,sBAErD,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,QAAA,EAAU,2BAA2B,CAAC,qBAAA;AAAA,UACtC,OAAS,EAAA,SAAA;AAAA,UACT,KAAM,EAAA,WAAA;AAAA,UAEL,YAAE,qBAAqB;AAAA;AAAA;AAC1B,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
|
|
3
|
-
function useDeleteAnnouncementDialogState() {
|
|
4
|
-
const [state, setState] = useState({ open: false });
|
|
5
|
-
const setOpen = useCallback(
|
|
6
|
-
(a) => {
|
|
7
|
-
setState({
|
|
8
|
-
open: true,
|
|
9
|
-
announcement: a
|
|
10
|
-
});
|
|
11
|
-
},
|
|
12
|
-
[setState]
|
|
13
|
-
);
|
|
14
|
-
const setClosed = useCallback(() => {
|
|
15
|
-
setState({
|
|
16
|
-
open: false,
|
|
17
|
-
announcement: void 0
|
|
18
|
-
});
|
|
19
|
-
}, [setState]);
|
|
20
|
-
return {
|
|
21
|
-
open: setOpen,
|
|
22
|
-
close: setClosed,
|
|
23
|
-
announcement: state.announcement,
|
|
24
|
-
isOpen: state.open
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { useDeleteAnnouncementDialogState };
|
|
29
|
-
//# sourceMappingURL=useDeleteAnnouncementDialogState.esm.js.map
|
package/dist/components/Admin/AnnouncementsContent/useDeleteAnnouncementDialogState.esm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDeleteAnnouncementDialogState.esm.js","sources":["../../../../src/components/Admin/AnnouncementsContent/useDeleteAnnouncementDialogState.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Announcement } from '@backstage-community/plugin-announcements-common';\nimport { useCallback, useState } from 'react';\n\ntype DeleteAnnouncementDialogState = {\n open: (a: Announcement) => void;\n close: () => void;\n\n isOpen: boolean;\n announcement?: Announcement;\n};\n\nexport function useDeleteAnnouncementDialogState(): DeleteAnnouncementDialogState {\n const [state, setState] = useState<{\n open: boolean;\n announcement?: Announcement;\n }>({ open: false });\n\n const setOpen = useCallback(\n (a: Announcement) => {\n setState({\n open: true,\n announcement: a,\n });\n },\n [setState],\n );\n\n const setClosed = useCallback(() => {\n setState({\n open: false,\n announcement: undefined,\n });\n }, [setState]);\n\n return {\n open: setOpen,\n close: setClosed,\n\n announcement: state.announcement,\n isOpen: state.open,\n };\n}\n"],"names":[],"mappings":";;AA0BO,SAAS,gCAAkE,GAAA;AAChF,EAAM,MAAA,CAAC,OAAO,QAAQ,CAAA,GAAI,SAGvB,EAAE,IAAA,EAAM,OAAO,CAAA;AAElB,EAAA,MAAM,OAAU,GAAA,WAAA;AAAA,IACd,CAAC,CAAoB,KAAA;AACnB,MAAS,QAAA,CAAA;AAAA,QACP,IAAM,EAAA,IAAA;AAAA,QACN,YAAc,EAAA;AAAA,OACf,CAAA;AAAA,KACH;AAAA,IACA,CAAC,QAAQ;AAAA,GACX;AAEA,EAAM,MAAA,SAAA,GAAY,YAAY,MAAM;AAClC,IAAS,QAAA,CAAA;AAAA,MACP,IAAM,EAAA,KAAA;AAAA,MACN,YAAc,EAAA,KAAA;AAAA,KACf,CAAA;AAAA,GACH,EAAG,CAAC,QAAQ,CAAC,CAAA;AAEb,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,OAAA;AAAA,IACN,KAAO,EAAA,SAAA;AAAA,IAEP,cAAc,KAAM,CAAA,YAAA;AAAA,IACpB,QAAQ,KAAM,CAAA;AAAA,GAChB;AACF;;;;"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { InfoCard } from '@backstage/core-components';
|
|
4
|
-
import { useAnnouncementsTranslation } from '@backstage-community/plugin-announcements-react';
|
|
5
|
-
import { announcementCreatePermission } from '@backstage-community/plugin-announcements-common';
|
|
6
|
-
import { usePermission } from '@backstage/plugin-permission-react';
|
|
7
|
-
import { makeStyles, TextField, Button } from '@material-ui/core';
|
|
8
|
-
|
|
9
|
-
const useStyles = makeStyles((theme) => {
|
|
10
|
-
return {
|
|
11
|
-
formRoot: {
|
|
12
|
-
"& > *": {
|
|
13
|
-
margin: theme?.spacing?.(1) ?? "8px"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
const CategoriesForm = ({
|
|
19
|
-
initialData,
|
|
20
|
-
onSubmit
|
|
21
|
-
}) => {
|
|
22
|
-
const classes = useStyles();
|
|
23
|
-
const [form, setForm] = useState(initialData);
|
|
24
|
-
const [loading, setLoading] = useState(false);
|
|
25
|
-
const { t } = useAnnouncementsTranslation();
|
|
26
|
-
const { loading: loadingCreatePermission, allowed: canCreateCategory } = usePermission({
|
|
27
|
-
permission: announcementCreatePermission
|
|
28
|
-
});
|
|
29
|
-
const handleChange = (event) => {
|
|
30
|
-
setForm({
|
|
31
|
-
...form,
|
|
32
|
-
[event.target.id]: event.target.value
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
const handleSubmit = async (event) => {
|
|
36
|
-
setLoading(true);
|
|
37
|
-
event.preventDefault();
|
|
38
|
-
await onSubmit(form);
|
|
39
|
-
setLoading(false);
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ jsx(
|
|
42
|
-
InfoCard,
|
|
43
|
-
{
|
|
44
|
-
title: initialData.title ? t("categoriesForm.editCategory") : t("categoriesForm.newCategory"),
|
|
45
|
-
children: /* @__PURE__ */ jsxs("form", { className: classes.formRoot, onSubmit: handleSubmit, children: [
|
|
46
|
-
/* @__PURE__ */ jsx(
|
|
47
|
-
TextField,
|
|
48
|
-
{
|
|
49
|
-
id: "title",
|
|
50
|
-
type: "text",
|
|
51
|
-
label: t("categoriesForm.titleLabel"),
|
|
52
|
-
value: form.title,
|
|
53
|
-
onChange: handleChange,
|
|
54
|
-
variant: "outlined",
|
|
55
|
-
fullWidth: true,
|
|
56
|
-
required: true
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
/* @__PURE__ */ jsx(
|
|
60
|
-
Button,
|
|
61
|
-
{
|
|
62
|
-
variant: "contained",
|
|
63
|
-
color: "primary",
|
|
64
|
-
type: "submit",
|
|
65
|
-
disabled: loading || !form || loadingCreatePermission || !canCreateCategory,
|
|
66
|
-
children: t("categoriesForm.submit")
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
] })
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export { CategoriesForm };
|
|
75
|
-
//# sourceMappingURL=CategoriesForm.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CategoriesForm.esm.js","sources":["../../../../src/components/Admin/CategoriesContent/CategoriesForm.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ChangeEvent, FormEvent, useState } from 'react';\nimport { InfoCard } from '@backstage/core-components';\nimport {\n CreateCategoryRequest,\n useAnnouncementsTranslation,\n} from '@backstage-community/plugin-announcements-react';\nimport {\n announcementCreatePermission,\n Category,\n} from '@backstage-community/plugin-announcements-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { Button, makeStyles, TextField } from '@material-ui/core';\n\nconst useStyles = makeStyles(theme => {\n return {\n formRoot: {\n '& > *': {\n margin: theme?.spacing?.(1) ?? '8px',\n },\n },\n };\n});\n\nexport type CategoriesFormProps = {\n initialData: Category;\n onSubmit: (data: CreateCategoryRequest) => Promise<void>;\n};\n\nexport const CategoriesForm = ({\n initialData,\n onSubmit,\n}: CategoriesFormProps) => {\n const classes = useStyles();\n const [form, setForm] = useState(initialData);\n const [loading, setLoading] = useState(false);\n const { t } = useAnnouncementsTranslation();\n\n const { loading: loadingCreatePermission, allowed: canCreateCategory } =\n usePermission({\n permission: announcementCreatePermission,\n });\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setForm({\n ...form,\n [event.target.id]: event.target.value,\n });\n };\n\n const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {\n setLoading(true);\n event.preventDefault();\n\n await onSubmit(form);\n setLoading(false);\n };\n\n return (\n <InfoCard\n title={\n initialData.title\n ? t('categoriesForm.editCategory')\n : t('categoriesForm.newCategory')\n }\n >\n <form className={classes.formRoot} onSubmit={handleSubmit}>\n <TextField\n id=\"title\"\n type=\"text\"\n label={t('categoriesForm.titleLabel')}\n value={form.title}\n onChange={handleChange}\n variant=\"outlined\"\n fullWidth\n required\n />\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n disabled={\n loading || !form || loadingCreatePermission || !canCreateCategory\n }\n >\n {t('categoriesForm.submit')}\n </Button>\n </form>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,SAAA,GAAY,WAAW,CAAS,KAAA,KAAA;AACpC,EAAO,OAAA;AAAA,IACL,QAAU,EAAA;AAAA,MACR,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,KAAA,EAAO,OAAU,GAAA,CAAC,CAAK,IAAA;AAAA;AACjC;AACF,GACF;AACF,CAAC,CAAA;AAOM,MAAM,iBAAiB,CAAC;AAAA,EAC7B,WAAA;AAAA,EACA;AACF,CAA2B,KAAA;AACzB,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,WAAW,CAAA;AAC5C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAC5C,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,2BAA4B,EAAA;AAE1C,EAAA,MAAM,EAAE,OAAS,EAAA,uBAAA,EAAyB,OAAS,EAAA,iBAAA,KACjD,aAAc,CAAA;AAAA,IACZ,UAAY,EAAA;AAAA,GACb,CAAA;AAEH,EAAM,MAAA,YAAA,GAAe,CAAC,KAAyC,KAAA;AAC7D,IAAQ,OAAA,CAAA;AAAA,MACN,GAAG,IAAA;AAAA,MACH,CAAC,KAAM,CAAA,MAAA,CAAO,EAAE,GAAG,MAAM,MAAO,CAAA;AAAA,KACjC,CAAA;AAAA,GACH;AAEA,EAAM,MAAA,YAAA,GAAe,OAAO,KAAsC,KAAA;AAChE,IAAA,UAAA,CAAW,IAAI,CAAA;AACf,IAAA,KAAA,CAAM,cAAe,EAAA;AAErB,IAAA,MAAM,SAAS,IAAI,CAAA;AACnB,IAAA,UAAA,CAAW,KAAK,CAAA;AAAA,GAClB;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,OACE,WAAY,CAAA,KAAA,GACR,EAAE,6BAA6B,CAAA,GAC/B,EAAE,4BAA4B,CAAA;AAAA,MAGpC,+BAAC,MAAK,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,QAAA,EAAU,UAAU,YAC3C,EAAA,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,SAAA;AAAA,UAAA;AAAA,YACC,EAAG,EAAA,OAAA;AAAA,YACH,IAAK,EAAA,MAAA;AAAA,YACL,KAAA,EAAO,EAAE,2BAA2B,CAAA;AAAA,YACpC,OAAO,IAAK,CAAA,KAAA;AAAA,YACZ,QAAU,EAAA,YAAA;AAAA,YACV,OAAQ,EAAA,UAAA;AAAA,YACR,SAAS,EAAA,IAAA;AAAA,YACT,QAAQ,EAAA;AAAA;AAAA,SACV;AAAA,wBACA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,WAAA;AAAA,YACR,KAAM,EAAA,SAAA;AAAA,YACN,IAAK,EAAA,QAAA;AAAA,YACL,QACE,EAAA,OAAA,IAAW,CAAC,IAAA,IAAQ,2BAA2B,CAAC,iBAAA;AAAA,YAGjD,YAAE,uBAAuB;AAAA;AAAA;AAC5B,OACF,EAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Dialog, DialogTitle, DialogActions, Button } from '@material-ui/core';
|
|
3
|
-
|
|
4
|
-
const DeleteCategoryDialog = (props) => {
|
|
5
|
-
const { open, onConfirm, onCancel } = props;
|
|
6
|
-
return /* @__PURE__ */ jsxs(Dialog, { open, onClose: onCancel, children: [
|
|
7
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: "Are you sure you want to delete this category?" }),
|
|
8
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
9
|
-
/* @__PURE__ */ jsx(Button, { onClick: onCancel, children: "Cancel" }),
|
|
10
|
-
/* @__PURE__ */ jsx(Button, { onClick: onConfirm, color: "secondary", children: "Delete" })
|
|
11
|
-
] })
|
|
12
|
-
] });
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { DeleteCategoryDialog };
|
|
16
|
-
//# sourceMappingURL=DeleteCategoryDialog.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteCategoryDialog.esm.js","sources":["../../../../src/components/Admin/CategoriesContent/DeleteCategoryDialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Dialog, DialogTitle, DialogActions, Button } from '@material-ui/core';\n\ntype DeleteCategoryDialogProps = {\n open: boolean;\n onConfirm: () => any;\n onCancel: () => any;\n};\n\nexport const DeleteCategoryDialog = (props: DeleteCategoryDialogProps) => {\n const { open, onConfirm, onCancel } = props;\n\n return (\n <Dialog open={open} onClose={onCancel}>\n <DialogTitle>Are you sure you want to delete this category?</DialogTitle>\n <DialogActions>\n <Button onClick={onCancel}>Cancel</Button>\n\n <Button onClick={onConfirm} color=\"secondary\">\n Delete\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;AAuBa,MAAA,oBAAA,GAAuB,CAAC,KAAqC,KAAA;AACxE,EAAA,MAAM,EAAE,IAAA,EAAM,SAAW,EAAA,QAAA,EAAa,GAAA,KAAA;AAEtC,EAAA,uBACG,IAAA,CAAA,MAAA,EAAA,EAAO,IAAY,EAAA,OAAA,EAAS,QAC3B,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,eAAY,QAA8C,EAAA,gDAAA,EAAA,CAAA;AAAA,yBAC1D,aACC,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,MAAA,EAAA,EAAO,OAAS,EAAA,QAAA,EAAU,QAAM,EAAA,QAAA,EAAA,CAAA;AAAA,0BAEhC,MAAO,EAAA,EAAA,OAAA,EAAS,SAAW,EAAA,KAAA,EAAM,aAAY,QAE9C,EAAA,QAAA,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
|
|
3
|
-
function useDeleteCategoryDialogState() {
|
|
4
|
-
const [state, setState] = useState({ open: false });
|
|
5
|
-
const setOpen = useCallback(
|
|
6
|
-
(c) => {
|
|
7
|
-
setState({
|
|
8
|
-
open: true,
|
|
9
|
-
category: c
|
|
10
|
-
});
|
|
11
|
-
},
|
|
12
|
-
[setState]
|
|
13
|
-
);
|
|
14
|
-
const setClosed = useCallback(() => {
|
|
15
|
-
setState({
|
|
16
|
-
open: false,
|
|
17
|
-
category: void 0
|
|
18
|
-
});
|
|
19
|
-
}, [setState]);
|
|
20
|
-
return {
|
|
21
|
-
open: setOpen,
|
|
22
|
-
close: setClosed,
|
|
23
|
-
category: state.category,
|
|
24
|
-
isOpen: state.open
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { useDeleteCategoryDialogState };
|
|
29
|
-
//# sourceMappingURL=useDeleteCategoryDialogState.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDeleteCategoryDialogState.esm.js","sources":["../../../../src/components/Admin/CategoriesContent/useDeleteCategoryDialogState.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Category } from '@backstage-community/plugin-announcements-common';\nimport { useCallback, useState } from 'react';\n\ntype DeleteCategoryDialogState = {\n open: (c: Category) => void;\n close: () => void;\n\n isOpen: boolean;\n category?: Category;\n};\n\nexport function useDeleteCategoryDialogState(): DeleteCategoryDialogState {\n const [state, setState] = useState<{\n open: boolean;\n category?: Category;\n }>({ open: false });\n\n const setOpen = useCallback(\n (c: Category) => {\n setState({\n open: true,\n category: c,\n });\n },\n [setState],\n );\n\n const setClosed = useCallback(() => {\n setState({\n open: false,\n category: undefined,\n });\n }, [setState]);\n\n return {\n open: setOpen,\n close: setClosed,\n\n category: state.category,\n isOpen: state.open,\n };\n}\n"],"names":[],"mappings":";;AA0BO,SAAS,4BAA0D,GAAA;AACxE,EAAM,MAAA,CAAC,OAAO,QAAQ,CAAA,GAAI,SAGvB,EAAE,IAAA,EAAM,OAAO,CAAA;AAElB,EAAA,MAAM,OAAU,GAAA,WAAA;AAAA,IACd,CAAC,CAAgB,KAAA;AACf,MAAS,QAAA,CAAA;AAAA,QACP,IAAM,EAAA,IAAA;AAAA,QACN,QAAU,EAAA;AAAA,OACX,CAAA;AAAA,KACH;AAAA,IACA,CAAC,QAAQ;AAAA,GACX;AAEA,EAAM,MAAA,SAAA,GAAY,YAAY,MAAM;AAClC,IAAS,QAAA,CAAA;AAAA,MACP,IAAM,EAAA,KAAA;AAAA,MACN,QAAU,EAAA,KAAA;AAAA,KACX,CAAA;AAAA,GACH,EAAG,CAAC,QAAQ,CAAC,CAAA;AAEb,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,OAAA;AAAA,IACN,KAAO,EAAA,SAAA;AAAA,IAEP,UAAU,KAAM,CAAA,QAAA;AAAA,IAChB,QAAQ,KAAM,CAAA;AAAA,GAChB;AACF;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Dialog, DialogTitle, DialogActions, Button } from '@material-ui/core';
|
|
3
|
-
|
|
4
|
-
const DeleteTagDialog = (props) => {
|
|
5
|
-
const { open, onConfirm, onCancel } = props;
|
|
6
|
-
return /* @__PURE__ */ jsxs(Dialog, { open, onClose: onCancel, children: [
|
|
7
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: "Are you sure you want to delete this tag?" }),
|
|
8
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
9
|
-
/* @__PURE__ */ jsx(Button, { onClick: onCancel, children: "Cancel" }),
|
|
10
|
-
/* @__PURE__ */ jsx(Button, { onClick: onConfirm, color: "secondary", children: "Delete" })
|
|
11
|
-
] })
|
|
12
|
-
] });
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { DeleteTagDialog };
|
|
16
|
-
//# sourceMappingURL=DeleteTagDialog.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteTagDialog.esm.js","sources":["../../../../src/components/Admin/TagsContent/DeleteTagDialog.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Dialog, DialogTitle, DialogActions, Button } from '@material-ui/core';\n\ntype DeleteTagDialogProps = {\n open: boolean;\n onConfirm: () => any;\n onCancel: () => any;\n};\n\nexport const DeleteTagDialog = (props: DeleteTagDialogProps) => {\n const { open, onConfirm, onCancel } = props;\n\n return (\n <Dialog open={open} onClose={onCancel}>\n <DialogTitle>Are you sure you want to delete this tag?</DialogTitle>\n <DialogActions>\n <Button onClick={onCancel}>Cancel</Button>\n\n <Button onClick={onConfirm} color=\"secondary\">\n Delete\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;AAuBa,MAAA,eAAA,GAAkB,CAAC,KAAgC,KAAA;AAC9D,EAAA,MAAM,EAAE,IAAA,EAAM,SAAW,EAAA,QAAA,EAAa,GAAA,KAAA;AAEtC,EAAA,uBACG,IAAA,CAAA,MAAA,EAAA,EAAO,IAAY,EAAA,OAAA,EAAS,QAC3B,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,eAAY,QAAyC,EAAA,2CAAA,EAAA,CAAA;AAAA,yBACrD,aACC,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,MAAA,EAAA,EAAO,OAAS,EAAA,QAAA,EAAU,QAAM,EAAA,QAAA,EAAA,CAAA;AAAA,0BAEhC,MAAO,EAAA,EAAA,OAAA,EAAS,SAAW,EAAA,KAAA,EAAM,aAAY,QAE9C,EAAA,QAAA,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { InfoCard } from '@backstage/core-components';
|
|
4
|
-
import { useAnnouncementsTranslation } from '@backstage-community/plugin-announcements-react';
|
|
5
|
-
import { announcementCreatePermission } from '@backstage-community/plugin-announcements-common';
|
|
6
|
-
import { usePermission } from '@backstage/plugin-permission-react';
|
|
7
|
-
import { makeStyles, TextField, Button } from '@material-ui/core';
|
|
8
|
-
|
|
9
|
-
const useStyles = makeStyles((theme) => {
|
|
10
|
-
return {
|
|
11
|
-
formRoot: {
|
|
12
|
-
"& > *": {
|
|
13
|
-
margin: theme?.spacing?.(1) ?? "8px"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
const TagsForm = ({
|
|
19
|
-
initialData = { title: "", slug: "" },
|
|
20
|
-
onSubmit
|
|
21
|
-
}) => {
|
|
22
|
-
const classes = useStyles();
|
|
23
|
-
const [form, setForm] = useState(initialData);
|
|
24
|
-
const [loading, setLoading] = useState(false);
|
|
25
|
-
const { t } = useAnnouncementsTranslation();
|
|
26
|
-
const { loading: loadingCreatePermission, allowed: canCreateTag } = usePermission({
|
|
27
|
-
permission: announcementCreatePermission
|
|
28
|
-
});
|
|
29
|
-
const handleChange = (event) => {
|
|
30
|
-
setForm({
|
|
31
|
-
...form,
|
|
32
|
-
[event.target.id]: event.target.value
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
const handleSubmit = async (event) => {
|
|
36
|
-
setLoading(true);
|
|
37
|
-
event.preventDefault();
|
|
38
|
-
await onSubmit(form);
|
|
39
|
-
setLoading(false);
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ jsx(
|
|
42
|
-
InfoCard,
|
|
43
|
-
{
|
|
44
|
-
title: initialData.title ? t("tagsForm.editTag") : t("tagsForm.newTag"),
|
|
45
|
-
children: /* @__PURE__ */ jsxs(
|
|
46
|
-
"form",
|
|
47
|
-
{
|
|
48
|
-
className: classes.formRoot,
|
|
49
|
-
onSubmit: handleSubmit,
|
|
50
|
-
"data-testid": "tag-form",
|
|
51
|
-
children: [
|
|
52
|
-
/* @__PURE__ */ jsx(
|
|
53
|
-
TextField,
|
|
54
|
-
{
|
|
55
|
-
id: "title",
|
|
56
|
-
type: "text",
|
|
57
|
-
label: t("tagsForm.titleLabel"),
|
|
58
|
-
value: form.title || "",
|
|
59
|
-
onChange: handleChange,
|
|
60
|
-
variant: "outlined",
|
|
61
|
-
fullWidth: true,
|
|
62
|
-
required: true,
|
|
63
|
-
inputProps: { "data-testid": "tag-title-input" }
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
|
-
/* @__PURE__ */ jsx(
|
|
67
|
-
Button,
|
|
68
|
-
{
|
|
69
|
-
variant: "contained",
|
|
70
|
-
color: "primary",
|
|
71
|
-
type: "submit",
|
|
72
|
-
disabled: loading || !form.title || loadingCreatePermission || !canCreateTag,
|
|
73
|
-
"data-testid": "tag-submit-button",
|
|
74
|
-
children: t("tagsForm.submit")
|
|
75
|
-
}
|
|
76
|
-
)
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export { TagsForm };
|
|
85
|
-
//# sourceMappingURL=TagsForm.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TagsForm.esm.js","sources":["../../../../src/components/Admin/TagsContent/TagsForm.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, type ChangeEvent, type FormEvent } from 'react';\nimport { InfoCard } from '@backstage/core-components';\nimport {\n CreateTagRequest,\n useAnnouncementsTranslation,\n} from '@backstage-community/plugin-announcements-react';\nimport {\n announcementCreatePermission,\n Tag,\n} from '@backstage-community/plugin-announcements-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { Button, makeStyles, TextField } from '@material-ui/core';\n\nconst useStyles = makeStyles(theme => {\n return {\n formRoot: {\n '& > *': {\n margin: theme?.spacing?.(1) ?? '8px',\n },\n },\n };\n});\n\nexport type TagsFormProps = {\n initialData: Tag;\n onSubmit: (data: CreateTagRequest) => Promise<void>;\n};\n\nexport const TagsForm = ({\n initialData = { title: '', slug: '' },\n onSubmit,\n}: TagsFormProps) => {\n const classes = useStyles();\n const [form, setForm] = useState(initialData);\n const [loading, setLoading] = useState(false);\n const { t } = useAnnouncementsTranslation();\n\n const { loading: loadingCreatePermission, allowed: canCreateTag } =\n usePermission({\n permission: announcementCreatePermission,\n });\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setForm({\n ...form,\n [event.target.id]: event.target.value,\n });\n };\n\n const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {\n setLoading(true);\n event.preventDefault();\n\n await onSubmit(form);\n setLoading(false);\n };\n\n return (\n <InfoCard\n title={initialData.title ? t('tagsForm.editTag') : t('tagsForm.newTag')}\n >\n <form\n className={classes.formRoot}\n onSubmit={handleSubmit}\n data-testid=\"tag-form\"\n >\n <TextField\n id=\"title\"\n type=\"text\"\n label={t('tagsForm.titleLabel')}\n value={form.title || ''}\n onChange={handleChange}\n variant=\"outlined\"\n fullWidth\n required\n inputProps={{ 'data-testid': 'tag-title-input' }}\n />\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n disabled={\n loading || !form.title || loadingCreatePermission || !canCreateTag\n }\n data-testid=\"tag-submit-button\"\n >\n {t('tagsForm.submit')}\n </Button>\n </form>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,SAAA,GAAY,WAAW,CAAS,KAAA,KAAA;AACpC,EAAO,OAAA;AAAA,IACL,QAAU,EAAA;AAAA,MACR,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,KAAA,EAAO,OAAU,GAAA,CAAC,CAAK,IAAA;AAAA;AACjC;AACF,GACF;AACF,CAAC,CAAA;AAOM,MAAM,WAAW,CAAC;AAAA,EACvB,WAAc,GAAA,EAAE,KAAO,EAAA,EAAA,EAAI,MAAM,EAAG,EAAA;AAAA,EACpC;AACF,CAAqB,KAAA;AACnB,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,WAAW,CAAA;AAC5C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAC5C,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,2BAA4B,EAAA;AAE1C,EAAA,MAAM,EAAE,OAAS,EAAA,uBAAA,EAAyB,OAAS,EAAA,YAAA,KACjD,aAAc,CAAA;AAAA,IACZ,UAAY,EAAA;AAAA,GACb,CAAA;AAEH,EAAM,MAAA,YAAA,GAAe,CAAC,KAAyC,KAAA;AAC7D,IAAQ,OAAA,CAAA;AAAA,MACN,GAAG,IAAA;AAAA,MACH,CAAC,KAAM,CAAA,MAAA,CAAO,EAAE,GAAG,MAAM,MAAO,CAAA;AAAA,KACjC,CAAA;AAAA,GACH;AAEA,EAAM,MAAA,YAAA,GAAe,OAAO,KAAsC,KAAA;AAChE,IAAA,UAAA,CAAW,IAAI,CAAA;AACf,IAAA,KAAA,CAAM,cAAe,EAAA;AAErB,IAAA,MAAM,SAAS,IAAI,CAAA;AACnB,IAAA,UAAA,CAAW,KAAK,CAAA;AAAA,GAClB;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,OAAO,WAAY,CAAA,KAAA,GAAQ,EAAE,kBAAkB,CAAA,GAAI,EAAE,iBAAiB,CAAA;AAAA,MAEtE,QAAA,kBAAA,IAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,WAAW,OAAQ,CAAA,QAAA;AAAA,UACnB,QAAU,EAAA,YAAA;AAAA,UACV,aAAY,EAAA,UAAA;AAAA,UAEZ,QAAA,EAAA;AAAA,4BAAA,GAAA;AAAA,cAAC,SAAA;AAAA,cAAA;AAAA,gBACC,EAAG,EAAA,OAAA;AAAA,gBACH,IAAK,EAAA,MAAA;AAAA,gBACL,KAAA,EAAO,EAAE,qBAAqB,CAAA;AAAA,gBAC9B,KAAA,EAAO,KAAK,KAAS,IAAA,EAAA;AAAA,gBACrB,QAAU,EAAA,YAAA;AAAA,gBACV,OAAQ,EAAA,UAAA;AAAA,gBACR,SAAS,EAAA,IAAA;AAAA,gBACT,QAAQ,EAAA,IAAA;AAAA,gBACR,UAAA,EAAY,EAAE,aAAA,EAAe,iBAAkB;AAAA;AAAA,aACjD;AAAA,4BACA,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,OAAQ,EAAA,WAAA;AAAA,gBACR,KAAM,EAAA,SAAA;AAAA,gBACN,IAAK,EAAA,QAAA;AAAA,gBACL,UACE,OAAW,IAAA,CAAC,IAAK,CAAA,KAAA,IAAS,2BAA2B,CAAC,YAAA;AAAA,gBAExD,aAAY,EAAA,mBAAA;AAAA,gBAEX,YAAE,iBAAiB;AAAA;AAAA;AACtB;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDeleteTagDialogState.esm.js","sources":["../../../../src/components/Admin/TagsContent/useDeleteTagDialogState.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Tag } from '@backstage-community/plugin-announcements-common';\nimport { useCallback, useState } from 'react';\n\ntype DeleteTagDialogState = {\n open: (t: Tag) => void;\n close: () => void;\n\n isOpen: boolean;\n tag?: Tag;\n};\n\nexport function useDeleteTagDialogState(): DeleteTagDialogState {\n const [state, setState] = useState<{\n open: boolean;\n tag?: Tag;\n }>({ open: false });\n\n const setOpen = useCallback(\n (t: Tag) => {\n setState({\n open: true,\n tag: t,\n });\n },\n [setState],\n );\n\n const setClosed = useCallback(() => {\n setState({\n open: false,\n tag: undefined,\n });\n }, [setState]);\n\n return {\n open: setOpen,\n close: setClosed,\n\n tag: state.tag,\n isOpen: state.open,\n };\n}\n"],"names":[],"mappings":";;AA0BO,SAAS,uBAAgD,GAAA;AAC9D,EAAM,MAAA,CAAC,OAAO,QAAQ,CAAA,GAAI,SAGvB,EAAE,IAAA,EAAM,OAAO,CAAA;AAElB,EAAA,MAAM,OAAU,GAAA,WAAA;AAAA,IACd,CAAC,CAAW,KAAA;AACV,MAAS,QAAA,CAAA;AAAA,QACP,IAAM,EAAA,IAAA;AAAA,QACN,GAAK,EAAA;AAAA,OACN,CAAA;AAAA,KACH;AAAA,IACA,CAAC,QAAQ;AAAA,GACX;AAEA,EAAM,MAAA,SAAA,GAAY,YAAY,MAAM;AAClC,IAAS,QAAA,CAAA;AAAA,MACP,IAAM,EAAA,KAAA;AAAA,MACN,GAAK,EAAA,KAAA;AAAA,KACN,CAAA;AAAA,GACH,EAAG,CAAC,QAAQ,CAAC,CAAA;AAEb,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,OAAA;AAAA,IACN,KAAO,EAAA,SAAA;AAAA,IAEP,KAAK,KAAM,CAAA,GAAA;AAAA,IACX,QAAQ,KAAM,CAAA;AAAA,GAChB;AACF;;;;"}
|