diff --git a/ui_src/src/components/customSelect/index.js b/ui_src/src/components/customSelect/index.js index dfedd337d..622004b9b 100644 --- a/ui_src/src/components/customSelect/index.js +++ b/ui_src/src/components/customSelect/index.js @@ -28,7 +28,7 @@ import pathDomains from '../../router'; const { Option } = Select; -const CustomSelect = ({ options, onChange, value, placeholder, type = 'schema', handleCreateNew }) => { +const CustomSelect = ({ options, onChange, value, placeholder, type = 'schema', handleCreateNew, showCreatedBy = true }) => { const history = useHistory(); const handleChange = (e) => { @@ -107,10 +107,12 @@ const CustomSelect = ({ options, onChange, value, placeholder, type = 'schema', />

{schema?.name || schema}

-

- {type === 'schema' ? <>{schema?.type} • : null} - {parsingDate(schema?.created_at)} -

+ {showCreatedBy && +

+ {type === 'schema' ? <>{schema?.type} • : null} + {parsingDate(schema?.created_at)} +

+ } ); diff --git a/ui_src/src/components/sdkExample/index.js b/ui_src/src/components/sdkExample/index.js index 6e5893aed..21cc50c45 100644 --- a/ui_src/src/components/sdkExample/index.js +++ b/ui_src/src/components/sdkExample/index.js @@ -55,7 +55,6 @@ loader.config({ monaco }); const tabs = ['Producer', 'Consumer']; const tabsProtocol = ['Generate token', 'Produce data', 'Consume data']; const selectProtocolOption = ['SDK', 'REST']; -const ExpandIcon = ({ isActive }) => collapse-arrow; const SdkExample = ({ consumer, showTabs = true, stationName, username, connectionCreds, withHeader = false }) => { const [langSelected, setLangSelected] = useState('Go'); @@ -497,7 +496,7 @@ const SdkExample = ({ consumer, showTabs = true, stationName, username, connecti

Client generator

- + )}
@@ -541,13 +540,11 @@ const SdkExample = ({ consumer, showTabs = true, stationName, username, connecti

Package installation

{SDK_CODE_EXAMPLE[langSelected].installation}

- +
-
- {showTabs && setTabValue(tabValue)} size="medium" />} - {!showTabs &&

{`Code snippet for ${tabValue === 'Producer' ? 'producing' : 'consuming'} data`}

} -
+ +
)} {protocolSelected === 'REST' && ( @@ -555,61 +552,51 @@ const SdkExample = ({ consumer, showTabs = true, stationName, username, connecti )} {
- }> - - -

Parameters

- -
- - -
- } - > -
- {(tabValue === 'SDK' || tabValueRest === 'Generate token') && withHeader && ( -
- - - - updateFormFields('userName', e)} - type="user" - handleCreateNew={() => addUserModalFlip(true)} - /> - - - - - - updateFormFields('password', e.target.value)} - onChange={(e) => updateFormFields('password', e.target.value)} - value={formFields.password} - /> - - -
- )} +
+ {(tabValue === 'SDK' || tabValueRest === 'Generate token') && withHeader && ( +
+ + + + updateFormFields('userName', e)} + type="user" + handleCreateNew={() => addUserModalFlip(true)} + showCreatedBy={false} + /> + + + + + + updateFormFields('password', e.target.value)} + onChange={(e) => updateFormFields('password', e.target.value)} + value={formFields.password} + /> + + +
+ )} - {protocolSelected === 'REST' && tabValueRest === 'Generate token' && ( - <> -
+ {protocolSelected === 'REST' && tabValueRest === 'Generate token' && ( + <> +
- + - - + + -
- - )} - {protocolSelected === 'REST' && tabValueRest !== 'Generate token' && ( - <> - - - updateFormFields('jwt', e.target.value)} - onChange={(e) => updateFormFields('jwt', e.target.value)} - value={formFields.jwt} - /> - - - )} - {(protocolSelected === 'SDK' || tabValueRest === 'Consume data') && ( - <> -
+
+ + )} + {protocolSelected === 'REST' && tabValueRest !== 'Generate token' && ( + <> + + + updateFormFields('jwt', e.target.value)} + onChange={(e) => updateFormFields('jwt', e.target.value)} + value={formFields.jwt} + /> + + + )} + {(protocolSelected === 'SDK' || tabValueRest === 'Consume data') && ( + <> +
- {(tabValue === 'Consumer' || tabValueRest === 'Consume data') && ( - - + {(tabValue === 'Consumer' || tabValueRest === 'Consume data') && ( + + - )} -
- - )} - {protocolSelected === 'REST' && tabValueRest === 'Consume data' && ( - <> -
+ )} +
+ + )} + {protocolSelected === 'REST' && tabValueRest === 'Consume data' && ( + <> +
- + - - + + +
+ + )} + {protocolSelected === 'SDK' && langSelected === 'Python' && tabValue === 'Producer' && ( +
+ + + + updateFormFields('blocking', !formFields.blocking)} + checked={formFields.blocking}/> + +
+ )} + {protocolSelected === 'SDK' && langSelected !== 'Python' && tabValue === 'Producer' && ( +
+ + + + updateFormFields('async', !formFields.async)} + checked={formFields.async}/> + +
+ )} + {((protocolSelected === 'SDK' && tabValue === 'Producer') || + (protocolSelected === 'REST' && tabValueRest === 'Produce data')) && ( +
+ + + updateFormFields('useHeaders', !formFields.useHeaders)} + checked={formFields.useHeaders} + /> + +
+ )} + {formFields.useHeaders && + ((protocolSelected === 'SDK' && tabValue === 'Producer') || + (protocolSelected === 'REST' && tabValueRest === 'Produce data')) && ( +
+ {formFields.headersList.map((header, index) => ( +
+ + + updateHeaders('key', e.target.value, index)} + onChange={(e) => updateHeaders('key', e.target.value, index)} + value={header.key} + /> + + + + + updateHeaders('value', e.target.value, index)} + onChange={(e) => updateHeaders('value', e.target.value, index)} + value={header.value} + /> + + + removeHeader(index)}/>
- - )} - {protocolSelected === 'SDK' && langSelected === 'Python' && tabValue === 'Producer' && ( -
- - - - updateFormFields('blocking', !formFields.blocking)} checked={formFields.blocking} /> - + ))} +
addHeader()}> + + Add more
- )} - {protocolSelected === 'SDK' && langSelected !== 'Python' && tabValue === 'Producer' && ( -
- - - - updateFormFields('async', !formFields.async)} checked={formFields.async} /> - -
- )} - {((protocolSelected === 'SDK' && tabValue === 'Producer') || - (protocolSelected === 'REST' && tabValueRest === 'Produce data')) && ( -
- - - updateFormFields('useHeaders', !formFields.useHeaders)} - checked={formFields.useHeaders} - /> - -
- )} - {formFields.useHeaders && - ((protocolSelected === 'SDK' && tabValue === 'Producer') || - (protocolSelected === 'REST' && tabValueRest === 'Produce data')) && ( -
- {formFields.headersList.map((header, index) => ( -
- - - - updateHeaders('key', e.target.value, index)} - onChange={(e) => updateHeaders('key', e.target.value, index)} - value={header.key} - /> - - - - - - updateHeaders('value', e.target.value, index)} - onChange={(e) => updateHeaders('value', e.target.value, index)} - value={header.value} - /> - - - removeHeader(index)} /> -
- ))} -
addHeader()}> - - Add more -
-
- )} -
- - +
+ )} +
} @@ -906,15 +899,14 @@ const SdkExample = ({ consumer, showTabs = true, stationName, username, connecti />
- +
-

Code Output

- +

Generated code

{protocolSelected === 'SDK' && SDK_CODE_EXAMPLE[langSelected]?.link && (
- +

{SDK_CODE_EXAMPLE[langSelected].title}

{SDK_CODE_EXAMPLE[langSelected].desc} @@ -942,12 +934,13 @@ const SdkExample = ({ consumer, showTabs = true, stationName, username, connecti

Generate a token

setGenerateModal(true)}> - + Generate JWT token
-
{generateEditor(REST_CODE_EXAMPLE[langSelected].langCode, codeExample.tokenGenerate)}
+
{generateEditor(REST_CODE_EXAMPLE[langSelected].langCode, codeExample.tokenGenerate)}
)} @@ -955,7 +948,8 @@ const SdkExample = ({ consumer, showTabs = true, stationName, username, connecti

Produce data

-
{generateEditor(REST_CODE_EXAMPLE[langSelected].langCode, codeExample.producer)}
+
{generateEditor(REST_CODE_EXAMPLE[langSelected].langCode, codeExample.producer)}
)} @@ -963,7 +957,8 @@ const SdkExample = ({ consumer, showTabs = true, stationName, username, connecti

Consumem data

-
{generateEditor(REST_CODE_EXAMPLE[langSelected].langCode, codeExample.consumer)}
+
{generateEditor(REST_CODE_EXAMPLE[langSelected].langCode, codeExample.consumer)}
)} diff --git a/ui_src/src/components/sdkExample/style.scss b/ui_src/src/components/sdkExample/style.scss index b312b1970..7a27ebeb1 100644 --- a/ui_src/src/components/sdkExample/style.scss +++ b/ui_src/src/components/sdkExample/style.scss @@ -5,6 +5,20 @@ height: calc(100% - 15px); margin-top: 15px; position: relative; + .header-section { + display: flex; + align-items: center; + gap: 10px; + .input-item { + width: 100%; + } + .remove-icon { + font-size: 30px; + cursor: pointer; + position: relative; + top: -5px; + } + } .username-section { display: flex; justify-content: space-between; @@ -50,8 +64,6 @@ overflow-y: auto; padding-right: 20px; .code-builder { - border: #e7e7e7 1px solid; - border-radius: 12px; margin-bottom: 20px; .ant-collapse { background: rgba(101, 87, 255, 0.1); @@ -83,10 +95,6 @@ color: #84818a; } .parameters-section { - background-color: #ffffff; - border-radius: 0px 0px 12px 12px; - position: relative; - padding: 10px 15px; .new-user { position: absolute; right: 15px; @@ -121,6 +129,7 @@ margin: 10px 0px; } .modal-header { + margin-bottom: 1rem; .header-img-container { background: rgba(101, 87, 255, 0.1); height: 45px; @@ -139,6 +148,7 @@ .modal-title-sdk { font-family: 'InterMedium'; font-size: 20px; + margin-bottom: 0!important; } p { margin-bottom: 0; @@ -199,7 +209,7 @@ border: 1px solid var(--gray); box-sizing: border-box; border-radius: 4px; - height: 540px; + height: 640px; overflow: auto; align-items: flex-start; display: flex; @@ -263,19 +273,14 @@ } } .code-output-title-code-example { - margin-top: 50px; + margin-top: 60px; } .code-output-title { - border-radius: 8px; - background: rgba(101, 87, 255, 0.1); - padding: 15px 20px; - margin-bottom: 20px; p { - margin-bottom: 5px; - color: #6557ff; - font-family: 'InterSemiBold'; - font-size: 16px; + font-family: 'InterMedium', sans-serif; + margin-bottom: 1rem; + font-size: 20px; } } } diff --git a/ui_src/src/components/titleComponent/style.scss b/ui_src/src/components/titleComponent/style.scss index 7551495a9..a9731964d 100644 --- a/ui_src/src/components/titleComponent/style.scss +++ b/ui_src/src/components/titleComponent/style.scss @@ -47,7 +47,7 @@ } .sub-header-title { font-family: 'InterMedium'; - font-size: 16px; + font-size: 14px; line-height: 20px; color: #2e2c34; margin-bottom: 8px;