@drodil/backstage-plugin-qeta 3.36.3 → 3.37.1
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/dist/alpha.d.ts +59 -11
- package/dist/alpha.esm.js +78 -16
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/EntityPostsContent/EntityPostsContent.esm.js +8 -2
- package/dist/components/EntityPostsContent/EntityPostsContent.esm.js.map +1 -1
- package/dist/package.json.esm.js +2 -1
- package/dist/package.json.esm.js.map +1 -1
- package/package.json +4 -3
package/dist/alpha.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
2
1
|
import * as react from 'react';
|
|
3
2
|
import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
|
|
4
3
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
5
4
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
5
|
+
import { Entity } from '@backstage/catalog-model';
|
|
6
6
|
export { qetaTranslationRef } from '@drodil/backstage-plugin-qeta-react';
|
|
7
7
|
|
|
8
8
|
/** @alpha */
|
|
@@ -41,30 +41,57 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
41
41
|
params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_core_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_core_plugin_api.AnyApiFactory>;
|
|
42
42
|
}>;
|
|
43
43
|
"entity-content:qeta/entity-posts-content": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
44
|
-
kind: "entity-content";
|
|
45
|
-
name: "entity-posts-content";
|
|
46
44
|
config: {
|
|
45
|
+
showFilters: boolean | undefined;
|
|
46
|
+
showTitle: boolean | undefined;
|
|
47
|
+
showAskButton: boolean | undefined;
|
|
48
|
+
showWriteButton: boolean | undefined;
|
|
49
|
+
showLinkButton: boolean | undefined;
|
|
50
|
+
showNoQuestionsBtn: boolean | undefined;
|
|
51
|
+
initialPageSize: number | undefined;
|
|
52
|
+
type: "question" | "article" | "link" | undefined;
|
|
53
|
+
view: "grid" | "list" | undefined;
|
|
54
|
+
} & {
|
|
47
55
|
path: string | undefined;
|
|
48
56
|
title: string | undefined;
|
|
49
57
|
filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
50
58
|
group: string | false | undefined;
|
|
51
59
|
};
|
|
52
60
|
configInput: {
|
|
61
|
+
type?: "question" | "article" | "link" | undefined;
|
|
62
|
+
view?: "grid" | "list" | undefined;
|
|
63
|
+
showNoQuestionsBtn?: boolean | undefined;
|
|
64
|
+
initialPageSize?: number | undefined;
|
|
65
|
+
showFilters?: boolean | undefined;
|
|
66
|
+
showTitle?: boolean | undefined;
|
|
67
|
+
showAskButton?: boolean | undefined;
|
|
68
|
+
showWriteButton?: boolean | undefined;
|
|
69
|
+
showLinkButton?: boolean | undefined;
|
|
70
|
+
} & {
|
|
53
71
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
54
72
|
title?: string | undefined;
|
|
55
73
|
path?: string | undefined;
|
|
56
74
|
group?: string | false | undefined;
|
|
57
75
|
};
|
|
58
|
-
output: _backstage_frontend_plugin_api.ExtensionDataRef<
|
|
76
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
59
77
|
optional: true;
|
|
60
|
-
}> | _backstage_frontend_plugin_api.ExtensionDataRef<(entity:
|
|
78
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<(entity: Entity) => boolean, "catalog.entity-filter-function", {
|
|
61
79
|
optional: true;
|
|
62
80
|
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
63
81
|
optional: true;
|
|
64
82
|
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-content-group", {
|
|
65
83
|
optional: true;
|
|
66
84
|
}>;
|
|
67
|
-
inputs: {
|
|
85
|
+
inputs: {
|
|
86
|
+
[x: string]: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ExtensionDataRef<unknown, string, {
|
|
87
|
+
optional?: true;
|
|
88
|
+
}>, {
|
|
89
|
+
optional: boolean;
|
|
90
|
+
singleton: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
93
|
+
kind: "entity-content";
|
|
94
|
+
name: "entity-posts-content";
|
|
68
95
|
params: {
|
|
69
96
|
defaultPath?: [Error: `Use the 'path' param instead`];
|
|
70
97
|
path: string;
|
|
@@ -74,7 +101,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
74
101
|
group?: ("overview" | "documentation" | "development" | "deployment" | "operation" | "observability") | (string & {});
|
|
75
102
|
loader: () => Promise<JSX.Element>;
|
|
76
103
|
routeRef?: _backstage_frontend_plugin_api.RouteRef;
|
|
77
|
-
filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity:
|
|
104
|
+
filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: Entity) => boolean);
|
|
78
105
|
};
|
|
79
106
|
}>;
|
|
80
107
|
"nav-item:qeta": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
@@ -95,18 +122,39 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
95
122
|
};
|
|
96
123
|
}>;
|
|
97
124
|
"page:qeta": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
98
|
-
kind: "page";
|
|
99
|
-
name: undefined;
|
|
100
125
|
config: {
|
|
126
|
+
subtitle: string | undefined;
|
|
127
|
+
themeId: string | undefined;
|
|
128
|
+
headerTooltip: string | undefined;
|
|
129
|
+
headerType: string | undefined;
|
|
130
|
+
headerTypeLink: string | undefined;
|
|
131
|
+
} & {
|
|
101
132
|
path: string | undefined;
|
|
102
133
|
};
|
|
103
134
|
configInput: {
|
|
135
|
+
subtitle?: string | undefined;
|
|
136
|
+
themeId?: string | undefined;
|
|
137
|
+
headerTooltip?: string | undefined;
|
|
138
|
+
headerType?: string | undefined;
|
|
139
|
+
headerTypeLink?: string | undefined;
|
|
140
|
+
} & {
|
|
104
141
|
path?: string | undefined;
|
|
105
142
|
};
|
|
106
|
-
output: _backstage_frontend_plugin_api.ExtensionDataRef<
|
|
143
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
107
144
|
optional: true;
|
|
108
145
|
}>;
|
|
109
|
-
inputs: {
|
|
146
|
+
inputs: {
|
|
147
|
+
introElement: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>, {
|
|
148
|
+
singleton: true;
|
|
149
|
+
optional: true;
|
|
150
|
+
}>;
|
|
151
|
+
headerElements: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>, {
|
|
152
|
+
singleton: false;
|
|
153
|
+
optional: true;
|
|
154
|
+
}>;
|
|
155
|
+
};
|
|
156
|
+
kind: "page";
|
|
157
|
+
name: undefined;
|
|
110
158
|
params: {
|
|
111
159
|
defaultPath?: [Error: `Use the 'path' param instead`];
|
|
112
160
|
path: string;
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { ApiBlueprint, PageBlueprint, NavItemBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
2
|
+
import { ApiBlueprint, PageBlueprint, createExtensionInput, coreExtensionData, NavItemBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
3
3
|
import { convertLegacyRouteRef, compatWrapper, convertLegacyRouteRefs } from '@backstage/core-compat-api';
|
|
4
4
|
import { qetaApiRef, qetaRouteRef } from '@drodil/backstage-plugin-qeta-react';
|
|
5
5
|
export { qetaTranslationRef } from '@drodil/backstage-plugin-qeta-react';
|
|
6
|
-
import { discoveryApiRef, fetchApiRef } from '@backstage/core-plugin-api';
|
|
6
|
+
import { discoveryApiRef, fetchApiRef, configApiRef } from '@backstage/core-plugin-api';
|
|
7
7
|
import { QetaClient } from '@drodil/backstage-plugin-qeta-common';
|
|
8
|
-
import
|
|
8
|
+
import ContactSupportIcon from '@material-ui/icons/ContactSupport';
|
|
9
9
|
import { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
10
10
|
|
|
11
11
|
const qetaApi = ApiBlueprint.make({
|
|
@@ -20,28 +20,90 @@ const qetaApi = ApiBlueprint.make({
|
|
|
20
20
|
}
|
|
21
21
|
})
|
|
22
22
|
});
|
|
23
|
-
const qetaPage = PageBlueprint.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
const qetaPage = PageBlueprint.makeWithOverrides({
|
|
24
|
+
config: {
|
|
25
|
+
schema: {
|
|
26
|
+
subtitle: (z) => z.string().optional(),
|
|
27
|
+
themeId: (z) => z.string().optional(),
|
|
28
|
+
headerTooltip: (z) => z.string().optional(),
|
|
29
|
+
headerType: (z) => z.string().optional(),
|
|
30
|
+
headerTypeLink: (z) => z.string().optional()
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
inputs: {
|
|
34
|
+
introElement: createExtensionInput([coreExtensionData.reactElement], {
|
|
35
|
+
singleton: true,
|
|
36
|
+
optional: true
|
|
37
|
+
}),
|
|
38
|
+
headerElements: createExtensionInput([coreExtensionData.reactElement], {
|
|
39
|
+
singleton: false,
|
|
40
|
+
optional: true
|
|
41
|
+
})
|
|
42
|
+
},
|
|
43
|
+
factory: (originalFactory, { config, inputs }) => {
|
|
44
|
+
const introElement = inputs.introElement?.get(
|
|
45
|
+
coreExtensionData.reactElement
|
|
46
|
+
);
|
|
47
|
+
const headerElements = inputs.headerElements.map(
|
|
48
|
+
(e) => e.get(coreExtensionData.reactElement)
|
|
49
|
+
);
|
|
50
|
+
return originalFactory({
|
|
51
|
+
path: config.path ?? "/qeta",
|
|
52
|
+
routeRef: convertLegacyRouteRef(qetaRouteRef),
|
|
53
|
+
loader: () => import('./components/QetaPage/index.esm.js').then(
|
|
54
|
+
(m) => compatWrapper(
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
m.QetaPage,
|
|
57
|
+
{
|
|
58
|
+
...config,
|
|
59
|
+
introElement,
|
|
60
|
+
headerElements
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
)
|
|
65
|
+
});
|
|
28
66
|
}
|
|
29
67
|
});
|
|
30
|
-
const EntityPostsContent = EntityContentBlueprint.
|
|
68
|
+
const EntityPostsContent = EntityContentBlueprint.makeWithOverrides({
|
|
31
69
|
name: "entity-posts-content",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
(
|
|
37
|
-
|
|
70
|
+
config: {
|
|
71
|
+
schema: {
|
|
72
|
+
showFilters: (z) => z.boolean().optional(),
|
|
73
|
+
showTitle: (z) => z.boolean().optional(),
|
|
74
|
+
showAskButton: (z) => z.boolean().optional(),
|
|
75
|
+
showWriteButton: (z) => z.boolean().optional(),
|
|
76
|
+
showLinkButton: (z) => z.boolean().optional(),
|
|
77
|
+
showNoQuestionsBtn: (z) => z.boolean().optional(),
|
|
78
|
+
initialPageSize: (z) => z.number().optional(),
|
|
79
|
+
type: (z) => z.enum(["question", "article", "link"]).optional(),
|
|
80
|
+
view: (z) => z.enum(["list", "grid"]).optional()
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
factory: (originalFactory, { config, apis }) => {
|
|
84
|
+
return originalFactory({
|
|
85
|
+
path: config.path ?? "/qeta",
|
|
86
|
+
title: config.title ?? "Q&A",
|
|
87
|
+
filter: (entity) => {
|
|
88
|
+
const configApi = apis.get(configApiRef);
|
|
89
|
+
const supportedKinds = (configApi?.getOptionalStringArray("qeta.entityKinds") ?? [
|
|
90
|
+
"system",
|
|
91
|
+
"component"
|
|
92
|
+
])?.map((k) => k.toLowerCase());
|
|
93
|
+
const entityKind = entity.kind.toLowerCase();
|
|
94
|
+
return supportedKinds?.includes(entityKind);
|
|
95
|
+
},
|
|
96
|
+
loader: async () => import('./components/EntityPostsContent/EntityPostsContent.esm.js').then(
|
|
97
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.EntityPostsContent, { ...config }))
|
|
98
|
+
)
|
|
99
|
+
});
|
|
38
100
|
}
|
|
39
101
|
});
|
|
40
102
|
const qetaNavItem = NavItemBlueprint.make({
|
|
41
103
|
params: {
|
|
42
104
|
title: "Q&A",
|
|
43
105
|
routeRef: convertLegacyRouteRef(qetaRouteRef),
|
|
44
|
-
icon:
|
|
106
|
+
icon: ContactSupportIcon
|
|
45
107
|
}
|
|
46
108
|
});
|
|
47
109
|
var alpha = createFrontendPlugin({
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["import {\n ApiBlueprint,\n createFrontendPlugin,\n NavItemBlueprint,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n convertLegacyRouteRefs,\n} from '@backstage/core-compat-api';\nimport { qetaApiRef, qetaRouteRef } from '@drodil/backstage-plugin-qeta-react';\nimport {
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["import {\n ApiBlueprint,\n coreExtensionData,\n createExtensionInput,\n createFrontendPlugin,\n NavItemBlueprint,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n convertLegacyRouteRefs,\n} from '@backstage/core-compat-api';\nimport { qetaApiRef, qetaRouteRef } from '@drodil/backstage-plugin-qeta-react';\nimport {\n configApiRef,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport { QetaClient } from '@drodil/backstage-plugin-qeta-common';\nimport ContactSupportIcon from '@material-ui/icons/ContactSupport';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { Entity } from '@backstage/catalog-model';\n\nconst qetaApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: qetaApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory({ discoveryApi, fetchApi }) {\n return new QetaClient({ discoveryApi, fetchApi });\n },\n }),\n});\n\nconst qetaPage = PageBlueprint.makeWithOverrides({\n config: {\n schema: {\n subtitle: z => z.string().optional(),\n themeId: z => z.string().optional(),\n headerTooltip: z => z.string().optional(),\n headerType: z => z.string().optional(),\n headerTypeLink: z => z.string().optional(),\n },\n },\n inputs: {\n introElement: createExtensionInput([coreExtensionData.reactElement], {\n singleton: true,\n optional: true,\n }),\n headerElements: createExtensionInput([coreExtensionData.reactElement], {\n singleton: false,\n optional: true,\n }),\n },\n factory: (originalFactory, { config, inputs }) => {\n const introElement = inputs.introElement?.get(\n coreExtensionData.reactElement,\n );\n const headerElements = inputs.headerElements.map(e =>\n e.get(coreExtensionData.reactElement),\n );\n return originalFactory({\n path: config.path ?? '/qeta',\n routeRef: convertLegacyRouteRef(qetaRouteRef),\n loader: () =>\n import('./components/QetaPage').then(m =>\n compatWrapper(\n <m.QetaPage\n {...config}\n introElement={introElement}\n headerElements={headerElements}\n />,\n ),\n ),\n });\n },\n});\n\nconst EntityPostsContent = EntityContentBlueprint.makeWithOverrides({\n name: 'entity-posts-content',\n config: {\n schema: {\n showFilters: z => z.boolean().optional(),\n showTitle: z => z.boolean().optional(),\n showAskButton: z => z.boolean().optional(),\n showWriteButton: z => z.boolean().optional(),\n showLinkButton: z => z.boolean().optional(),\n showNoQuestionsBtn: z => z.boolean().optional(),\n initialPageSize: z => z.number().optional(),\n type: z => z.enum(['question', 'article', 'link']).optional(),\n view: z => z.enum(['list', 'grid']).optional(),\n },\n },\n factory: (originalFactory, { config, apis }) => {\n return originalFactory({\n path: config.path ?? '/qeta',\n title: config.title ?? 'Q&A',\n filter: (entity: Entity) => {\n const configApi = apis.get(configApiRef);\n const supportedKinds = (\n configApi?.getOptionalStringArray('qeta.entityKinds') ?? [\n 'system',\n 'component',\n ]\n )?.map(k => k.toLowerCase());\n const entityKind = entity.kind.toLowerCase();\n return supportedKinds?.includes(entityKind);\n },\n loader: async () =>\n import('./components/EntityPostsContent/EntityPostsContent.tsx').then(\n m => compatWrapper(<m.EntityPostsContent {...config} />),\n ),\n });\n },\n});\n\n/** @alpha */\nexport const qetaNavItem = NavItemBlueprint.make({\n params: {\n title: 'Q&A',\n routeRef: convertLegacyRouteRef(qetaRouteRef),\n icon: ContactSupportIcon,\n },\n});\n\n/**\n * Backstage frontend plugin.\n *\n * @alpha\n */\nexport default createFrontendPlugin({\n pluginId: 'qeta',\n info: { packageJson: () => import('../package.json') },\n routes: convertLegacyRouteRefs({\n root: qetaRouteRef,\n }),\n extensions: [qetaApi, qetaPage, EntityPostsContent, qetaNavItem],\n});\n\nexport { qetaTranslationRef } from '@drodil/backstage-plugin-qeta-react';\n"],"names":[],"mappings":";;;;;;;;;;AAwBA,MAAM,OAAA,GAAU,aAAa,IAAK,CAAA;AAAA,EAChC,MAAA,EA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AAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,IAAM,EAAA;AAAA;AAEV,CAAC;AAOD,YAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,MAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAiB,CAAE,EAAA;AAAA,EACrD,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,IAAM,EAAA;AAAA,GACP,CAAA;AAAA,EACD,UAAY,EAAA,CAAC,OAAS,EAAA,QAAA,EAAU,oBAAoB,WAAW;AACjE,CAAC,CAAA;;;;"}
|
|
@@ -2,18 +2,24 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { PostsContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
4
4
|
import { Content } from '@backstage/core-components';
|
|
5
|
-
import { stringifyEntityRef } from '@backstage/catalog-model';
|
|
5
|
+
import { isUserEntity, stringifyEntityRef } from '@backstage/catalog-model';
|
|
6
6
|
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
7
7
|
import { Container } from '@material-ui/core';
|
|
8
8
|
|
|
9
9
|
const EntityPostsContent = (props) => {
|
|
10
10
|
const [view, setView] = useState("list");
|
|
11
11
|
const { entity } = useEntity();
|
|
12
|
+
const additionalProps = {};
|
|
13
|
+
if (isUserEntity(entity)) {
|
|
14
|
+
additionalProps.author = stringifyEntityRef(entity);
|
|
15
|
+
} else {
|
|
16
|
+
additionalProps.entity = props.entity ?? stringifyEntityRef(entity);
|
|
17
|
+
}
|
|
12
18
|
return /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(
|
|
13
19
|
PostsContainer,
|
|
14
20
|
{
|
|
15
21
|
...props,
|
|
16
|
-
|
|
22
|
+
...additionalProps,
|
|
17
23
|
view,
|
|
18
24
|
onViewChange: setView
|
|
19
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityPostsContent.esm.js","sources":["../../../src/components/EntityPostsContent/EntityPostsContent.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n PostsContainer,\n PostsContainerProps,\n ViewType,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { Content } from '@backstage/core-components';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { Container } from '@material-ui/core';\n\nexport const EntityPostsContent = (props: PostsContainerProps) => {\n const [view, setView] = useState<ViewType>('list');\n const { entity } = useEntity();\n return (\n <Content>\n <Container>\n <PostsContainer\n {...props}\n
|
|
1
|
+
{"version":3,"file":"EntityPostsContent.esm.js","sources":["../../../src/components/EntityPostsContent/EntityPostsContent.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n PostsContainer,\n PostsContainerProps,\n ViewType,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { Content } from '@backstage/core-components';\nimport { isUserEntity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { Container } from '@material-ui/core';\n\nexport const EntityPostsContent = (props: PostsContainerProps) => {\n const [view, setView] = useState<ViewType>('list');\n const { entity } = useEntity();\n const additionalProps: PostsContainerProps = {};\n if (isUserEntity(entity)) {\n additionalProps.author = stringifyEntityRef(entity);\n } else {\n additionalProps.entity = props.entity ?? stringifyEntityRef(entity);\n }\n\n return (\n <Content>\n <Container>\n <PostsContainer\n {...props}\n {...additionalProps}\n view={view}\n onViewChange={setView}\n />\n </Container>\n </Content>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAWa,MAAA,kBAAA,GAAqB,CAAC,KAA+B,KAAA;AAChE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAmB,MAAM,CAAA;AACjD,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAA,MAAM,kBAAuC,EAAC;AAC9C,EAAI,IAAA,YAAA,CAAa,MAAM,CAAG,EAAA;AACxB,IAAgB,eAAA,CAAA,MAAA,GAAS,mBAAmB,MAAM,CAAA;AAAA,GAC7C,MAAA;AACL,IAAA,eAAA,CAAgB,MAAS,GAAA,KAAA,CAAM,MAAU,IAAA,kBAAA,CAAmB,MAAM,CAAA;AAAA;AAGpE,EACE,uBAAA,GAAA,CAAC,OACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,SACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACH,GAAG,eAAA;AAAA,MACJ,IAAA;AAAA,MACA,YAAc,EAAA;AAAA;AAAA,KAElB,CACF,EAAA,CAAA;AAEJ;;;;"}
|
package/dist/package.json.esm.js
CHANGED
|
@@ -6,7 +6,7 @@ var keywords = [
|
|
|
6
6
|
"frontend",
|
|
7
7
|
"backstage.io"
|
|
8
8
|
];
|
|
9
|
-
var version = "3.
|
|
9
|
+
var version = "3.37.1";
|
|
10
10
|
var main = "src/index.ts";
|
|
11
11
|
var types = "src/index.ts";
|
|
12
12
|
var prepublishOnly = "yarn tsc && yarn build";
|
|
@@ -92,6 +92,7 @@ var resolutions = {
|
|
|
92
92
|
var devDependencies = {
|
|
93
93
|
"@backstage/cli": "backstage:^",
|
|
94
94
|
"@backstage/dev-utils": "backstage:^",
|
|
95
|
+
"@backstage/frontend-defaults": "backstage:^",
|
|
95
96
|
"@backstage/plugin-catalog": "backstage:^",
|
|
96
97
|
"@backstage/plugin-home": "backstage:^",
|
|
97
98
|
"@backstage/plugin-notifications": "backstage:^",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"frontend",
|
|
8
8
|
"backstage.io"
|
|
9
9
|
],
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.37.1",
|
|
11
11
|
"main": "./dist/index.esm.js",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"prepublishOnly": "yarn tsc && yarn build",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"@backstage/plugin-search-common": "^1.2.19",
|
|
84
84
|
"@backstage/plugin-search-react": "^1.9.4",
|
|
85
85
|
"@backstage/plugin-signals-react": "^0.0.15",
|
|
86
|
-
"@drodil/backstage-plugin-qeta-common": "^3.
|
|
87
|
-
"@drodil/backstage-plugin-qeta-react": "^3.
|
|
86
|
+
"@drodil/backstage-plugin-qeta-common": "^3.37.1",
|
|
87
|
+
"@drodil/backstage-plugin-qeta-react": "^3.37.1",
|
|
88
88
|
"@material-ui/core": "^4.12.2",
|
|
89
89
|
"@material-ui/icons": "^4.11.3",
|
|
90
90
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
"devDependencies": {
|
|
106
106
|
"@backstage/cli": "^0.34.3",
|
|
107
107
|
"@backstage/dev-utils": "^1.1.14",
|
|
108
|
+
"@backstage/frontend-defaults": "^0.3.1",
|
|
108
109
|
"@backstage/plugin-catalog": "^1.31.3",
|
|
109
110
|
"@backstage/plugin-home": "^0.8.12",
|
|
110
111
|
"@backstage/plugin-notifications": "^0.5.9",
|