@digi-frontend/dgate-api-documentation 1.0.12 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digi-frontend/dgate-api-documentation",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "main": "dist/src/index.js",
5
5
  "module": "dist/src/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -213,6 +213,7 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
213
213
  onClick={() => {
214
214
  const a = document.createElement('a')
215
215
  a.href = item.externalDocs?.url
216
+ a.target="_blank"
216
217
  a.click()
217
218
  }}
218
219
  >
@@ -29,7 +29,6 @@ const LivePreview: React.FC<LivePreviewProps> = ({ transformedData }) => {
29
29
  : null
30
30
 
31
31
  useEffect(() => {
32
- console.log({updated: values.tags})
33
32
  if (values.tags && values.tags.length) {
34
33
  setTableRecords(generateTableData(values.tags, true))
35
34
  setTableData(values.tags)
@@ -42,79 +41,24 @@ const LivePreview: React.FC<LivePreviewProps> = ({ transformedData }) => {
42
41
  tagName: item.name,
43
42
  description: (
44
43
  <div className={styles.paramDescContainer}>
45
- <Tooltip
46
- arrowWithBorder
47
- placement="bottom-end"
48
- type="function"
49
- trigger="click"
50
- delay={[0, 0]}
51
- onCreate={(instance) =>
52
- setTooltipRefs((prev) => ({
53
- ...prev,
54
- [index]: instance,
55
- }))
56
- }
57
- content={
58
- <div className={styles.editDescTooltipContent}>
59
- <p className={styles.editDescTooltipContent_header}>Description</p>
60
- <TextArea
61
- placeholder="Describe parameter..."
62
- value={item.description}
63
- disabled={readOnly}
64
- onChange={(value) => null}
65
- />
66
- </div>
67
- }
68
- >
69
- <Button className={styles.editDescBtn} variant="link" color="action">
70
- {item.description ? item.description.substring(0, 12) : '-'}
71
- {item.description && item.description.length > 12 ? '...' : ''}
72
- </Button>
73
- </Tooltip>
44
+ <Button className={styles.editDescBtn} variant="link" color="action">
45
+ {item.description ? item.description.substring(0, 12) : '-'}
46
+ {item.description && item.description.length > 12 ? '...' : ''}
47
+ </Button>
74
48
  </div>
75
49
  ),
76
50
  externalDocs: (
77
51
  <div className={styles.paramDescContainer}>
78
- <Tooltip
79
- arrowWithBorder
80
- placement="bottom-end"
81
- type="function"
82
- trigger="click"
83
- delay={[0, 0]}
84
- onCreate={(instance) =>
85
- setExternalTooltipRefs((prev) => ({
86
- ...prev,
87
- [index]: instance,
88
- }))
89
- }
90
- content={
91
- <div className={styles.editDescTooltipContent}>
92
- <p className={styles.editDescTooltipContent_header}>External Docs Description</p>
93
- <TextArea
94
- placeholder="Describe External Doc..."
95
- value={item.externalDocs?.description}
96
- disabled={readOnly}
97
- onChange={(value) => null}
98
- />
99
- <p className={styles.editDescTooltipContent_header}>External Docs Link</p>
100
- <TextArea
101
- placeholder="External Docs Link..."
102
- value={item.externalDocs?.url}
103
- disabled={readOnly}
104
- onChange={(value) => null}
105
- />
106
- </div>
107
- }
108
- >
109
- <Button
52
+ {item.externalDocs && item.externalDocs.url && item.externalDocs.url != '-' ? (
53
+ <a
110
54
  className={styles.editDescBtn}
111
- variant="link"
112
- color="action"
113
- onClick={() => {
114
- const a = document.createElement('a')
115
- a.href = item.externalDocs?.url
116
- a.click()
117
- }}
55
+ href={
56
+ item.externalDocs?.url && item.externalDocs?.url.indexOf('http') > -1
57
+ ? item.externalDocs?.url
58
+ : `https://${item.externalDocs?.url}`
59
+ }
60
+ rel="noopener noreferrer"
61
+ target="_blank"
118
62
  >
119
63
  {item?.externalDocs?.description
120
64
  ? item?.externalDocs?.description?.substring(0, 12)
@@ -122,8 +66,15 @@ const LivePreview: React.FC<LivePreviewProps> = ({ transformedData }) => {
122
66
  {item?.externalDocs?.description && item?.externalDocs?.description?.length > 12
123
67
  ? '...'
124
68
  : ''}
69
+ </a>
70
+ ) : (
71
+ <Button className={styles.editDescBtn} variant="link" color="action">
72
+ {item.description ? item.description.substring(0, 12) : '-'}
73
+ {item.description && item.description.length > 12 ? '...' : ''}
125
74
  </Button>
126
- </Tooltip>
75
+ )}
76
+
77
+ {/* </Tooltip> */}
127
78
 
128
79
  {!readOnly && <div className={styles.paramDescContainer_separator}></div>}
129
80
 
@@ -156,12 +107,9 @@ const LivePreview: React.FC<LivePreviewProps> = ({ transformedData }) => {
156
107
  value={info?.description || '-'}
157
108
  />
158
109
 
159
- <SimpleLabelValue
160
- key={'tags'}
161
- label={'Tags: '}
162
- />
110
+ <SimpleLabelValue key={'tags'} label={'Tags: '} />
163
111
  <TagsTable
164
- id="tags-table"
112
+ id="tags-table"
165
113
  data={tableRecords}
166
114
  headCells={tagsTableHeaders}
167
115
  isFormOpen={false}
@@ -216,16 +216,13 @@ const TagsTable = ({ id, headCells, data, isFormOpen, setIsFormOpen, saveNewRow,
216
216
  }
217
217
  >
218
218
  {readOnly ? (
219
- <Button
219
+ <a
220
220
  className={_styles.editDescBtn}
221
221
  variant="link"
222
222
  color="action"
223
- onClick={() => {
224
- const a = document.createElement('a')
225
- a.href = values.externalDocs?.url
226
- a.target = '_blank'
227
- a.click()
228
- }}
223
+ href={values.externalDocs?.url}
224
+ target='_blank'
225
+
229
226
  >
230
227
  {values?.externalDocs?.description
231
228
  ? values?.externalDocs?.description?.substring(0, 12)
@@ -234,7 +231,7 @@ const TagsTable = ({ id, headCells, data, isFormOpen, setIsFormOpen, saveNewRow,
234
231
  values?.externalDocs?.description?.length > 12
235
232
  ? '...'
236
233
  : ''}
237
- </Button>
234
+ </a>
238
235
  ) : (
239
236
  <Button
240
237
  className={_styles.editDescBtn}