Skip to content

Commit

Permalink
Remove auth and change what english chat is
Browse files Browse the repository at this point in the history
  • Loading branch information
RunarVestmann committed Oct 16, 2024
1 parent 0ae3dac commit a68d353
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 27 deletions.
16 changes: 2 additions & 14 deletions apps/web/components/ChatPanel/WatsonChatPanel/WatsonChatPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { SUBMIT_WATSON_ASSISTANT_CHAT_FEEDBACK } from '@island.is/web/screens/qu
import { ChatBubble } from '../ChatBubble'
import { WatsonChatPanelProps } from '../types'
import type { WatsonInstance, WatsonInstanceEvent } from './types'
import { onAuthenticatedWatsonAssistantChatLoad } from './utils'
import * as styles from './WatsonChatPanel.css'

const chatLog: WatsonInstanceEvent[] = []
Expand Down Expand Up @@ -334,7 +333,8 @@ export const WatsonChatPanel = (props: WatsonChatPanelProps) => {

if (
// Útlendingastofnun
props.integrationID !== '89a03e83-5c73-4642-b5ba-cd3771ceca54'
props.integrationID !== '89a03e83-5c73-4642-b5ba-cd3771ceca54' &&
props.integrationID !== '9e320784-ad44-4da9-9eb3-f305057a196a'
) {
// Keep the chat log in memory
instance.on({
Expand Down Expand Up @@ -370,18 +370,6 @@ export const WatsonChatPanel = (props: WatsonChatPanelProps) => {
})
}

if (
// Askur - Útlendingastofnun
props.integrationID === '89a03e83-5c73-4642-b5ba-cd3771ceca54'
) {
onAuthenticatedWatsonAssistantChatLoad(
instance,
namespace,
activeLocale,
'directorateOfImmigration',
)
}

if (onLoad) {
onLoad(instance)
}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/ChatPanel/WatsonChatPanel/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Locale } from '@island.is/shared/types'
import { uuid } from 'uuidv4'
import { ApolloClient, NormalizedCacheObject } from '@apollo/client'

import { Locale } from '@island.is/shared/types'
import { storageFactory } from '@island.is/shared/utils'
import initApollo from '@island.is/web/graphql/client'
import {
Expand Down
7 changes: 6 additions & 1 deletion apps/web/components/ChatPanel/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export type WatsonIntegration =
// Útlendingastofnun
| '89a03e83-5c73-4642-b5ba-cd3771ceca54'

// Útlendingastofnun - english
| '9e320784-ad44-4da9-9eb3-f305057a196a'

// Sjúkratryggingar
| 'e625e707-c9ce-4048-802c-c12b905c28be'

Expand Down Expand Up @@ -78,4 +81,6 @@ export type WatsonIntegration =

export type WatsonServiceInstance =
// Askur
'bc3d8312-d862-4750-b8bf-529db282050a'
| 'bc3d8312-d862-4750-b8bf-529db282050a'
// Útlendingastofnun - english
| '2529638b-503c-4374-955c-0310139ec177'
4 changes: 2 additions & 2 deletions apps/web/components/Organization/Wrapper/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export const watsonConfig: Record<
// Útlendingastofnun - Organization
// https://app.contentful.com/spaces/8k0h54kbe6bj/entries/77rXck3sISbMsUv7BO1PG2
'77rXck3sISbMsUv7BO1PG2': {
integrationID: '89a03e83-5c73-4642-b5ba-cd3771ceca54',
integrationID: '9e320784-ad44-4da9-9eb3-f305057a196a',
region: 'eu-gb',
serviceInstanceID: 'bc3d8312-d862-4750-b8bf-529db282050a',
serviceInstanceID: '2529638b-503c-4374-955c-0310139ec177',
showLauncher: false,
carbonTheme: 'g10',
namespaceKey: 'default',
Expand Down
5 changes: 2 additions & 3 deletions apps/web/components/ServiceWeb/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Locale } from '@island.is/shared/types'

import { WatsonChatPanelProps } from '@island.is/web/components'

import { BackgroundVariations, Options } from './types'
Expand Down Expand Up @@ -135,9 +134,9 @@ export const watsonConfig: Record<
namespaceKey: 'default',
},
[Organization.DIRECTORATE_OF_IMMIGRATION]: {
integrationID: '89a03e83-5c73-4642-b5ba-cd3771ceca54',
integrationID: '9e320784-ad44-4da9-9eb3-f305057a196a',
region: 'eu-gb',
serviceInstanceID: 'bc3d8312-d862-4750-b8bf-529db282050a',
serviceInstanceID: '2529638b-503c-4374-955c-0310139ec177',
showLauncher: false,
carbonTheme: 'g10',
namespaceKey: 'default',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Locale } from '@island.is/shared/types'

import {
LiveChatIncChatPanelProps,
WatsonChatPanelProps,
Expand Down Expand Up @@ -219,9 +218,9 @@ export const watsonConfig: Record<
// Útlendingastofnun - Organization
// https://app.contentful.com/spaces/8k0h54kbe6bj/entries/77rXck3sISbMsUv7BO1PG2
'77rXck3sISbMsUv7BO1PG2': {
integrationID: '89a03e83-5c73-4642-b5ba-cd3771ceca54',
integrationID: '9e320784-ad44-4da9-9eb3-f305057a196a',
region: 'eu-gb',
serviceInstanceID: 'bc3d8312-d862-4750-b8bf-529db282050a',
serviceInstanceID: '2529638b-503c-4374-955c-0310139ec177',
showLauncher: false,
carbonTheme: 'g10',
namespaceKey: 'default',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Locale } from '@island.is/shared/types'

import {
LiveChatIncChatPanelProps,
WatsonChatPanelProps,
Expand Down Expand Up @@ -47,9 +46,9 @@ export const watsonConfig: Record<
// Information for Ukrainian citizens
// https://app.contentful.com/spaces/8k0h54kbe6bj/entries/7GtuCCd7MEZhZKe0oXcHdb
'7GtuCCd7MEZhZKe0oXcHdb': {
integrationID: '89a03e83-5c73-4642-b5ba-cd3771ceca54',
integrationID: '9e320784-ad44-4da9-9eb3-f305057a196a',
region: 'eu-gb',
serviceInstanceID: 'bc3d8312-d862-4750-b8bf-529db282050a',
serviceInstanceID: '2529638b-503c-4374-955c-0310139ec177',
showLauncher: true,
carbonTheme: 'g10',
namespaceKey: 'ukrainian-citizens',
Expand Down

0 comments on commit a68d353

Please sign in to comment.