-
Notifications
You must be signed in to change notification settings - Fork 55
fix(store): minor-fixes-after-storeEventsWrapper #390
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
Changes from all commits
57f46e2
d83f435
6ddb82f
f4cf136
445e805
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ const StationLoginComponent: React.FunctionComponent<StationLoginProps> = ({onLo | |
onLogin, | ||
onLogout, | ||
logger, | ||
isAgentLoggedIn, | ||
deviceType, | ||
}); | ||
|
||
|
@@ -22,8 +21,10 @@ const StationLoginComponent: React.FunctionComponent<StationLoginProps> = ({onLo | |
teams, | ||
loginOptions, | ||
deviceType, | ||
isAgentLoggedIn, | ||
showMultipleLoginAlert, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Original comment- we can move showMultipleLoginAlert to results as we already have it rather than putting it directly in the presentation component Moved |
||
}; | ||
return <StationLoginPresentational {...props} showMultipleLoginAlert={showMultipleLoginAlert} />; | ||
return <StationLoginPresentational {...props} />; | ||
}; | ||
|
||
const StationLogin = observer(StationLoginComponent); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,11 +37,6 @@ class Store implements IStore { | |
constructor() { | ||
makeAutoObservable(this, { | ||
cc: observable.ref, | ||
currentTask: observable, // Make currentTask observable | ||
incomingTask: observable, | ||
taskList: observable, | ||
wrapupRequired: observable, | ||
currentState: observable, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Store is already updating these values and the latest values are reaching the components, so we dont need them as observable here, makeAutoObservable method is doing this for us. |
||
}); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ enum CC_EVENTS{ | |
|
||
export type { | ||
IContactCenter, | ||
ITask, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Importing ITask from cc-sdk and exporting it from store, all the types from cc-sdk wll be imported and exported from the store, this will ensure cc-store is the only place where we use cc-sdk as a dependency |
||
Profile, | ||
Team, | ||
AgentLogin, | ||
|
@@ -106,7 +107,7 @@ export type { | |
IStore, | ||
ILogger, | ||
IWrapupCode, | ||
IStoreWrapper | ||
IStoreWrapper, | ||
} | ||
|
||
export { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
import {IStoreWrapper, IStore, InitParams, TASK_EVENTS, CC_EVENTS, IWrapupCode, WithWebex} from './store.types'; | ||
import {ITask} from '@webex/plugin-cc'; | ||
import { | ||
IStoreWrapper, | ||
IStore, | ||
InitParams, | ||
TASK_EVENTS, | ||
CC_EVENTS, | ||
IWrapupCode, | ||
WithWebex, | ||
IContactCenter, | ||
ITask, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ITask imported from store/types |
||
} from './store.types'; | ||
import Store from './store'; | ||
import {runInAction} from 'mobx'; | ||
|
||
|
@@ -235,14 +244,15 @@ class StoreWrapper implements IStoreWrapper { | |
} | ||
}; | ||
|
||
setupIncomingTaskHandler = (ccSDK: any) => { | ||
setupIncomingTaskHandler = (ccSDK: IContactCenter) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed any type |
||
ccSDK.on(TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask); | ||
|
||
ccSDK.on(CC_EVENTS.AGENT_STATE_CHANGE, this.handleStateChange); | ||
ccSDK.on(CC_EVENTS.AGENT_MULTI_LOGIN, this.handleMultiLoginCloseSession); | ||
ccSDK.on(TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate); | ||
|
||
return () => { | ||
// TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-617635, remove event listeners after logout | ||
ccSDK.off(TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask); | ||
ccSDK.off(CC_EVENTS.AGENT_STATE_CHANGE, this.handleStateChange); | ||
ccSDK.off(CC_EVENTS.AGENT_MULTI_LOGIN, this.handleMultiLoginCloseSession); | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
original comment- See if we can remove the isAgentLogged in props as we already have this in the store
Removed the local state