@drodil/backstage-plugin-qeta 2.4.2 → 2.5.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/index.d.ts CHANGED
@@ -1,27 +1,26 @@
1
- /// <reference types="react" />
2
1
  import * as _backstage_plugin_home_react from '@backstage/plugin-home-react';
3
2
  import * as React from 'react';
4
3
  import React__default, { ReactNode } from 'react';
5
4
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
6
5
  import { FetchApi, DiscoveryApi } from '@backstage/core-plugin-api';
7
- import { QuestionResponse, StatisticResponse, QuestionsResponse, QuestionRequest, TagResponse, EntityResponse, StatisticsRequestParameters, AnswerResponse, AnswerRequest, AnswerResponseBody, AttachmentResponseBody, Question, Answer } from '@drodil/backstage-plugin-qeta-common';
6
+ import { AnswersResponse, AnswerResponse, QuestionResponse, StatisticResponse, QuestionsResponse, QuestionRequest, TagResponse, EntityResponse, StatisticsRequestParameters, AnswerRequest, AnswerResponseBody, AttachmentResponseBody, Question, Answer } from '@drodil/backstage-plugin-qeta-common';
8
7
  import { SvgIconProps } from '@material-ui/core';
9
8
 
10
9
  declare const qetaPlugin: _backstage_core_plugin_api.BackstagePlugin<{
11
10
  root: _backstage_core_plugin_api.RouteRef<undefined>;
12
11
  }, {}, {}>;
13
12
  declare const QetaPage: (props?: {
14
- title?: string | undefined;
15
- subtitle?: string | undefined;
16
- headerElements?: React.ReactNode[] | undefined;
17
- themeId?: string | undefined;
18
- headerTooltip?: string | undefined;
19
- headerType?: string | undefined;
20
- headerTypeLink?: string | undefined;
21
- } | undefined) => React.JSX.Element;
13
+ title?: string;
14
+ subtitle?: string;
15
+ headerElements?: React.ReactNode[];
16
+ themeId?: string;
17
+ headerTooltip?: string;
18
+ headerType?: string;
19
+ headerTypeLink?: string;
20
+ }) => React.JSX.Element;
22
21
  declare const QuestionTableCard: (props: _backstage_plugin_home_react.CardExtensionProps<{
23
- rowsPerPage?: number | undefined;
24
- quickFilter?: string | undefined;
22
+ rowsPerPage?: number;
23
+ quickFilter?: string;
25
24
  }>) => React.JSX.Element;
26
25
 
27
26
  interface QuestionsContainerProps {
@@ -37,6 +36,35 @@ interface QuestionsContainerProps {
37
36
  }
38
37
  declare const QuestionsContainer: (props: QuestionsContainerProps) => React__default.JSX.Element;
39
38
 
39
+ declare const AnswerList: (props: {
40
+ loading: boolean;
41
+ error: any;
42
+ response?: AnswersResponse;
43
+ onPageChange: (page: number) => void;
44
+ onPageSizeChange: (size: number) => void;
45
+ page: number;
46
+ pageSize: number;
47
+ entity?: string;
48
+ tags?: string[];
49
+ entityPage?: boolean;
50
+ }) => React__default.JSX.Element;
51
+
52
+ interface AnswersContainerProps {
53
+ tags?: string[];
54
+ author?: string;
55
+ entity?: string;
56
+ showFilters?: boolean;
57
+ showTitle?: boolean;
58
+ title?: string;
59
+ }
60
+ declare const AnswersContainer: (props: AnswersContainerProps) => React__default.JSX.Element;
61
+
62
+ interface AnswerListItemProps {
63
+ answer: AnswerResponse;
64
+ entity?: string;
65
+ }
66
+ declare const AnswerListItem: (props: AnswerListItemProps) => React__default.JSX.Element;
67
+
40
68
  type AskFormProps = {
41
69
  id?: string;
42
70
  entity?: string;
@@ -48,7 +76,7 @@ declare const AskForm: (props: AskFormProps) => React__default.JSX.Element;
48
76
 
49
77
  declare const Content: (props: {
50
78
  rowsPerPage?: number;
51
- quickFilter?: 'latest' | 'favorites' | 'most_viewed';
79
+ quickFilter?: "latest" | "favorites" | "most_viewed";
52
80
  }) => React__default.JSX.Element;
53
81
 
54
82
  type QuickFilterType = 'latest' | 'favorites' | 'most_viewed';
@@ -93,12 +121,26 @@ type GetQuestionsOptions = {
93
121
  orderBy: string;
94
122
  tags?: string[];
95
123
  noVotes: string;
96
- noAnswers: string;
124
+ noAnswers?: string;
97
125
  searchQuery: string;
98
126
  limit: number;
99
127
  favorite?: boolean;
100
128
  entity?: string;
101
129
  order: string;
130
+ fromDate?: string;
131
+ toDate?: string;
132
+ };
133
+ type GetAnswersOptions = {
134
+ noCorrectAnswer: string;
135
+ noVotes: string;
136
+ offset: number;
137
+ author?: string;
138
+ orderBy: string;
139
+ searchQuery: string;
140
+ limit: number;
141
+ order: string;
142
+ fromDate?: string;
143
+ toDate?: string;
102
144
  };
103
145
  interface QetaApi {
104
146
  getQuestions(options: GetQuestionsOptions): Promise<QuestionsResponse>;
@@ -131,6 +173,7 @@ interface QetaApi {
131
173
  deleteAnswer(questionId: number, id: number): Promise<boolean>;
132
174
  updateQuestion(id: string, question: QuestionRequest): Promise<QuestionResponse>;
133
175
  updateAnswer(id: number, answer: AnswerRequest): Promise<AnswerResponseBody>;
176
+ getAnswers(options: GetAnswersOptions): Promise<AnswersResponse>;
134
177
  getAnswer(questionId: string | number | undefined, id: string | number | undefined): Promise<AnswerResponseBody>;
135
178
  }
136
179
 
@@ -143,21 +186,7 @@ declare class QetaClient implements QetaApi {
143
186
  discoveryApi: DiscoveryApi;
144
187
  });
145
188
  getBaseUrl(): Promise<string>;
146
- getQuestions(options: {
147
- noCorrectAnswer: string;
148
- offset: number;
149
- includeEntities: boolean;
150
- author: string | undefined;
151
- orderBy: string;
152
- tags: string[] | undefined;
153
- noVotes: string;
154
- noAnswers: string;
155
- searchQuery: string;
156
- limit: number;
157
- favorite: undefined | boolean;
158
- entity: string | undefined;
159
- order: string;
160
- }): Promise<QuestionsResponse>;
189
+ getQuestions(options: GetQuestionsOptions): Promise<QuestionsResponse>;
161
190
  getQuestionsList(type: string): Promise<QuestionsResponse>;
162
191
  postQuestion(question: QuestionRequest): Promise<Question>;
163
192
  commentQuestion(id: number, content: string): Promise<Question>;
@@ -180,6 +209,7 @@ declare class QetaClient implements QetaApi {
180
209
  deleteAnswer(questionId: number, id: number): Promise<boolean>;
181
210
  updateQuestion(id: string, question: QuestionRequest): Promise<Question>;
182
211
  updateAnswer(id: number, answer: AnswerRequest): Promise<AnswerResponseBody>;
212
+ getAnswers(options: GetAnswersOptions): Promise<AnswersResponse>;
183
213
  getAnswer(questionId: string | number | undefined, id: string | number | undefined): Promise<AnswerResponseBody>;
184
214
  postAttachment(file: Blob): Promise<AttachmentResponseBody>;
185
215
  getMostUpvotedAnswers(options: StatisticsRequestParameters): Promise<StatisticResponse>;
@@ -191,4 +221,4 @@ declare class QetaClient implements QetaApi {
191
221
  private getQueryParameters;
192
222
  }
193
223
 
194
- export { AskForm, Content, type QetaApi, QetaClient, QetaPage, QuestionTableCard, QuestionsContainer, QuestionsTable, RankingCard, RankingRow, StatisticsPage, TopRankingUsers, TrophyIcon, qetaApiRef, qetaPlugin };
224
+ export { AnswerList, AnswerListItem, AnswersContainer, AskForm, Content, type QetaApi, QetaClient, QetaPage, QuestionTableCard, QuestionsContainer, QuestionsTable, RankingCard, RankingRow, StatisticsPage, TopRankingUsers, TrophyIcon, qetaApiRef, qetaPlugin };
package/dist/index.esm.js CHANGED
@@ -1,5 +1,8 @@
1
1
  export { QetaPage, QuestionTableCard, qetaPlugin } from './plugin.esm.js';
2
2
  export { QuestionsContainer } from './components/QuestionsContainer/QuestionsContainer.esm.js';
3
+ export { AnswerList } from './components/AnswersContainer/AnswerList.esm.js';
4
+ export { AnswersContainer } from './components/AnswersContainer/AnswersContainer.esm.js';
5
+ export { AnswerListItem } from './components/AnswersContainer/AnswerListItem.esm.js';
3
6
  export { AskForm } from './components/AskForm/AskForm.esm.js';
4
7
  export { Content } from './components/QuestionTableCard/Content.esm.js';
5
8
  export { QuestionsTable } from './components/QuestionTableCard/QuestionsTable.esm.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"index.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": "2.4.2",
10
+ "version": "2.5.1",
11
11
  "main": "dist/index.esm.js",
12
12
  "types": "dist/index.d.ts",
13
13
  "prepublishOnly": "yarn tsc && yarn build",
@@ -50,15 +50,15 @@
50
50
  "@backstage/catalog-client": "^1.6.5",
51
51
  "@backstage/catalog-model": "^1.5.0",
52
52
  "@backstage/config": "^1.2.0",
53
- "@backstage/core-components": "^0.14.8",
53
+ "@backstage/core-components": "^0.14.9",
54
54
  "@backstage/core-plugin-api": "^1.9.3",
55
55
  "@backstage/errors": "^1.2.4",
56
- "@backstage/plugin-catalog-react": "^1.12.1",
57
- "@backstage/plugin-home-react": "^0.1.14",
58
- "@backstage/plugin-permission-react": "^0.4.23",
56
+ "@backstage/plugin-catalog-react": "^1.12.2",
57
+ "@backstage/plugin-home-react": "^0.1.15",
58
+ "@backstage/plugin-permission-react": "^0.4.24",
59
59
  "@backstage/plugin-signals-react": "^0.0.4",
60
- "@drodil/backstage-plugin-qeta-common": "^2.4.2",
61
- "@drodil/backstage-plugin-qeta-react": "^2.4.2",
60
+ "@drodil/backstage-plugin-qeta-common": "^2.5.1",
61
+ "@drodil/backstage-plugin-qeta-react": "^2.5.1",
62
62
  "@material-ui/core": "^4.12.2",
63
63
  "@material-ui/icons": "^4.11.3",
64
64
  "@material-ui/lab": "4.0.0-alpha.61",
@@ -81,12 +81,12 @@
81
81
  "react-markdown": "8.0.7"
82
82
  },
83
83
  "devDependencies": {
84
- "@backstage/cli": "^0.26.7",
85
- "@backstage/dev-utils": "^1.0.33",
86
- "@backstage/plugin-catalog": "^1.21.0",
87
- "@backstage/plugin-home": "^0.7.5",
88
- "@backstage/plugin-notifications": "^0.2.2",
89
- "@backstage/plugin-signals": "^0.0.7",
84
+ "@backstage/cli": "^0.26.11",
85
+ "@backstage/dev-utils": "^1.0.35",
86
+ "@backstage/plugin-catalog": "^1.21.1",
87
+ "@backstage/plugin-home": "^0.7.7",
88
+ "@backstage/plugin-notifications": "^0.2.3",
89
+ "@backstage/plugin-signals": "^0.0.8",
90
90
  "@testing-library/jest-dom": "^6.1.3",
91
91
  "@types/dompurify": "^3.0.0",
92
92
  "@types/lodash": "^4.14.199",