@digi-frontend/dgate-api-documentation 1.0.18 → 1.0.20

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.
Files changed (29) hide show
  1. package/dist/_virtual/index3.js +1 -1
  2. package/dist/_virtual/index4.js +1 -1
  3. package/dist/_virtual/index5.js +1 -1
  4. package/dist/_virtual/index6.js +1 -1
  5. package/dist/node_modules/toposort/index.js +1 -1
  6. package/dist/node_modules/yup/index.esm.js +1 -1
  7. package/dist/src/components/InfoForm/InfoForm.js +1 -1
  8. package/dist/src/components/InfoForm/InfoForm.js.map +1 -1
  9. package/dist/src/components/LivePreview/LivePreview.js +1 -1
  10. package/dist/src/components/LivePreview/LivePreview.js.map +1 -1
  11. package/dist/src/components/MethodAccordion/MethodAccordion.js +1 -1
  12. package/dist/src/components/MethodAccordion/MethodAccordion.js.map +1 -1
  13. package/dist/src/components/table/table.js +1 -1
  14. package/dist/src/components/table/table.js.map +1 -1
  15. package/dist/src/components/table/tags-table.js +1 -1
  16. package/dist/src/components/table/tags-table.js.map +1 -1
  17. package/dist/src/layout/layout.js +1 -1
  18. package/dist/src/layout/layout.js.map +1 -1
  19. package/dist/styles.css +212 -194
  20. package/dist/types/components/MethodAccordion/MethodAccordion.d.ts +4 -3
  21. package/package.json +2 -2
  22. package/src/components/InfoForm/InfoForm.module.scss +13 -0
  23. package/src/components/InfoForm/InfoForm.tsx +28 -17
  24. package/src/components/LivePreview/LivePreview.tsx +30 -6
  25. package/src/components/MethodAccordion/MethodAccordion.module.scss +13 -0
  26. package/src/components/MethodAccordion/MethodAccordion.tsx +60 -18
  27. package/src/components/table/table.tsx +1 -0
  28. package/src/components/table/tags-table.tsx +2 -2
  29. package/src/layout/layout.tsx +7 -2
package/dist/styles.css CHANGED
@@ -1,4 +1,103 @@
1
- .methodAccordion {
1
+ .apiInfoForm {
2
+ display: grid;
3
+ padding: 1.25rem 1.875rem;
4
+ gap: 1.25rem;
5
+ }
6
+ .apiInfoForm .paramsTable .paramDescContainer {
7
+ display: flex;
8
+ }
9
+ .apiInfoForm .paramsTable .paramDescContainer .paramDescContainer_separator {
10
+ height: inherit;
11
+ width: 1px;
12
+ background-color: #d8dae5;
13
+ }
14
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn) svg path {
15
+ stroke-width: 0.1;
16
+ }
17
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).editDescBtn {
18
+ padding: 0;
19
+ margin-right: 1.25rem;
20
+ }
21
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).editDescBtn :global(.btnContentWrapper) {
22
+ display: flex;
23
+ align-items: center;
24
+ padding: 0;
25
+ color: #12131a;
26
+ }
27
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).editDescBtn :global(.btnContentWrapper) :global(.endBtnIcon) {
28
+ margin-block: auto;
29
+ }
30
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).editDescBtn :global(.btnContentWrapper) :global(.endBtnIcon) svg path {
31
+ fill: #12131a;
32
+ }
33
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).deleteParamBtn {
34
+ padding: 0;
35
+ }
36
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).deleteParamBtn :global(.btnContentWrapper) :global(.endBtnIcon) {
37
+ margin-block: auto;
38
+ }
39
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).deleteParamBtn :global(.btnContentWrapper) :global(.endBtnIcon) svg {
40
+ width: 1.125rem;
41
+ }
42
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn):not(:global(.disabled)):global(.success) :global(.endBtnIcon) {
43
+ margin-block: auto;
44
+ }
45
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn):not(:global(.disabled)):global(.success) :global(.endBtnIcon) svg {
46
+ width: 1.125rem;
47
+ }
48
+ .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn):not(:global(.disabled)):global(.success) :global(.endBtnIcon) svg path {
49
+ fill: #3aaa35;
50
+ }
51
+ .apiInfoForm .paramsTable .editDescTooltipContent {
52
+ display: flex;
53
+ flex-direction: column;
54
+ gap: 0.625rem;
55
+ padding-bottom: 0.625rem;
56
+ }
57
+ .apiInfoForm .paramsTable .editDescTooltipContent > *:not(.editDescTooltipContent_header) {
58
+ margin-inline: 0.625rem;
59
+ }
60
+ .apiInfoForm .paramsTable .editDescTooltipContent .editDescTooltipContent_header {
61
+ font-weight: 600;
62
+ font-size: 0.875rem;
63
+ line-height: 1.25rem;
64
+ padding: 0.75rem 1.25rem;
65
+ border-bottom: 1px solid #d8dae5;
66
+ }
67
+ .apiInfoForm .paramsTable :global(.requiredParam) :global(.headContainer)::after {
68
+ content: "*";
69
+ color: red;
70
+ transform: translateX(0.125rem);
71
+ }
72
+ .apiInfoForm .apiDocRow {
73
+ display: grid;
74
+ grid-template-columns: 1fr 1fr;
75
+ gap: 1.25rem;
76
+ }
77
+ .apiInfoForm .apiInfoForm_tagsChips {
78
+ margin-top: -1.25rem;
79
+ }
80
+ .apiInfoForm .editDescTooltipContent {
81
+ display: flex;
82
+ flex-direction: column;
83
+ gap: 0.625rem;
84
+ padding-bottom: 0.625rem;
85
+ }
86
+ .apiInfoForm .editDescTooltipContent > *:not(.editDescTooltipContent_header) {
87
+ margin-inline: 0.625rem;
88
+ }
89
+ .apiInfoForm .editDescTooltipContent .editDescTooltipContent_header {
90
+ font-weight: 600;
91
+ font-size: 0.875rem;
92
+ line-height: 1.25rem;
93
+ padding: 0.75rem 1.25rem;
94
+ border-bottom: 1px solid #d8dae5;
95
+ }
96
+ .apiInfoForm :global(.requiredParam) :global(.headContainer)::after {
97
+ content: "*";
98
+ color: red;
99
+ transform: translateX(0.125rem);
100
+ }.methodAccordion {
2
101
  border: none !important;
3
102
  box-shadow: none !important;
4
103
  margin-bottom: 0 !important;
@@ -106,6 +205,15 @@
106
205
  .methodAccordion .methodAccordionContent .paramsTable .paramDescContainer :global(.customBtn).deleteParamBtn :global(.btnContentWrapper) :global(.endBtnIcon) svg {
107
206
  width: 1.125rem;
108
207
  }
208
+ .methodAccordion .methodAccordionContent .paramsTable .paramDescContainer :global(.customBtn).deleteParamBtn:not(:global(.disabled)):global(.success) :global(.endBtnIcon) {
209
+ margin-block: auto;
210
+ }
211
+ .methodAccordion .methodAccordionContent .paramsTable .paramDescContainer :global(.customBtn).deleteParamBtn:not(:global(.disabled)):global(.success) :global(.endBtnIcon) svg {
212
+ width: 1.125rem;
213
+ }
214
+ .methodAccordion .methodAccordionContent .paramsTable .paramDescContainer :global(.customBtn).deleteParamBtn:not(:global(.disabled)):global(.success) :global(.endBtnIcon) svg path {
215
+ fill: #3aaa35;
216
+ }
109
217
  .methodAccordion .methodAccordionContent .paramsTable .editDescTooltipContent {
110
218
  display: flex;
111
219
  flex-direction: column;
@@ -262,6 +370,29 @@
262
370
  }
263
371
  .methodAccordion.readOnly .methodSummaryContainer .methodExpandArrowContainer {
264
372
  background-color: #ebecf2;
373
+ }.containerTitleDrawer {
374
+ height: 64px;
375
+ min-height: 64px;
376
+ display: flex;
377
+ flex-direction: row;
378
+ justify-content: space-between;
379
+ align-items: center;
380
+ background-color: #f1f2f6;
381
+ padding: 0 30px 0 30px;
382
+ width: 100%;
383
+ }
384
+ .containerTitleDrawer span {
385
+ color: #12131a;
386
+ font-weight: 600;
387
+ font-size: 18px;
388
+ line-height: 25px;
389
+ letter-spacing: 0em;
390
+ }
391
+ .containerTitleDrawer svg path {
392
+ stroke: #000 !important;
393
+ }
394
+ .containerTitleDrawer .closeIcon {
395
+ cursor: pointer;
265
396
  }.tooltip-custom-wrapper {
266
397
  display: flex;
267
398
  }
@@ -352,106 +483,6 @@
352
483
  z-index: 20000000000;
353
484
  top: -0.6rem;
354
485
  transform-origin: center !important;
355
- }#common-dialog.dialog-content-wrapper {
356
- overflow: visible !important;
357
- max-height: 100%;
358
- width: 22.1875rem;
359
- }
360
- #common-dialog.dialog-content-wrapper .dialog-content-root {
361
- overflow: visible !important;
362
- border-radius: 0.625rem;
363
- max-height: 100%;
364
- }
365
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content {
366
- padding: 0 1.875rem !important;
367
- overflow: visible !important;
368
- max-height: 100%;
369
- }
370
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog {
371
- position: relative;
372
- }
373
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .close-icon {
374
- position: absolute;
375
- z-index: 1;
376
- top: 1.5rem;
377
- right: 0;
378
- transform: translate(0.625rem, -0.625rem);
379
- cursor: pointer;
380
- }
381
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header {
382
- display: flex;
383
- padding-top: 0.5rem;
384
- position: relative;
385
- }
386
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon {
387
- margin-top: 1rem;
388
- margin-bottom: 1.5rem;
389
- margin-inline: auto;
390
- }
391
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info path {
392
- stroke: #12131a;
393
- }
394
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info line {
395
- stroke: #12131a;
396
- }
397
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info line + path {
398
- fill: #12131a;
399
- }
400
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.warning path {
401
- stroke: #faad14;
402
- }
403
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.warning line {
404
- stroke: #faad14;
405
- }
406
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error path {
407
- stroke: #da3f3f;
408
- }
409
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error line {
410
- stroke: #da3f3f;
411
- }
412
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error line + path {
413
- fill: #da3f3f;
414
- }
415
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title {
416
- font-size: 1.5rem;
417
- font-weight: 500;
418
- line-height: 1.875rem;
419
- text-align: center;
420
- margin-bottom: 0.625rem;
421
- }
422
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title.error-title {
423
- color: #da3f3f;
424
- }
425
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title.warning-title {
426
- color: #faad14;
427
- }
428
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-footer {
429
- display: flex;
430
- gap: 1.25rem;
431
- margin-top: 1.875rem;
432
- }.containerTitleDrawer {
433
- height: 64px;
434
- min-height: 64px;
435
- display: flex;
436
- flex-direction: row;
437
- justify-content: space-between;
438
- align-items: center;
439
- background-color: #f1f2f6;
440
- padding: 0 30px 0 30px;
441
- width: 100%;
442
- }
443
- .containerTitleDrawer span {
444
- color: #12131a;
445
- font-weight: 600;
446
- font-size: 18px;
447
- line-height: 25px;
448
- letter-spacing: 0em;
449
- }
450
- .containerTitleDrawer svg path {
451
- stroke: #000 !important;
452
- }
453
- .containerTitleDrawer .closeIcon {
454
- cursor: pointer;
455
486
  }:root {
456
487
  --white: #fff;
457
488
  --Gray-5: #f1f2f6;
@@ -687,10 +718,83 @@
687
718
  .tableSectionContainer .descArrow path,
688
719
  .tableSectionContainer .defaultSortArrow path {
689
720
  fill: var(--Gray-50);
690
- }p.apiName {
691
- font-size: 40px;
692
- line-height: 30px;
721
+ }#common-dialog.dialog-content-wrapper {
722
+ overflow: visible !important;
723
+ max-height: 100%;
724
+ width: 22.1875rem;
725
+ }
726
+ #common-dialog.dialog-content-wrapper .dialog-content-root {
727
+ overflow: visible !important;
728
+ border-radius: 0.625rem;
729
+ max-height: 100%;
730
+ }
731
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content {
732
+ padding: 0 1.875rem !important;
733
+ overflow: visible !important;
734
+ max-height: 100%;
735
+ }
736
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog {
737
+ position: relative;
738
+ }
739
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .close-icon {
740
+ position: absolute;
741
+ z-index: 1;
742
+ top: 1.5rem;
743
+ right: 0;
744
+ transform: translate(0.625rem, -0.625rem);
745
+ cursor: pointer;
746
+ }
747
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header {
748
+ display: flex;
749
+ padding-top: 0.5rem;
750
+ position: relative;
751
+ }
752
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon {
753
+ margin-top: 1rem;
754
+ margin-bottom: 1.5rem;
755
+ margin-inline: auto;
756
+ }
757
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info path {
758
+ stroke: #12131a;
759
+ }
760
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info line {
761
+ stroke: #12131a;
762
+ }
763
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info line + path {
764
+ fill: #12131a;
765
+ }
766
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.warning path {
767
+ stroke: #faad14;
768
+ }
769
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.warning line {
770
+ stroke: #faad14;
771
+ }
772
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error path {
773
+ stroke: #da3f3f;
774
+ }
775
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error line {
776
+ stroke: #da3f3f;
777
+ }
778
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error line + path {
779
+ fill: #da3f3f;
780
+ }
781
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title {
782
+ font-size: 1.5rem;
693
783
  font-weight: 500;
784
+ line-height: 1.875rem;
785
+ text-align: center;
786
+ margin-bottom: 0.625rem;
787
+ }
788
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title.error-title {
789
+ color: #da3f3f;
790
+ }
791
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title.warning-title {
792
+ color: #faad14;
793
+ }
794
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-footer {
795
+ display: flex;
796
+ gap: 1.25rem;
797
+ margin-top: 1.875rem;
694
798
  }.json-editor-container {
695
799
  overflow: hidden;
696
800
  border-bottom-right-radius: 0.3125rem;
@@ -802,96 +906,6 @@
802
906
  .json-editor-container.disabled .json-editor textarea {
803
907
  background-color: white;
804
908
  color: #12131a;
805
- }.apiInfoForm {
806
- display: grid;
807
- padding: 1.25rem 1.875rem;
808
- gap: 1.25rem;
809
- }
810
- .apiInfoForm .paramsTable .paramDescContainer {
811
- display: flex;
812
- }
813
- .apiInfoForm .paramsTable .paramDescContainer .paramDescContainer_separator {
814
- height: inherit;
815
- width: 1px;
816
- background-color: #d8dae5;
817
- }
818
- .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn) svg path {
819
- stroke-width: 0.1;
820
- }
821
- .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).editDescBtn {
822
- padding: 0;
823
- margin-right: 1.25rem;
824
- }
825
- .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).editDescBtn :global(.btnContentWrapper) {
826
- display: flex;
827
- align-items: center;
828
- padding: 0;
829
- color: #12131a;
830
- }
831
- .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).editDescBtn :global(.btnContentWrapper) :global(.endBtnIcon) {
832
- margin-block: auto;
833
- }
834
- .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).editDescBtn :global(.btnContentWrapper) :global(.endBtnIcon) svg path {
835
- fill: #12131a;
836
- }
837
- .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).deleteParamBtn {
838
- padding: 0;
839
- }
840
- .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).deleteParamBtn :global(.btnContentWrapper) :global(.endBtnIcon) {
841
- margin-block: auto;
842
- }
843
- .apiInfoForm .paramsTable .paramDescContainer :global(.customBtn).deleteParamBtn :global(.btnContentWrapper) :global(.endBtnIcon) svg {
844
- width: 1.125rem;
845
- }
846
- .apiInfoForm .paramsTable .editDescTooltipContent {
847
- display: flex;
848
- flex-direction: column;
849
- gap: 0.625rem;
850
- padding-bottom: 0.625rem;
851
- }
852
- .apiInfoForm .paramsTable .editDescTooltipContent > *:not(.editDescTooltipContent_header) {
853
- margin-inline: 0.625rem;
854
- }
855
- .apiInfoForm .paramsTable .editDescTooltipContent .editDescTooltipContent_header {
856
- font-weight: 600;
857
- font-size: 0.875rem;
858
- line-height: 1.25rem;
859
- padding: 0.75rem 1.25rem;
860
- border-bottom: 1px solid #d8dae5;
861
- }
862
- .apiInfoForm .paramsTable :global(.requiredParam) :global(.headContainer)::after {
863
- content: "*";
864
- color: red;
865
- transform: translateX(0.125rem);
866
- }
867
- .apiInfoForm .apiDocRow {
868
- display: grid;
869
- grid-template-columns: 1fr 1fr;
870
- gap: 1.25rem;
871
- }
872
- .apiInfoForm .apiInfoForm_tagsChips {
873
- margin-top: -1.25rem;
874
- }
875
- .apiInfoForm .editDescTooltipContent {
876
- display: flex;
877
- flex-direction: column;
878
- gap: 0.625rem;
879
- padding-bottom: 0.625rem;
880
- }
881
- .apiInfoForm .editDescTooltipContent > *:not(.editDescTooltipContent_header) {
882
- margin-inline: 0.625rem;
883
- }
884
- .apiInfoForm .editDescTooltipContent .editDescTooltipContent_header {
885
- font-weight: 600;
886
- font-size: 0.875rem;
887
- line-height: 1.25rem;
888
- padding: 0.75rem 1.25rem;
889
- border-bottom: 1px solid #d8dae5;
890
- }
891
- .apiInfoForm :global(.requiredParam) :global(.headContainer)::after {
892
- content: "*";
893
- color: red;
894
- transform: translateX(0.125rem);
895
909
  }:root {
896
910
  --white: #fff;
897
911
  --Gray-5: #f1f2f6;
@@ -997,4 +1011,8 @@
997
1011
  }
998
1012
  .drawerItemContainer .color-red {
999
1013
  color: var(--color-error);
1014
+ }p.apiName {
1015
+ font-size: 40px;
1016
+ line-height: 30px;
1017
+ font-weight: 500;
1000
1018
  }
@@ -1,9 +1,10 @@
1
1
  import { TransformedMethod } from '../../types/layout.type';
2
- declare const MethodsAccordion: ({ method, path, setFieldValue, readOnly, }: {
2
+ import { Tags } from '@entities/openApi';
3
+ declare const MethodsAccordion: ({ method, path, setFieldValue, readOnly, tags, }: {
3
4
  method: TransformedMethod;
4
5
  path: string;
5
- setFieldValue?: (key: string, value: string) => void;
6
+ setFieldValue?: (key: string, value: string | string[]) => void;
6
7
  readOnly?: boolean;
7
- handleSave: () => void;
8
+ tags: Tags[];
8
9
  }) => import("react/jsx-runtime").JSX.Element;
9
10
  export default MethodsAccordion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "@digi-frontend/dgate-api-documentation",
3
- "version": "1.0.18",
2
+ "name": "@digi-frontend/dgate-api-documentation",
3
+ "version": "1.0.20",
4
4
  "main": "dist/src/index.js",
5
5
  "module": "dist/src/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -55,6 +55,19 @@
55
55
  }
56
56
  }
57
57
  }
58
+
59
+ &:not(:global(.disabled)):global(.success) {
60
+ :global(.endBtnIcon) {
61
+ margin-block: auto;
62
+
63
+ svg {
64
+ width: 1.125rem;
65
+ path {
66
+ fill: #3aaa35;
67
+ }
68
+ }
69
+ }
70
+ }
58
71
  }
59
72
  }
60
73
 
@@ -36,12 +36,12 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
36
36
  }, [])
37
37
 
38
38
  useEffect(() => {
39
- setTableRecords(generateTableData(tableData))
39
+ setTableRecords(generateTableRecords(tableData))
40
40
  }, [tableData])
41
41
 
42
42
  useEffect(() => {
43
43
  if (values.tags && values.tags.length) {
44
- setTableRecords(generateTableData(values.tags))
44
+ setTableRecords(generateTableRecords(values.tags))
45
45
  setTableData(values.tags)
46
46
  }
47
47
  }, [values.tags])
@@ -77,7 +77,7 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
77
77
 
78
78
  const saveNewRow = (tag) => {
79
79
  setTableData([...tableData, tag])
80
- const oldTags = values.tags || [];
80
+ const oldTags = values.tags || []
81
81
  setFieldValue(`tags`, [...oldTags, tag])
82
82
  }
83
83
 
@@ -88,7 +88,7 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
88
88
  setOpenDeleteDialog(true)
89
89
  }
90
90
 
91
- const generateTableData = (items) => {
91
+ const generateTableRecords = (items) => {
92
92
  return items.map((item, index) => ({
93
93
  id: index,
94
94
  tagName: item.name,
@@ -131,10 +131,19 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
131
131
  </div>
132
132
  }
133
133
  >
134
- {readOnly ? (
135
- <Button className={styles.editDescBtn} variant="link" color="action">
136
- {item.description ? item.description.substring(0, 12) : '-'}
137
- {item.description && item.description.length > 12 ? '...' : ''}
134
+ {readOnly || values.tags[index].description ? (
135
+ <Button
136
+ className={styles.editDescBtn}
137
+ variant="link"
138
+ color="action"
139
+ endIcon={<SVGLoader src={EditIcon} width="1.5rem" height="1.5rem" />}
140
+ >
141
+ {values.tags[index].description
142
+ ? values.tags[index].description.substring(0, 12)
143
+ : '-'}
144
+ {values.tags[index].description && values.tags[index].description.length > 12
145
+ ? '...'
146
+ : ''}
138
147
  </Button>
139
148
  ) : (
140
149
  <Button
@@ -143,7 +152,9 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
143
152
  color="action"
144
153
  endIcon={<SVGLoader src={EditIcon} width="1.5rem" height="1.5rem" />}
145
154
  >
146
- {readOnly || item.description ? 'View Description' : 'Add Description'}
155
+ {readOnly || values.tags[index].description
156
+ ? 'View Description'
157
+ : 'Add Description'}
147
158
  </Button>
148
159
  )}
149
160
  </Tooltip>
@@ -210,22 +221,22 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
210
221
  </div>
211
222
  }
212
223
  >
213
- {readOnly ? (
224
+ {readOnly || values.tags[index].externalDocs?.description ? (
214
225
  <Button
215
226
  className={styles.editDescBtn}
216
227
  variant="link"
217
228
  color="action"
229
+ endIcon={<SVGLoader src={EditIcon} width="1.5rem" height="1.5rem" />}
218
230
  onClick={() => {
219
- const a = document.createElement('a')
220
- a.href = item.externalDocs?.url
221
- a.target="_blank"
222
- a.click()
231
+ setDescription(item.externalDocs?.description)
232
+ setURL(item.externalDocs?.url)
223
233
  }}
224
234
  >
225
- {item?.externalDocs?.description
226
- ? item?.externalDocs?.description?.substring(0, 12)
235
+ {values.tags[index].externalDocs?.description
236
+ ? values.tags[index].externalDocs?.description?.substring(0, 12)
227
237
  : '-'}
228
- {item?.externalDocs?.description && item?.externalDocs?.description?.length > 12
238
+ {values.tags[index].externalDocs?.description &&
239
+ values.tags[index].externalDocs?.description?.length > 12
229
240
  ? '...'
230
241
  : ''}
231
242
  </Button>
@@ -1,7 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react'
2
2
  import styles from './LivePreview.module.scss'
3
3
  import SimpleLabelValue from '../../components/SimpleLabelValue'
4
-
5
4
  import MethodsAccordion from '../../components/MethodAccordion/MethodAccordion'
6
5
  import { TransformedOpenApi } from '../../types/transformedOpenApi'
7
6
  import { useFormikContext } from 'formik'
@@ -122,12 +121,37 @@ const LivePreview: React.FC<LivePreviewProps> = ({ transformedData }) => {
122
121
 
123
122
  <SimpleLabelValue key={'endpoints'} label={'Endpoints '} />
124
123
  {values.paths.map((path) => (
125
- <div className={styles.methodsContainer}>
126
- {path.methods
124
+ <div className={styles.methodsContainer} key={path.path}>
125
+ {Object.entries(
126
+ path.methods
127
127
  .sort((a, b) => methodColorMapping[a.type].order + methodColorMapping[b.type].order)
128
- .map((method, methodIndex) => (
129
- <MethodsAccordion readOnly method={method} path={path.path} />
130
- ))}
128
+ .reduce((groupedMethods, method) => {
129
+ // Handle methods without tags
130
+ const tags = method.tags?.length ? method?.tags : ['default'];
131
+
132
+ tags.forEach((tag) => {
133
+ if (!groupedMethods[tag]) {
134
+ groupedMethods[tag] = [];
135
+ }
136
+ groupedMethods[tag].push(method);
137
+ });
138
+
139
+ return groupedMethods;
140
+ }, {})
141
+ ).map(([tag, methods]) => (
142
+ <div key={tag}>
143
+ <h3>{tag}</h3>
144
+ {methods?.map((method, methodIndex) => (
145
+ <MethodsAccordion
146
+ readOnly
147
+ method={method}
148
+ path={path.path}
149
+ tags={values.tags}
150
+ handleSave={() => null}
151
+ />
152
+ ))}
153
+ </div>
154
+ ))}
131
155
  </div>
132
156
  ))}
133
157
  </div>
@@ -134,6 +134,19 @@
134
134
  }
135
135
  }
136
136
  }
137
+
138
+ &:not(:global(.disabled)):global(.success) {
139
+ :global(.endBtnIcon) {
140
+ margin-block: auto;
141
+
142
+ svg {
143
+ width: 1.125rem;
144
+ path {
145
+ fill: #3aaa35;
146
+ }
147
+ }
148
+ }
149
+ }
137
150
  }
138
151
  }
139
152
  }