@digi-frontend/dgate-api-documentation 1.0.55 → 1.0.57
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/_virtual/index10.js +1 -1
- package/dist/_virtual/index20.js +2 -0
- package/dist/_virtual/index20.js.map +1 -0
- package/dist/_virtual/index3.js +1 -1
- package/dist/_virtual/index4.js +1 -1
- package/dist/_virtual/index5.js +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/_virtual/index7.js +1 -1
- package/dist/_virtual/index8.js +1 -1
- package/dist/_virtual/index9.js +1 -1
- package/dist/node_modules/dom-serializer/lib/index.js +1 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/index.js +1 -1
- package/dist/node_modules/domelementtype/lib/index.js +1 -1
- package/dist/node_modules/domhandler/lib/index.js +1 -1
- package/dist/node_modules/domutils/lib/index.js +1 -1
- package/dist/node_modules/fast-json-stable-stringify/index.js +2 -0
- package/dist/node_modules/fast-json-stable-stringify/index.js.map +1 -0
- package/dist/node_modules/formik/dist/formik.esm.js +1 -1
- package/dist/node_modules/html-dom-parser/lib/index.js +1 -1
- package/dist/node_modules/html-react-parser/esm/index.mjs.js +1 -1
- package/dist/node_modules/html-react-parser/esm/index.mjs.js.map +1 -1
- package/dist/node_modules/html-react-parser/lib/index.js +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-property/lib/index.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/toposort/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +1 -1
- package/dist/src/assets/icons/CloseIcon.svg.js +2 -0
- package/dist/src/assets/icons/CloseIcon.svg.js.map +1 -0
- package/dist/src/components/InfoForm/InfoForm.js +1 -1
- package/dist/src/components/InfoForm/InfoForm.js.map +1 -1
- package/dist/src/components/LivePreview/LivePreview.js +1 -1
- package/dist/src/components/LivePreview/LivePreview.js.map +1 -1
- package/dist/src/components/MethodAccordion/MethodAccordion.js +1 -1
- package/dist/src/components/MethodAccordion/MethodAccordion.js.map +1 -1
- package/dist/src/components/dialog/index.js +1 -1
- package/dist/src/components/dialog/index.js.map +1 -1
- package/dist/src/components/table/table.js +1 -1
- package/dist/src/components/table/table.js.map +1 -1
- package/dist/src/components/table/tags-table.js +1 -1
- package/dist/src/components/table/tags-table.js.map +1 -1
- package/dist/src/layout/docsComponents/DocsContent/DocsContent.js +1 -1
- package/dist/src/layout/docsComponents/DocsContent/DocsContent.js.map +1 -1
- package/dist/src/layout/docsComponents/DocsContent/OverviewPage/index.js +2 -0
- package/dist/src/layout/docsComponents/DocsContent/OverviewPage/index.js.map +1 -0
- package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.js +1 -1
- package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.js.map +1 -1
- package/dist/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.js +1 -1
- package/dist/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.js.map +1 -1
- package/dist/src/layout/docsLayout.js +1 -1
- package/dist/src/layout/docsLayout.js.map +1 -1
- package/dist/styles.css +761 -757
- package/dist/types/components/dialog/dialog.d.ts +2 -0
- package/dist/types/components/dialog/index.d.ts +1 -1
- package/dist/types/layout/docsComponents/DocsContent/DocsContent.d.ts +2 -1
- package/dist/types/layout/docsComponents/DocsContent/OverviewPage/index.d.ts +9 -0
- package/dist/types/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.d.ts +3 -1
- package/dist/types/layout/docsLayout.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/InfoForm/InfoForm.tsx +16 -16
- package/src/components/LivePreview/LivePreview.module.scss +15 -14
- package/src/components/LivePreview/LivePreview.tsx +1 -0
- package/src/components/MethodAccordion/MethodAccordion.tsx +129 -122
- package/src/components/dialog/dialog.ts +3 -0
- package/src/components/dialog/index.tsx +7 -8
- package/src/components/table/table.tsx +39 -32
- package/src/components/table/tags-table.tsx +2 -2
- package/src/layout/docsComponents/DocsContent/DocsContent.tsx +5 -2
- package/src/layout/docsComponents/DocsContent/{TagPage → OverviewPage}/index.tsx +17 -4
- package/src/layout/docsComponents/DocsContent/{TagPage → OverviewPage}/style.scss +1 -0
- package/src/layout/docsComponents/DocsHeader/DocsHeader.tsx +1 -4
- package/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.tsx +12 -1
- package/src/layout/docsLayout.tsx +7 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
1
2
|
export type DialogStatus = 'error' | 'info' | 'warning';
|
|
2
3
|
export type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
4
|
export type ButtonType = 'text' | 'submit' | 'reset';
|
|
@@ -42,4 +43,5 @@ export interface CommonDialogProps {
|
|
|
42
43
|
submitBtnComponent?: JSX.Element | null;
|
|
43
44
|
withClose?: boolean;
|
|
44
45
|
noActions?: boolean;
|
|
46
|
+
closeIcon?: JSX.Element;
|
|
45
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import './style.scss';
|
|
2
2
|
import { CommonDialogProps } from './dialog';
|
|
3
|
-
declare const CommonDialog: ({ status, content, onSubmit, onCancel, onClose, open, size, icon, noActions, }: CommonDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const CommonDialog: ({ status, content, onSubmit, onCancel, onClose, open, size, icon, noActions, closeIcon, }: CommonDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default CommonDialog;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './style.scss';
|
|
3
3
|
import { EndpointData, OverviewData } from 'src/layout/docsLayout';
|
|
4
|
-
declare const DocsContent: ({ data, activeType, setActiveItemData, setActiveType, setExpandedSections, }: {
|
|
4
|
+
declare const DocsContent: ({ data, activeType, setActiveItemData, setActiveType, setExpandedSections, onProductNavigate, }: {
|
|
5
5
|
data: OverviewData | EndpointData;
|
|
6
6
|
activeType: "OVERVIEW" | "ENDPOINT";
|
|
7
7
|
setActiveItemData: React.Dispatch<React.SetStateAction<OverviewData | EndpointData>>;
|
|
8
8
|
setActiveType: React.Dispatch<React.SetStateAction<"OVERVIEW" | "ENDPOINT">>;
|
|
9
9
|
setExpandedSections: React.Dispatch<React.SetStateAction<Record<string, boolean>>>;
|
|
10
10
|
toggleSection: (apiId: string, sectionId: string, resetOthers?: boolean, key?: string[]) => void;
|
|
11
|
+
onProductNavigate?: (productId: number) => void;
|
|
11
12
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export default DocsContent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './style.scss';
|
|
2
|
+
import { EndpointData, OverviewData } from 'src/layout/docsLayout';
|
|
3
|
+
export declare const OverviewPage: ({ data, setActiveItemData, setActiveType, setExpandedSections, onProductNavigate, }: {
|
|
4
|
+
data: OverviewData;
|
|
5
|
+
setActiveItemData: React.Dispatch<React.SetStateAction<OverviewData | EndpointData>>;
|
|
6
|
+
setActiveType: React.Dispatch<React.SetStateAction<"OVERVIEW" | "ENDPOINT">>;
|
|
7
|
+
setExpandedSections: React.Dispatch<React.SetStateAction<Record<string, boolean>>>;
|
|
8
|
+
onProductNavigate?: (productId: number) => void;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './style.scss';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { EndpointData, OverviewData } from 'src/layout/docsLayout';
|
|
4
|
-
declare const DocsSideMenuTree: ({ apis, setActiveItemData, activeItemData, activeType, expandedSections, setExpandedSections, isFirstApiExpanded, setIsFirstApiExpanded, setActiveType, toggleSection, canSelectFirstApi, }: {
|
|
4
|
+
declare const DocsSideMenuTree: ({ apis, setActiveItemData, activeItemData, activeType, expandedSections, setExpandedSections, isFirstApiExpanded, setIsFirstApiExpanded, setActiveType, toggleSection, canSelectFirstApi, canFocusSection, setCanFocusSection, }: {
|
|
5
5
|
apis: OverviewData[];
|
|
6
6
|
setActiveItemData: React.Dispatch<React.SetStateAction<OverviewData | EndpointData>>;
|
|
7
7
|
activeItemData: OverviewData | EndpointData;
|
|
@@ -13,5 +13,7 @@ declare const DocsSideMenuTree: ({ apis, setActiveItemData, activeItemData, acti
|
|
|
13
13
|
activeType: "OVERVIEW" | "ENDPOINT";
|
|
14
14
|
toggleSection: (apiId: string, sectionId: string, resetOthers?: boolean, key?: string[]) => void;
|
|
15
15
|
canSelectFirstApi?: boolean;
|
|
16
|
+
canFocusSection: boolean;
|
|
17
|
+
setCanFocusSection: React.Dispatch<React.SetStateAction<boolean>>;
|
|
16
18
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export default DocsSideMenuTree;
|
|
@@ -4,6 +4,7 @@ import { ApiSpecModel } from '@entities/index';
|
|
|
4
4
|
interface ILayoutProps {
|
|
5
5
|
apis?: ApiSpecModel[];
|
|
6
6
|
activeApiId?: string;
|
|
7
|
+
onProductNavigate?: (productId: number) => void;
|
|
7
8
|
}
|
|
8
9
|
export interface TagData {
|
|
9
10
|
id: string;
|
|
@@ -31,5 +32,5 @@ export interface OverviewData extends Omit<ApiSpecModel, 'metaData'> {
|
|
|
31
32
|
tags: Record<string, TagData[]>;
|
|
32
33
|
servers: OpenAPIFile['servers'];
|
|
33
34
|
}
|
|
34
|
-
declare const _default: React.MemoExoticComponent<({ apis, activeApiId }: ILayoutProps) => JSX.Element>;
|
|
35
|
+
declare const _default: React.MemoExoticComponent<({ apis, activeApiId, onProductNavigate }: ILayoutProps) => JSX.Element>;
|
|
35
36
|
export default _default;
|
package/package.json
CHANGED
|
@@ -334,23 +334,23 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
|
|
|
334
334
|
|
|
335
335
|
return (
|
|
336
336
|
<form className={styles.apiInfoForm} onSubmit={(e) => e.preventDefault()}>
|
|
337
|
-
<Input
|
|
338
|
-
size="large"
|
|
339
|
-
placeholder="e.g. Payments"
|
|
340
|
-
label="API Name"
|
|
341
|
-
required
|
|
342
|
-
value={values?.info?.title}
|
|
343
|
-
maxLength={35}
|
|
344
|
-
onChange={(value) => {
|
|
345
|
-
setFieldValue('info.title', value)
|
|
346
|
-
}}
|
|
347
|
-
onClear={() => {
|
|
348
|
-
setFieldValue('info.title', '')
|
|
349
|
-
}}
|
|
350
|
-
errorMsg={errors?.info?.title}
|
|
351
|
-
restrictedCharactersRegex={regex.basic}
|
|
352
|
-
/>
|
|
353
337
|
<div className={styles.apiDocRow}>
|
|
338
|
+
<Input
|
|
339
|
+
size="large"
|
|
340
|
+
placeholder="e.g. Payments"
|
|
341
|
+
label="API Name"
|
|
342
|
+
required
|
|
343
|
+
value={values?.info?.title}
|
|
344
|
+
maxLength={35}
|
|
345
|
+
onChange={(value) => {
|
|
346
|
+
setFieldValue('info.title', value)
|
|
347
|
+
}}
|
|
348
|
+
onClear={() => {
|
|
349
|
+
setFieldValue('info.title', '')
|
|
350
|
+
}}
|
|
351
|
+
errorMsg={errors?.info?.title}
|
|
352
|
+
restrictedCharactersRegex={regex.basic}
|
|
353
|
+
/>
|
|
354
354
|
<Input size="large" label="Version" required value={values?.info?.version} disabled />
|
|
355
355
|
</div>
|
|
356
356
|
<TextArea
|
|
@@ -22,21 +22,24 @@
|
|
|
22
22
|
color: #12131a;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
.description_preview {
|
|
27
|
+
word-break: break-all;
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
.requestAccordion,
|
|
28
32
|
.responseAccordion {
|
|
29
|
-
background-color: #
|
|
30
|
-
border: 1px solid #
|
|
33
|
+
background-color: #f4c5c5;
|
|
34
|
+
border: 1px solid #da3f3f;
|
|
31
35
|
border-radius: 0.3125rem !important;
|
|
32
36
|
box-shadow: none !important;
|
|
33
37
|
margin-bottom: 0 !important;
|
|
34
38
|
cursor: default !important;
|
|
35
|
-
margin-top: .625rem;
|
|
39
|
+
margin-top: 0.625rem;
|
|
36
40
|
|
|
37
41
|
:global(.accordion-header) {
|
|
38
|
-
|
|
39
|
-
background-color: #F4C5C5;
|
|
42
|
+
background-color: #f4c5c5;
|
|
40
43
|
display: flex;
|
|
41
44
|
align-items: center;
|
|
42
45
|
justify-content: space-between;
|
|
@@ -51,8 +54,7 @@
|
|
|
51
54
|
padding: 1.25rem !important;
|
|
52
55
|
padding: 0 !important;
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
background-color: #F4C5C5;
|
|
57
|
+
background-color: #f4c5c5;
|
|
56
58
|
:global(.jsonField) {
|
|
57
59
|
div {
|
|
58
60
|
textarea {
|
|
@@ -75,13 +77,13 @@
|
|
|
75
77
|
|
|
76
78
|
.accordionContent {
|
|
77
79
|
max-width: 100%;
|
|
78
|
-
padding-left: .625rem;
|
|
79
|
-
padding-right: .625rem;
|
|
80
|
-
padding-top: .9375rem;
|
|
81
|
-
|
|
82
|
-
ol{
|
|
80
|
+
padding-left: 0.625rem;
|
|
81
|
+
padding-right: 0.625rem;
|
|
82
|
+
padding-top: 0.9375rem;
|
|
83
|
+
|
|
84
|
+
ol {
|
|
83
85
|
padding-left: 1.7rem;
|
|
84
|
-
li{
|
|
86
|
+
li {
|
|
85
87
|
max-width: 100%;
|
|
86
88
|
// white-space: normal;
|
|
87
89
|
word-break: break-all;
|
|
@@ -111,7 +113,6 @@
|
|
|
111
113
|
display: flex;
|
|
112
114
|
align-items: center;
|
|
113
115
|
|
|
114
|
-
|
|
115
116
|
svg {
|
|
116
117
|
transition: rotate 0.2s ease-in-out;
|
|
117
118
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
Accordion,
|
|
4
|
-
Button,
|
|
5
|
-
Input,
|
|
6
|
-
SelectGroup,
|
|
7
|
-
SelectGroupV2,
|
|
8
|
-
Switch,
|
|
9
|
-
TextArea,
|
|
10
|
-
} from 'digitinary-ui'
|
|
2
|
+
import { Accordion, Button, Input, SelectGroup, Switch, TextArea } from 'digitinary-ui'
|
|
11
3
|
import SVGLoader from '../../components/SVGLoader/SVGLoader'
|
|
12
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
DeleteIcon,
|
|
6
|
+
DownArrowIcon,
|
|
7
|
+
EditIcon,
|
|
8
|
+
DeleteOutlinedIcon,
|
|
9
|
+
CloseIcon,
|
|
10
|
+
} from '../../assets/icons'
|
|
13
11
|
import PlusIcon from '../../assets/icons/Plus.svg'
|
|
14
12
|
import PlusSquare from '../../assets/icons/PlusSquare.svg'
|
|
15
13
|
import { httpStatusCodes, methodColorMapping, paramsTableHeaders } from '../../constants/index'
|
|
@@ -61,7 +59,8 @@ const MethodsAccordion = ({
|
|
|
61
59
|
response: false,
|
|
62
60
|
method: false,
|
|
63
61
|
})
|
|
64
|
-
const [isFormOpen, setIsFormOpen] = useState<
|
|
62
|
+
const [isFormOpen, setIsFormOpen] = useState<boolean>(false)
|
|
63
|
+
const [isHeaderFormOpen, setIsHeaderFormOpen] = useState<boolean>(false)
|
|
65
64
|
const [tooltipRefs, setTooltipRefs] = useState<{ [key: number]: any }>({})
|
|
66
65
|
const [tableData, setTableData] = useState([])
|
|
67
66
|
const [tableResponseData, setTableResponseData] = useState([])
|
|
@@ -250,114 +249,102 @@ const MethodsAccordion = ({
|
|
|
250
249
|
<span className="enumText">{data?.schema?.enum?.join('/\u200B')}</span>
|
|
251
250
|
) : (
|
|
252
251
|
<div data-id="TEXT_DESCRIPTION" className="tableData">
|
|
253
|
-
{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
/>
|
|
294
|
-
)
|
|
295
|
-
)}
|
|
296
|
-
<p
|
|
297
|
-
className={'addEnumButton'}
|
|
298
|
-
onClick={() => {
|
|
299
|
-
setFieldValue(
|
|
300
|
-
`responses[${currentResponse}].headers[${index}].schema.enum`,
|
|
301
|
-
[...method.responses[responseIndex]?.headers[index]?.schema?.enum, '']
|
|
302
|
-
)
|
|
303
|
-
}}
|
|
304
|
-
>
|
|
305
|
-
<SVGLoader src={PlusSquare} />
|
|
306
|
-
Add New Enum
|
|
307
|
-
</p>
|
|
308
|
-
{!readOnly && (
|
|
309
|
-
<Button
|
|
310
|
-
className={styles.editDescTooltipContent_btn}
|
|
311
|
-
variant="outlined"
|
|
312
|
-
size="small"
|
|
313
|
-
type="button"
|
|
252
|
+
{(() => {
|
|
253
|
+
const schema = method?.responses[currentResponseIndex]?.headers[item]?.schema
|
|
254
|
+
const schemaType = schema?.type?.toLowerCase()
|
|
255
|
+
const isComplex = schemaType === 'array' || schemaType === 'object'
|
|
256
|
+
const enumList = schema?.enum || []
|
|
257
|
+
|
|
258
|
+
if (!schema || isComplex) return '-'
|
|
259
|
+
|
|
260
|
+
return (
|
|
261
|
+
<Tooltip
|
|
262
|
+
disabled={isComplex}
|
|
263
|
+
arrowWithBorder
|
|
264
|
+
placement="bottom-end"
|
|
265
|
+
type="function"
|
|
266
|
+
trigger="click"
|
|
267
|
+
delay={[0, 0]}
|
|
268
|
+
onCreate={(instance) => setTooltipEnumRef(instance)}
|
|
269
|
+
content={
|
|
270
|
+
<div className={styles.editDescTooltipContent}>
|
|
271
|
+
<p className={styles.editDescTooltipContent_header}>Enum</p>
|
|
272
|
+
|
|
273
|
+
{enumList.map((enumVal, enumIndex) => (
|
|
274
|
+
<Input
|
|
275
|
+
key={enumIndex}
|
|
276
|
+
className="methodDescForEnum"
|
|
277
|
+
required
|
|
278
|
+
clearable={false}
|
|
279
|
+
placeholder="Enter Enum value..."
|
|
280
|
+
value={enumVal}
|
|
281
|
+
onChange={(value) => {
|
|
282
|
+
setFieldValue(
|
|
283
|
+
`responses[${currentResponseIndex}].headers["${item}"].schema.enum[${enumIndex}]`,
|
|
284
|
+
value
|
|
285
|
+
)
|
|
286
|
+
}}
|
|
287
|
+
/>
|
|
288
|
+
))}
|
|
289
|
+
|
|
290
|
+
<p
|
|
291
|
+
className="addEnumButton"
|
|
314
292
|
onClick={() => {
|
|
315
293
|
setFieldValue(
|
|
316
|
-
`responses[${
|
|
317
|
-
[...
|
|
294
|
+
`responses[${currentResponseIndex}].headers["${item}"].schema.enum`,
|
|
295
|
+
[...enumList, '']
|
|
318
296
|
)
|
|
319
|
-
setEnumFields([])
|
|
320
|
-
tooltipEnumRef?.hide()
|
|
321
297
|
}}
|
|
322
|
-
disabled={
|
|
323
|
-
(enumFields.length > 0 &&
|
|
324
|
-
enumFields?.filter((item) => !item).length) ||
|
|
325
|
-
(method?.parameters[index]?.schema?.enum &&
|
|
326
|
-
method?.parameters[index]?.schema?.enum?.length > 0 &&
|
|
327
|
-
method?.parameters[index]?.schema?.enum?.filter((item) => !item)
|
|
328
|
-
.length)
|
|
329
|
-
}
|
|
330
298
|
>
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
299
|
+
<SVGLoader src={PlusSquare} />
|
|
300
|
+
Add New Enum
|
|
301
|
+
</p>
|
|
302
|
+
|
|
303
|
+
{!readOnly && (
|
|
304
|
+
<Button
|
|
305
|
+
className={styles.editDescTooltipContent_btn}
|
|
306
|
+
variant="outlined"
|
|
307
|
+
size="small"
|
|
308
|
+
type="button"
|
|
309
|
+
onClick={() => {
|
|
310
|
+
setFieldValue(
|
|
311
|
+
`responses[${currentResponseIndex}].headers["${item}"].schema.enum`,
|
|
312
|
+
[...enumList]
|
|
313
|
+
)
|
|
314
|
+
setEnumFields([])
|
|
315
|
+
tooltipEnumRef?.hide()
|
|
316
|
+
}}
|
|
317
|
+
disabled={enumList.length === 0 || enumList.some((val) => !val)}
|
|
318
|
+
>
|
|
319
|
+
Apply
|
|
320
|
+
</Button>
|
|
321
|
+
)}
|
|
322
|
+
</div>
|
|
323
|
+
}
|
|
324
|
+
>
|
|
325
|
+
{enumList.length > 0 ? (
|
|
326
|
+
<span className="enumText">{enumList.join('/\u200B')}</span>
|
|
327
|
+
) : (
|
|
328
|
+
<Button
|
|
329
|
+
className={styles.editDescBtn}
|
|
330
|
+
id="EnumButton"
|
|
331
|
+
variant="link"
|
|
332
|
+
color="action"
|
|
333
|
+
endIcon={
|
|
334
|
+
<SVGLoader
|
|
335
|
+
id="enumIcon"
|
|
336
|
+
src={PlusIcon}
|
|
337
|
+
width="1.5rem"
|
|
338
|
+
height="1.5rem"
|
|
339
|
+
/>
|
|
340
|
+
}
|
|
341
|
+
>
|
|
342
|
+
Add
|
|
343
|
+
</Button>
|
|
344
|
+
)}
|
|
345
|
+
</Tooltip>
|
|
346
|
+
)
|
|
347
|
+
})()}
|
|
361
348
|
</div>
|
|
362
349
|
)}
|
|
363
350
|
</>
|
|
@@ -697,9 +684,11 @@ const MethodsAccordion = ({
|
|
|
697
684
|
}
|
|
698
685
|
setCurrentResponseIndex(responseIndex)
|
|
699
686
|
indexRef.current = responseIndex
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
687
|
+
if (responseIndex >= 0) {
|
|
688
|
+
setTableResponseRecords(
|
|
689
|
+
generateResponseTableData(method.responses[responseIndex].headers, responseIndex)
|
|
690
|
+
)
|
|
691
|
+
}
|
|
703
692
|
}
|
|
704
693
|
}, [selectedStatusCode, method.responses, setFieldValue])
|
|
705
694
|
|
|
@@ -832,7 +821,7 @@ const MethodsAccordion = ({
|
|
|
832
821
|
id="paramter-request-table"
|
|
833
822
|
data={tableRecords}
|
|
834
823
|
headCells={paramsTableHeaders}
|
|
835
|
-
isFormOpen={isFormOpen
|
|
824
|
+
isFormOpen={isFormOpen}
|
|
836
825
|
setIsFormOpen={setIsFormOpen}
|
|
837
826
|
saveNewRow={saveNewRow}
|
|
838
827
|
readOnly={readOnly}
|
|
@@ -905,8 +894,8 @@ const MethodsAccordion = ({
|
|
|
905
894
|
id="paramter-response-table"
|
|
906
895
|
data={tableResponseRecords}
|
|
907
896
|
headCells={paramsTableHeaders}
|
|
908
|
-
isFormOpen={
|
|
909
|
-
setIsFormOpen={
|
|
897
|
+
isFormOpen={isHeaderFormOpen}
|
|
898
|
+
setIsFormOpen={setIsHeaderFormOpen}
|
|
910
899
|
saveNewRow={saveNewResponseRow}
|
|
911
900
|
readOnly={readOnly}
|
|
912
901
|
isRequest={false}
|
|
@@ -1006,12 +995,21 @@ const MethodsAccordion = ({
|
|
|
1006
995
|
}}
|
|
1007
996
|
onCancel={{
|
|
1008
997
|
text: 'Cancel',
|
|
1009
|
-
color: '
|
|
998
|
+
color: 'action',
|
|
1010
999
|
fullWidth: true,
|
|
1000
|
+
variant: 'outlined',
|
|
1011
1001
|
}}
|
|
1012
1002
|
onClose={() => setOpenDeleteDialog(false)}
|
|
1013
1003
|
open={openDeleteDialog}
|
|
1014
1004
|
icon={<SVGLoader src={DeleteOutlinedIcon} width="4.0625rem" height="4.0625rem" />}
|
|
1005
|
+
closeIcon={
|
|
1006
|
+
<SVGLoader
|
|
1007
|
+
src={CloseIcon}
|
|
1008
|
+
width="1.5rem"
|
|
1009
|
+
height="1.5rem"
|
|
1010
|
+
onClick={() => setOpenDeleteDialog(false)}
|
|
1011
|
+
/>
|
|
1012
|
+
}
|
|
1015
1013
|
/>
|
|
1016
1014
|
<CommonDialog
|
|
1017
1015
|
status="error"
|
|
@@ -1041,12 +1039,21 @@ const MethodsAccordion = ({
|
|
|
1041
1039
|
}}
|
|
1042
1040
|
onCancel={{
|
|
1043
1041
|
text: 'Cancel',
|
|
1044
|
-
color: '
|
|
1042
|
+
color: 'action',
|
|
1045
1043
|
fullWidth: true,
|
|
1044
|
+
variant: 'outlined',
|
|
1046
1045
|
}}
|
|
1047
1046
|
onClose={() => setOpenHeaderDeleteDialog(false)}
|
|
1048
1047
|
open={openHeaderDeleteDialog}
|
|
1049
1048
|
icon={<SVGLoader src={DeleteOutlinedIcon} width="4.0625rem" height="4.0625rem" />}
|
|
1049
|
+
closeIcon={
|
|
1050
|
+
<SVGLoader
|
|
1051
|
+
src={CloseIcon}
|
|
1052
|
+
width="1.5rem"
|
|
1053
|
+
height="1.5rem"
|
|
1054
|
+
onClick={() => setOpenDeleteDialog(false)}
|
|
1055
|
+
/>
|
|
1056
|
+
}
|
|
1050
1057
|
/>
|
|
1051
1058
|
</div>
|
|
1052
1059
|
)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { JSX } from 'react'
|
|
2
|
+
|
|
1
3
|
export type DialogStatus = 'error' | 'info' | 'warning'
|
|
2
4
|
export type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
3
5
|
export type ButtonType = 'text' | 'submit' | 'reset'
|
|
@@ -55,4 +57,5 @@ export interface CommonDialogProps {
|
|
|
55
57
|
submitBtnComponent?: JSX.Element | null
|
|
56
58
|
withClose?: boolean
|
|
57
59
|
noActions?: boolean
|
|
60
|
+
closeIcon?: JSX.Element
|
|
58
61
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
// @ts-ignore
|
|
3
|
-
import { Dialog, Button
|
|
3
|
+
import { Dialog, Button } from 'digitinary-ui'
|
|
4
4
|
import SVGLoader from '../SVGLoader/SVGLoader'
|
|
5
5
|
import './style.scss'
|
|
6
6
|
import { CommonDialogProps } from './dialog'
|
|
@@ -20,6 +20,7 @@ const CommonDialog = ({
|
|
|
20
20
|
</>
|
|
21
21
|
),
|
|
22
22
|
noActions = false,
|
|
23
|
+
closeIcon,
|
|
23
24
|
}: CommonDialogProps) => {
|
|
24
25
|
const handleClose = () => {
|
|
25
26
|
onClose() // Always close the dialog first
|
|
@@ -36,13 +37,11 @@ const CommonDialog = ({
|
|
|
36
37
|
<div className={`icon ${status}`}>{icon}</div>
|
|
37
38
|
</div>
|
|
38
39
|
)}
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
className="close-icon"
|
|
45
|
-
/>
|
|
40
|
+
<div className="close-icon">
|
|
41
|
+
{closeIcon ?? (
|
|
42
|
+
<SVGLoader src={Closecircle} width={'1.5rem'} height={'1.5rem'} onClick={handleClose} />
|
|
43
|
+
)}
|
|
44
|
+
</div>
|
|
46
45
|
|
|
47
46
|
{content}
|
|
48
47
|
{!!noActions ? null : (
|