From c384a679cbfc913b1f9295a9c67a3862d676e854 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Thu, 11 Aug 2022 12:11:37 +0200 Subject: [PATCH 1/6] form fix wip --- .../Dialogflow/ConnectNewDialogflow.tsx | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx b/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx index 8b895cb561..445deb8d98 100644 --- a/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx +++ b/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx @@ -26,6 +26,10 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur ); const [replyConfidenceLevel, setReplyConfidenceLevel] = useState(componentInfo?.replyConfidenceLevel || ''); const [isUpdateModalVisible, setIsUpdateModalVisible] = useState(false); + const [connectorStoreMessagesProcessorMaxWaitMillis, setConnectorStoreMessagesProcessorMaxWaitMillis] = useState(componentInfo?.connectorStoreMessagesProcessorMaxWaitMillis || ''); + const [connectorStoreMessagesProcessorCheckPeriodMillis, setConnectorStoreMessagesProcessorCheckPeriodMillis] = useState(componentInfo?.connectorStoreMessagesProcessorCheckPeriodMillis || ''); + const [defaultLanguage, setDefaultLanguage] = useState(componentInfo?.connectorDefaultLanguage || ''); + const {t} = useTranslation(); @@ -119,6 +123,51 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur fontClass="font-base" /> +
+ ) => setConnectorStoreMessagesProcessorMaxWaitMillis(e.target.value)} + label={t('ConnectorStoreMessagesProcessorMaxWaitMillis')} + placeholder={t('ConnectorStoreMessagesProcessorMaxWaitMillis')} + showLabelIcon + tooltipText={t('connectorStoreMessagesProcessorMaxWaitMillis')} + required + height={32} + fontClass="font-base" + /> +
+
+ ) => setConnectorStoreMessagesProcessorCheckPeriodMillis(e.target.value)} + label={t('ConnectorStoreMessagesProcessorCheckPeriodMillis')} + placeholder={t('ConnectorStoreMessagesProcessorCheckPeriodMillis')} + showLabelIcon + tooltipText={t('ConnectorStoreMessagesProcessorCheckPeriodMillis')} + required + height={32} + fontClass="font-base" + /> +
+
+ ) => setDefaultLanguage(e.target.value)} + label={t('DefaultLanguage')} + placeholder={t('DefaultLanguage')} + showLabelIcon + tooltipText={t('defaultLanguage')} + required + height={32} + fontClass="font-base" + /> +
); }; From e10d3b877de9a68401543494e19806d5f9c0267b Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Thu, 11 Aug 2022 15:36:40 +0200 Subject: [PATCH 2/6] wip --- .../Dialogflow/ConnectNewDialogflow.tsx | 4 +++- .../components/inputs/Input/index.tsx | 21 ++++++++++++------- .../components/inputs/Input/style.module.scss | 10 +++++++-- lib/typescript/translations/translations.ts | 20 ++++++++++++++++++ 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx b/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx index 445deb8d98..fa957a79ed 100644 --- a/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx +++ b/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx @@ -147,7 +147,8 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur label={t('ConnectorStoreMessagesProcessorCheckPeriodMillis')} placeholder={t('ConnectorStoreMessagesProcessorCheckPeriodMillis')} showLabelIcon - tooltipText={t('ConnectorStoreMessagesProcessorCheckPeriodMillis')} + tooltipText={t('connectorStoreMessagesProcessorCheckPeriodMillis')} + tooltipLink="https://airy.co/docs/enterprise/apps/dialogflow/deployment" required height={32} fontClass="font-base" @@ -163,6 +164,7 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur placeholder={t('DefaultLanguage')} showLabelIcon tooltipText={t('defaultLanguage')} + tooltipLink="https://airy.co/docs/enterprise/apps/dialogflow/deployment" required height={32} fontClass="font-base" diff --git a/lib/typescript/components/inputs/Input/index.tsx b/lib/typescript/components/inputs/Input/index.tsx index 34b2890be1..b9b984d332 100644 --- a/lib/typescript/components/inputs/Input/index.tsx +++ b/lib/typescript/components/inputs/Input/index.tsx @@ -250,8 +250,7 @@ class InputComponent extends Component { ref={node => { this.node = node; }} - className={styles.emojiDrawer} - > + className={styles.emojiDrawer}> ); @@ -263,6 +262,7 @@ class InputComponent extends Component { label, showLabelIcon, tooltipText, + tooltipLink, hideLabel, name, value, @@ -312,10 +312,17 @@ class InputComponent extends Component { )} {showLabelIcon && ( - <> +
- {tooltipText && {tooltipText}} - + {tooltipText && !tooltipLink && {tooltipText}} + {tooltipLink && ( + + + {tooltipText} + + + )} +
)} )} @@ -390,8 +397,7 @@ class InputComponent extends Component { type="button" onClick={this.handleEmojiDrawer} disabled={this.props.maxLength - value.length <= 0} - className={`${styles.emojiIcon} ${this.state.isShowingEmojiDrawer && styles.emojiIconActive}`} - > + className={`${styles.emojiIcon} ${this.state.isShowingEmojiDrawer && styles.emojiIconActive}`}> @@ -423,6 +429,7 @@ export interface InputProps { label?: string; showLabelIcon?: boolean; tooltipText?: string; + tooltipLink?: string; minWidth?: number; width?: number; diff --git a/lib/typescript/components/inputs/Input/style.module.scss b/lib/typescript/components/inputs/Input/style.module.scss index 030f41a7dc..0b5e09e539 100644 --- a/lib/typescript/components/inputs/Input/style.module.scss +++ b/lib/typescript/components/inputs/Input/style.module.scss @@ -230,13 +230,19 @@ color: var(--color-text-contrast); } -.infoCircle:hover ~ .infoCircleText { +.infoCircleContainer:hover ~ .infoCircleText { display: flex; position: relative; left: 8px; + background:yellow; +} + +.infoCircle:hover ~ .infoCircleText { + position: relative; + left: 8px; } -.infoCircle ~ .infoCircleText::after { +.infoCircleContainer ~ .infoCircleText::after { content: ''; position: absolute; top: 50%; diff --git a/lib/typescript/translations/translations.ts b/lib/typescript/translations/translations.ts index cc38af0964..df552125f0 100644 --- a/lib/typescript/translations/translations.ts +++ b/lib/typescript/translations/translations.ts @@ -298,6 +298,11 @@ const resources = { amountSuggestions: 'amount for suggestions', amountReplies: 'amount for replies', to: 'to', + connectorStoreMessagesProcessorMaxWaitMillis: + 'see docs:', + connectorStoreMessagesProcessorCheckPeriodMillis: + 'see docs:', + defaultLanguage: 'Default language', //Salesforce salesforceDescription: @@ -723,6 +728,11 @@ const resources = { fromCloudConsole: 'gegeben von der Cloud Console', amountSuggestions: 'Anzahl der Vorschläge', amountReplies: 'Anzahl der Antworten', + connectorStoreMessagesProcessorMaxWaitMillis: + 'Zeit, bevor die Nachricht durch andere Konnektoren im Airy-Cluster angereichert werden kann, bevor sie an Dialogflow gesendet wird', + connectorStoreMessagesProcessorCheckPeriodMillis: + 'Zeit, bevor die Nachricht von anderen Konnektoren angereichert werden kann, bevor sie an Dialogflow weitergeleitet wird', + defaultLanguage: 'Standardsprache', //Salesforce salesforceDescription: @@ -1125,6 +1135,12 @@ const resources = { amountSuggestions: 'niveau pour les suggestions', amountReplies: 'niveau pour les réponses', to: 'à', + connectorStoreMessagesProcessorMaxWaitMillis: + "délai avant que le message puisse être enrichi par d'autres connecteurs avant de l'envoyer à Dialogflow", + connectorStoreMessagesProcessorCheckPeriodMillis: + "délai avant que le message puisse être enrichi par d'autres connecteurs avant de le transmettre à Dialogflow", + defaultLanguage: 'Langue utilisée par défault', + //Salesforce salesforceDescription: 'Augmentez vos performances commerciales avec la plateforme CRM n° 1 au monde.', @@ -1562,6 +1578,10 @@ const resources = { fromCloudConsole: 'dado por la Cloud Console', amountSuggestions: 'nivel para sugerencias', amountReplies: 'nivel para respuestas', + connectorStoreMessagesProcessorMaxWaitMillis: + 'cantidad de tiempo antes de que el mensaje se pueda enriquecer con otros conectores en el clúster airy antes de enviarlo a Dialogflow', + connectorStoreMessagesProcessorCheckPeriodMillis: 'cantidad de tiempo antes de que otros conectores puedan enriquecer el mensaje antes de reenviarlo a Dialogflow', + defaultLanguage: 'idioma utilizado', //Salesforce salesforceDescription: 'Aumente sus resultados de ventas con la plataforma de CRM n.º 1 del mundo.', From 85e62d6db5fd54669bbe16420443c6350fe96aa7 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Thu, 11 Aug 2022 17:33:34 +0200 Subject: [PATCH 3/6] form update fix --- .../src/components/SourceInfo/index.tsx | 2 +- .../Connectors/ConnectorConfig/index.tsx | 13 ++++- .../Dialogflow/ConnectNewDialogflow.tsx | 57 ++++++++++++------- .../components/inputs/Input/index.tsx | 19 +++---- .../components/inputs/Input/style.module.scss | 10 +--- lib/typescript/translations/translations.ts | 42 +++++++------- 6 files changed, 80 insertions(+), 63 deletions(-) diff --git a/frontend/control-center/src/components/SourceInfo/index.tsx b/frontend/control-center/src/components/SourceInfo/index.tsx index 5d2e0ccbd9..3e4e65d3eb 100644 --- a/frontend/control-center/src/components/SourceInfo/index.tsx +++ b/frontend/control-center/src/components/SourceInfo/index.tsx @@ -161,7 +161,7 @@ export const getSourcesInfo = (): SourceInfo[] => { componentName: 'enterprise-dialogflow-connector', repository: 'airy-enterprise', itemInfoString: 'connectors', - docs: 'https://dialogflow.cloud.google.com/cx/projects', + docs: 'https://airy.co/docs/enterprise/apps/dialogflow/deployment', }, { type: Source.zendesk, diff --git a/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx b/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx index 01c7d08a89..c6f9a5e324 100644 --- a/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx +++ b/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx @@ -125,7 +125,15 @@ const ConnectorConfig = (props: ConnectorConfigProps) => { let payload: UpdateComponentConfigurationRequestPayload; if (connector === Source.dialogflow) { - const [projectId, appCredentials, suggestionConfidenceLevel, replyConfidenceLevel] = args; + const [ + projectId, + appCredentials, + suggestionConfidenceLevel, + replyConfidenceLevel, + processorWaitingTime, + processorCheckPeriod, + defaultLanguage, + ] = args; payload = { components: [ @@ -137,6 +145,9 @@ const ConnectorConfig = (props: ConnectorConfigProps) => { dialogflowCredentials: appCredentials, suggestionConfidenceLevel: suggestionConfidenceLevel, replyConfidenceLevel: replyConfidenceLevel, + connectorStoreMessagesProcessorMaxWaitMillis: processorWaitingTime, + connectorStoreMessagesProcessorCheckPeriodMillis: processorCheckPeriod, + connectorDefaultLanguage: defaultLanguage, }, }, ], diff --git a/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx b/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx index fa957a79ed..b525c01c32 100644 --- a/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx +++ b/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx @@ -11,7 +11,10 @@ type ConnectNewDialogflowProps = { projectId: string, appCredentials: string, suggestionConfidenceLevel: string, - replyConfidenceLevel: string + replyConfidenceLevel: string, + processorWaitingTime: number, + processorCheckPeriod: number, + defaultLanguage: string ) => void; isEnabled: boolean; isConfigured: boolean; @@ -26,10 +29,13 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur ); const [replyConfidenceLevel, setReplyConfidenceLevel] = useState(componentInfo?.replyConfidenceLevel || ''); const [isUpdateModalVisible, setIsUpdateModalVisible] = useState(false); - const [connectorStoreMessagesProcessorMaxWaitMillis, setConnectorStoreMessagesProcessorMaxWaitMillis] = useState(componentInfo?.connectorStoreMessagesProcessorMaxWaitMillis || ''); - const [connectorStoreMessagesProcessorCheckPeriodMillis, setConnectorStoreMessagesProcessorCheckPeriodMillis] = useState(componentInfo?.connectorStoreMessagesProcessorCheckPeriodMillis || ''); - const [defaultLanguage, setDefaultLanguage] = useState(componentInfo?.connectorDefaultLanguage || ''); - + const [processorWaitingTime, setProcessorWaitingTime] = useState( + componentInfo?.connectorStoreMessagesProcessorMaxWaitMillis || 5000 + ); + const [processorCheckPeriod, setProcessorCheckPeriod] = useState( + componentInfo?.connectorStoreMessagesProcessorCheckPeriodMillis || 2500 + ); + const [defaultLanguage, setDefaultLanguage] = useState(componentInfo?.connectorDefaultLanguage || 'en'); const {t} = useTranslation(); @@ -43,7 +49,15 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur }; const enableSubmitConfigData = () => { - createNewConnection(projectID, appCredentials, suggestionConfidenceLevel, replyConfidenceLevel); + createNewConnection( + projectID, + appCredentials, + suggestionConfidenceLevel, + replyConfidenceLevel, + processorWaitingTime, + processorCheckPeriod, + defaultLanguage + ); }; return ( @@ -126,13 +140,13 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur
) => setConnectorStoreMessagesProcessorMaxWaitMillis(e.target.value)} - label={t('ConnectorStoreMessagesProcessorMaxWaitMillis')} - placeholder={t('ConnectorStoreMessagesProcessorMaxWaitMillis')} + name="ProcessorWaitingTime" + value={processorWaitingTime} + onChange={(e: React.ChangeEvent) => setProcessorWaitingTime(e.target.value)} + label={t('processorWaitingTime')} + placeholder={t('processorWaitingTime')} showLabelIcon - tooltipText={t('connectorStoreMessagesProcessorMaxWaitMillis')} + tooltipText={t('waitingDefault')} required height={32} fontClass="font-base" @@ -141,14 +155,13 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur
) => setConnectorStoreMessagesProcessorCheckPeriodMillis(e.target.value)} - label={t('ConnectorStoreMessagesProcessorCheckPeriodMillis')} - placeholder={t('ConnectorStoreMessagesProcessorCheckPeriodMillis')} + name="processorCheckPeriod" + value={processorCheckPeriod} + onChange={(e: React.ChangeEvent) => setProcessorCheckPeriod(e.target.value)} + label={t('processorCheckPeriod')} + placeholder={t('processorCheckPeriod')} showLabelIcon - tooltipText={t('connectorStoreMessagesProcessorCheckPeriodMillis')} - tooltipLink="https://airy.co/docs/enterprise/apps/dialogflow/deployment" + tooltipText={t('checkDefault')} required height={32} fontClass="font-base" @@ -160,10 +173,10 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur name="DefaultLanguage" value={defaultLanguage} onChange={(e: React.ChangeEvent) => setDefaultLanguage(e.target.value)} - label={t('DefaultLanguage')} - placeholder={t('DefaultLanguage')} + label={t('defaultLanguage')} + placeholder={t('defaultLanguage')} showLabelIcon - tooltipText={t('defaultLanguage')} + tooltipText={t('defaultLanguageTooltip')} tooltipLink="https://airy.co/docs/enterprise/apps/dialogflow/deployment" required height={32} diff --git a/lib/typescript/components/inputs/Input/index.tsx b/lib/typescript/components/inputs/Input/index.tsx index b9b984d332..a5b6f01ca6 100644 --- a/lib/typescript/components/inputs/Input/index.tsx +++ b/lib/typescript/components/inputs/Input/index.tsx @@ -250,7 +250,8 @@ class InputComponent extends Component { ref={node => { this.node = node; }} - className={styles.emojiDrawer}> + className={styles.emojiDrawer} + >
); @@ -312,17 +313,10 @@ class InputComponent extends Component { )} {showLabelIcon && ( -
+ <> - {tooltipText && !tooltipLink && {tooltipText}} - {tooltipLink && ( - - - {tooltipText} - - - )} -
+ {tooltipText && {tooltipText}} + )}
)} @@ -397,7 +391,8 @@ class InputComponent extends Component { type="button" onClick={this.handleEmojiDrawer} disabled={this.props.maxLength - value.length <= 0} - className={`${styles.emojiIcon} ${this.state.isShowingEmojiDrawer && styles.emojiIconActive}`}> + className={`${styles.emojiIcon} ${this.state.isShowingEmojiDrawer && styles.emojiIconActive}`} + > diff --git a/lib/typescript/components/inputs/Input/style.module.scss b/lib/typescript/components/inputs/Input/style.module.scss index 0b5e09e539..030f41a7dc 100644 --- a/lib/typescript/components/inputs/Input/style.module.scss +++ b/lib/typescript/components/inputs/Input/style.module.scss @@ -230,19 +230,13 @@ color: var(--color-text-contrast); } -.infoCircleContainer:hover ~ .infoCircleText { - display: flex; - position: relative; - left: 8px; - background:yellow; -} - .infoCircle:hover ~ .infoCircleText { + display: flex; position: relative; left: 8px; } -.infoCircleContainer ~ .infoCircleText::after { +.infoCircle ~ .infoCircleText::after { content: ''; position: absolute; top: 50%; diff --git a/lib/typescript/translations/translations.ts b/lib/typescript/translations/translations.ts index df552125f0..5a41af20e4 100644 --- a/lib/typescript/translations/translations.ts +++ b/lib/typescript/translations/translations.ts @@ -298,11 +298,12 @@ const resources = { amountSuggestions: 'amount for suggestions', amountReplies: 'amount for replies', to: 'to', - connectorStoreMessagesProcessorMaxWaitMillis: - 'see docs:', - connectorStoreMessagesProcessorCheckPeriodMillis: - 'see docs:', + processorWaitingTime: 'Processor waiting time', + processorCheckPeriod: 'Processor check period', + waitingDefault: 'Default value: 5000', + checkDefault: 'Default value: 2500', defaultLanguage: 'Default language', + defaultLanguageTooltip: 'Default value: en', //Salesforce salesforceDescription: @@ -728,11 +729,12 @@ const resources = { fromCloudConsole: 'gegeben von der Cloud Console', amountSuggestions: 'Anzahl der Vorschläge', amountReplies: 'Anzahl der Antworten', - connectorStoreMessagesProcessorMaxWaitMillis: - 'Zeit, bevor die Nachricht durch andere Konnektoren im Airy-Cluster angereichert werden kann, bevor sie an Dialogflow gesendet wird', - connectorStoreMessagesProcessorCheckPeriodMillis: - 'Zeit, bevor die Nachricht von anderen Konnektoren angereichert werden kann, bevor sie an Dialogflow weitergeleitet wird', - defaultLanguage: 'Standardsprache', + processorWaitingTime: 'Prozessor Wartezeit', + processorCheckPeriod: 'Prozessorprüfungszeitraum', + waitingDefault: 'Standardwert: 5000', + checkDefault: 'Standardwert: 2500', + defaultLanguage: 'Standardsprache', + defaultLanguageTooltip: 'Standardwert: en', //Salesforce salesforceDescription: @@ -1135,12 +1137,12 @@ const resources = { amountSuggestions: 'niveau pour les suggestions', amountReplies: 'niveau pour les réponses', to: 'à', - connectorStoreMessagesProcessorMaxWaitMillis: - "délai avant que le message puisse être enrichi par d'autres connecteurs avant de l'envoyer à Dialogflow", - connectorStoreMessagesProcessorCheckPeriodMillis: - "délai avant que le message puisse être enrichi par d'autres connecteurs avant de le transmettre à Dialogflow", - defaultLanguage: 'Langue utilisée par défault', - + processorWaitingTime: 'Délai du processeur', + processorCheckPeriod: 'Délai de vérification du processeur', + waitingDefault: 'valeur par défaut: 5000', + checkDefault: 'valeur par défaut: 2500', + defaultLanguage: 'Langue utilisée', + defaultLanguageTooltip: 'valeur par défaut: en', //Salesforce salesforceDescription: 'Augmentez vos performances commerciales avec la plateforme CRM n° 1 au monde.', @@ -1578,10 +1580,12 @@ const resources = { fromCloudConsole: 'dado por la Cloud Console', amountSuggestions: 'nivel para sugerencias', amountReplies: 'nivel para respuestas', - connectorStoreMessagesProcessorMaxWaitMillis: - 'cantidad de tiempo antes de que el mensaje se pueda enriquecer con otros conectores en el clúster airy antes de enviarlo a Dialogflow', - connectorStoreMessagesProcessorCheckPeriodMillis: 'cantidad de tiempo antes de que otros conectores puedan enriquecer el mensaje antes de reenviarlo a Dialogflow', - defaultLanguage: 'idioma utilizado', + processorWaitingTime: 'Tiempo de espera del procesador', + processorCheckPeriod: 'Período de verificación del procesador', + waitingDefault: 'valor por defecto: 5000', + checkDefault: 'valor por defecto: 2500', + defaultLanguage: 'Idioma por defecto', + defaultLanguageTooltip: 'valor por defecto: en', //Salesforce salesforceDescription: 'Aumente sus resultados de ventas con la plataforma de CRM n.º 1 del mundo.', From 7f49f95b2119e2639283fe77210671416fc1710f Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Fri, 12 Aug 2022 10:57:29 +0200 Subject: [PATCH 4/6] dialogflow fix --- .../src/pages/Connectors/ConnectorConfig/index.tsx | 2 +- .../Providers/Dialogflow/ConnectNewDialogflow.tsx | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx b/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx index c6f9a5e324..fa576d2705 100644 --- a/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx +++ b/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx @@ -121,7 +121,7 @@ const ConnectorConfig = (props: ConnectorConfigProps) => { } }, [config, connectorInfo]); - const createNewConnection = (...args: string[]) => { + const createNewConnection = (...args: (string | number)[]) => { let payload: UpdateComponentConfigurationRequestPayload; if (connector === Source.dialogflow) { diff --git a/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx b/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx index b525c01c32..c12ef34aab 100644 --- a/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx +++ b/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx @@ -12,8 +12,8 @@ type ConnectNewDialogflowProps = { appCredentials: string, suggestionConfidenceLevel: string, replyConfidenceLevel: string, - processorWaitingTime: number, - processorCheckPeriod: number, + processorWaitingTime: string, + processorCheckPeriod: string, defaultLanguage: string ) => void; isEnabled: boolean; @@ -66,7 +66,15 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur isUpdateModalVisible={isUpdateModalVisible} setIsUpdateModalVisible={setIsUpdateModalVisible} enableSubmitConfigData={enableSubmitConfigData} - disabled={!projectID || !appCredentials || !suggestionConfidenceLevel || !replyConfidenceLevel} + disabled={ + !projectID || + !appCredentials || + !suggestionConfidenceLevel || + !replyConfidenceLevel || + !processorWaitingTime || + !processorCheckPeriod || + !defaultLanguage + } isConfigured={isConfigured} updateConfig={updateConfig} > From 1e9556be121421aa864125aeff0c90778934af99 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Fri, 12 Aug 2022 11:13:40 +0200 Subject: [PATCH 5/6] fixed docs --- docs/docs/api/endpoints/components.md | 2 +- .../src/pages/Connectors/ConnectorConfig/index.tsx | 2 +- lib/typescript/components/inputs/Input/index.tsx | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/docs/api/endpoints/components.md b/docs/docs/api/endpoints/components.md index ab22e62c47..f1244b166f 100644 --- a/docs/docs/api/endpoints/components.md +++ b/docs/docs/api/endpoints/components.md @@ -172,7 +172,7 @@ Uninstall an existing component. ```json { - "name": "airy-enterprise/dialogflow-connector" + "name": "airy-enterprise/enterprise-dialogflow-connector" } ``` diff --git a/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx b/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx index fa576d2705..c6f9a5e324 100644 --- a/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx +++ b/frontend/control-center/src/pages/Connectors/ConnectorConfig/index.tsx @@ -121,7 +121,7 @@ const ConnectorConfig = (props: ConnectorConfigProps) => { } }, [config, connectorInfo]); - const createNewConnection = (...args: (string | number)[]) => { + const createNewConnection = (...args: string[]) => { let payload: UpdateComponentConfigurationRequestPayload; if (connector === Source.dialogflow) { diff --git a/lib/typescript/components/inputs/Input/index.tsx b/lib/typescript/components/inputs/Input/index.tsx index a5b6f01ca6..34b2890be1 100644 --- a/lib/typescript/components/inputs/Input/index.tsx +++ b/lib/typescript/components/inputs/Input/index.tsx @@ -263,7 +263,6 @@ class InputComponent extends Component { label, showLabelIcon, tooltipText, - tooltipLink, hideLabel, name, value, @@ -424,7 +423,6 @@ export interface InputProps { label?: string; showLabelIcon?: boolean; tooltipText?: string; - tooltipLink?: string; minWidth?: number; width?: number; From 514e0fd760f86c8ce82eef4ee9b55cb51a189f5c Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Fri, 12 Aug 2022 14:28:05 +0200 Subject: [PATCH 6/6] type fix --- .../Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx b/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx index c12ef34aab..86b145ea26 100644 --- a/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx +++ b/frontend/control-center/src/pages/Connectors/Providers/Dialogflow/ConnectNewDialogflow.tsx @@ -30,10 +30,10 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur const [replyConfidenceLevel, setReplyConfidenceLevel] = useState(componentInfo?.replyConfidenceLevel || ''); const [isUpdateModalVisible, setIsUpdateModalVisible] = useState(false); const [processorWaitingTime, setProcessorWaitingTime] = useState( - componentInfo?.connectorStoreMessagesProcessorMaxWaitMillis || 5000 + componentInfo?.connectorStoreMessagesProcessorMaxWaitMillis || '5000' ); const [processorCheckPeriod, setProcessorCheckPeriod] = useState( - componentInfo?.connectorStoreMessagesProcessorCheckPeriodMillis || 2500 + componentInfo?.connectorStoreMessagesProcessorCheckPeriodMillis || '2500' ); const [defaultLanguage, setDefaultLanguage] = useState(componentInfo?.connectorDefaultLanguage || 'en'); @@ -185,7 +185,6 @@ export const ConnectNewDialogflow = ({createNewConnection, isEnabled, isConfigur placeholder={t('defaultLanguage')} showLabelIcon tooltipText={t('defaultLanguageTooltip')} - tooltipLink="https://airy.co/docs/enterprise/apps/dialogflow/deployment" required height={32} fontClass="font-base"