-
Notifications
You must be signed in to change notification settings - Fork 70
feat(widget-cc-station-login): Spark 575845 login widget #239
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
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
383aafc
fix: convert npm to yarn
mkesavan13 520fac9
Merge remote-tracking branch 'upstream/master' into convert_to_yarn
mkesavan13 a9d5669
fix: yarn lock
mkesavan13 c9fe972
fix: rename folder to match package name
mkesavan13 6d24f89
fix: move to yarn 4.5.1
mkesavan13 09adcc5
fix: nitpick self review comments
mkesavan13 debdaaa
feat(cc-widgets): inital-packages-setup
f775ae2
fix(cc-widgets): move-widgets-inside-webex-folder
11a111b
fix(cc-widgets): remove-yarn-changes
840074c
fix(cc-widgets): added-babel-webpack-configs
72173d2
feat(setup): update-setup
f195b14
fix(cc-widgets): add-react-w2x-and-mobx
d8309fe
feat(cc-widgets): add-tests-for-widgets
5ce6996
feat(react-samples): add-widgets-samples-with-react
6505954
feat(cc-widgets): samples-app-for-widgets-as-web-component
e1ca859
fix(cc-widgets): review-comments
842e311
Merge remote-tracking branch 'upstream/feat/cc-widgets' into packages…
0aa1ad6
fix(cc-widgets): create-common-webpack-config
dd165c9
fix(cc-widgets): add-ts-doc-fix-babelrc
e3d4569
fix(cc-widgets): minor-fixes
e0646ad
fix(webpack): remove-react-react-dom-as-external
b6a0f69
feat(cc-widgets): review-comments
1cfd42a
feat(cc-widgets): add-home-page-for-samples
dd7a176
feat(station-login): Added code for UI and functional logic for stati…
Kesari3008 de0be73
feat(station-login): tested and refined changes
Kesari3008 cddf823
fix(station-login): latest merge
Kesari3008 091c3a9
feat(station-login): review comments
Kesari3008 692fed1
feat(station-login): review comments
Kesari3008 e1ed912
feat(station-login): review comments 2
Kesari3008 0771768
feat(station-login): tests updated
Kesari3008 6980358
feat(station-login): minor change
Kesari3008 2f38760
feat(station-login): styles fixes
Kesari3008 9339aea
feat(station-login): review comments
Kesari3008 e965f91
feat(station-login): init function changes
Kesari3008 97e5aa6
feat(station-login): changes in samples
Kesari3008 b774f9d
feat(station-login): fixed tests
Kesari3008 7829e0c
feat(station-login): yarn file update
Kesari3008 ebf602f
feat(station-login): callback comment addressed
Kesari3008 b7c3104
feat(station-login): merge conflict resolution
Kesari3008 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| import store from '@webex/cc-store'; | ||
| import '@webex/cc-station-login'; | ||
| import '@webex/cc-user-state'; | ||
|
|
||
| //@ts-ignore | ||
| window.store = store; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,39 @@ | ||
| export const useStationLogin = () => { | ||
| return {name: 'StationLogin'}; | ||
| }; | ||
| import {useState} from "react"; | ||
| import {StationLoginSuccess, StationLogoutSuccess} from '@webex/plugin-cc'; | ||
| import {UseStationLoginProps} from "./station-login/station-login.types"; | ||
|
|
||
| export const useStationLogin = (props: UseStationLoginProps) => { | ||
| const cc = props.cc; | ||
| const loginCb = props.onLogin; | ||
| const logoutCb = props.onLogout; | ||
| const [dialNumber, setDialNumber] = useState(''); | ||
| const [deviceType, setDeviceType] = useState(''); | ||
| const [team, setTeam] = useState(''); | ||
| const [loginSuccess, setLoginSuccess] = useState<StationLoginSuccess>(); | ||
| const [loginFailure, setLoginFailure] = useState<Error>(); | ||
| const [logoutSuccess, setLogoutSuccess] = useState<StationLogoutSuccess>(); | ||
|
|
||
| const login = () => { | ||
| cc.stationLogin({teamId: team, loginOption: deviceType, dialNumber: dialNumber}) | ||
| .then((res: StationLoginSuccess) => { | ||
| setLoginSuccess(res); | ||
| loginCb(); | ||
| }).catch((error: Error) => { | ||
| console.error(error); | ||
| setLoginFailure(error); | ||
| }); | ||
| }; | ||
|
|
||
| const logout = () => { | ||
| cc.stationLogout({logoutReason: 'User requested logout'}) | ||
| .then((res: StationLogoutSuccess) => { | ||
| setLogoutSuccess(res); | ||
| logoutCb(); | ||
| }).catch((error: any) => { | ||
| console.error(error); | ||
| }); | ||
| }; | ||
|
|
||
| return {name: 'StationLogin', setDeviceType, setDialNumber, setTeam, login, logout, loginSuccess, loginFailure, logoutSuccess}; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
139 changes: 131 additions & 8 deletions
139
packages/contact-center/station-login/src/station-login/station-login.presentational.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.