-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Loris configuration(M2-6644) #1927
base: develop
Are you sure you want to change the base?
Conversation
# Conflicts: # src/svgSprite.ts
# Conflicts: # src/modules/Builder/features/BuilderAppletSettings/BuilderAppletSettings.utils.tsx # src/resources/app-en.json # src/resources/app-fr.json # src/shared/consts.tsx # src/shared/state/Applet/Applet.schema.ts
# Conflicts: # src/shared/features/AppletSettings/LiveResponseStreamingSetting/LiveResponseStreamingSetting.test.tsx
# Conflicts: # src/modules/Builder/api/api.ts
# Conflicts: # src/shared/consts.tsx
# Conflicts: # src/modules/Builder/features/BuilderAppletSettings/BuilderAppletSettings.tsx # src/modules/Builder/features/BuilderAppletSettings/BuilderAppletSettings.types.ts # src/modules/Builder/features/BuilderAppletSettings/BuilderAppletSettings.utils.tsx # src/modules/Builder/pages/BuilderApplet/BuilderApplet.utils.tsx
# Conflicts: # src/modules/Dashboard/api/api.ts # src/modules/Dashboard/api/api.types.ts # src/shared/components/FormComponents/SelectController/SelectController.tsx # src/shared/components/FormComponents/SelectController/SelectController.types.ts # src/shared/components/Table/Table.tsx # src/shared/state/Applet/Applet.schema.ts # src/shared/state/Workspaces/Workspaces.schema.ts # src/shared/types/featureFlags.ts
# Conflicts: # src/modules/Auth/state/Auth.thunk.ts # src/modules/Builder/features/BuilderAppletSettings/BuilderAppletSettings.tsx # src/shared/layouts/BaseLayout/components/LeftBar/LeftBar.tsx # src/shared/layouts/BaseLayout/components/LeftBar/LeftBar.utils.ts # src/shared/utils/featureFlags.ts
Release/1.38.0
Release/1.39.0
Release/1.40.0
Release/1.41.0
This pull request is automatically being deployed by Amplify Hosting (learn more). |
…tandards, method naming refactoring, types, bug fixes and other minor tweaks
export const enableIntegrationApi = (integrations: Integration[], signal?: AbortSignal) => | ||
authApiClient.post('/integrations/', integrations, { | ||
authApiClient.post('/integrations', integrations, { | ||
signal, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this endpoint doesn't exist anymore, it was replaced by saveIntegrationToApi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You sure? This is the one to save it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you're referencing a different backend branch, as I can see in the one I point to it is being used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one that saves the integration is the one you added as saveIntegrationToApi
, which takes type, config, etc as parameters. This is the dummy endpoint which didn't include any additional server information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Makes sense now, will change. Thanks!
@@ -994,5 +994,5 @@ export const disableIntegrationApi = (integrations: string[], signal?: AbortSign | |||
signal, | |||
}; | |||
|
|||
return authApiClient.delete('/integrations/', config); | |||
return authApiClient.delete('/integrations', config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for this endpoint, though the integration is not part of this PR so it's ok if you keep it for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, will remove it
@@ -437,4 +437,6 @@ export const observerStyles = { | |||
|
|||
export const enum IntegrationTypes { | |||
Loris = 'loris', | |||
LorisUpperCase = 'LORIS', // In the API the integration type is in uppercase in some endpoints and lowercase in others | |||
SampleIntegration = 'sample', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is SampleIntegration
? If it is meant as an example please add a comment explaining usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the sample as I understood you requested me to add, did I misunderstand it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The section I mentioned to include as example is for the configuration
param (currently declared as SaveIntegrationParams
)
export type FetchIntegrationProjectsParams = { | ||
hostname: string; | ||
username: string; | ||
password: string; | ||
}; | ||
|
||
export type SaveIntegrationParams = { | ||
appletId: string; | ||
hostname: string; | ||
project: string; | ||
username: string; | ||
password: string; | ||
integrationType: IntegrationTypes; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be refactored to better align with the BE object where Integration
has appletId, integrationType and configuration. Where configuration is different depending on the integrationType
.
The type for FetchIntegrationProjectsParams
is only valid for LorisIntegrationConfiguration
, where the password
is optional and only used for saving the new integration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I tried to do that, but was having issues. Will create a new interface and not use the applet one and it should be ok
// currently set as snake case on the API | ||
applet_id: string; | ||
integration_type: IntegrationTypes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if it is in a different branch other than loris-integration-2. Is it? I tried it and I get errors
@@ -437,4 +437,6 @@ export const observerStyles = { | |||
|
|||
export const enum IntegrationTypes { | |||
Loris = 'loris', | |||
LorisUpperCase = 'LORIS', // In the API the integration type is in uppercase in some endpoints and lowercase in others |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing where we use lowercase loris, and in any case it might be better to create a separate enum for that specific usage. I think all the new endpoints are using LORIS
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the endpoints you mentioned as replaced, but I'll double check and understand why. If necessary I create a separate type
}; | ||
|
||
export const hasLorisIntegrationOnState = (integrations?: Integration[]): boolean => | ||
Boolean(integrations?.some((i) => i.integrationType === IntegrationTypes.Loris)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the way it's being saved in the state
fix
orfeature
branches intodevelop
orrelease
branches viaSquash and Merge
(to keep clean history)📝 Description
🔗 Jira Ticket M2-6644
📸 Screenshots