@placetime/corptime-conference 0.0.13 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@placetime/corptime-conference",
3
- "version": "0.0.13",
3
+ "version": "1.0.0",
4
4
  "description": "React Native SDK from Corptime-Conference",
5
5
  "main": "index.tsx",
6
6
  "license": "Apache-2.0",
@@ -39,13 +39,6 @@ import { IReloadNowOptions, IStore } from './types';
39
39
 
40
40
  export * from './actions.any';
41
41
 
42
- export function setRoomNameGlobal(roomName: string) {
43
- return {
44
- type: SET_ROOM_NAME,
45
- roomName,
46
- }
47
- }
48
-
49
42
  /**
50
43
  * Triggers an in-app navigation to a specific route. Allows navigation to be
51
44
  * abstracted between the mobile/React Native and Web/React applications.
@@ -120,6 +120,12 @@ export function maybeRedirectToWelcomePage(options: { feedbackSubmitted?: boolea
120
120
  enableClosePage
121
121
  } = getState()['features/base/config'];
122
122
 
123
+ const { jwt } = getState()['features/base/jwt'];
124
+ // save whether current user is guest or not, and pass auth token,
125
+ // before navigating to close page
126
+ window.sessionStorage.setItem('guest', (!jwt).toString());
127
+ window.sessionStorage.setItem('jwt', jwt ?? '');
128
+
123
129
  // if close page is enabled redirect to it, without further action
124
130
  if (enableClosePage) {
125
131
  if (isVpaasMeeting(getState())) {
@@ -135,15 +141,9 @@ export function maybeRedirectToWelcomePage(options: { feedbackSubmitted?: boolea
135
141
  return;
136
142
  }
137
143
 
138
- const { jwt } = getState()['features/base/jwt'];
139
144
 
140
145
  let hashParam;
141
146
 
142
- // save whether current user is guest or not, and pass auth token,
143
- // before navigating to close page
144
- window.sessionStorage.setItem('guest', (!jwt).toString());
145
- window.sessionStorage.setItem('jwt', jwt ?? '');
146
-
147
147
  let path = 'close.html';
148
148
 
149
149
  if (interfaceConfig.SHOW_PROMOTIONAL_CLOSE_PAGE) {
@@ -176,6 +176,12 @@ export function maybeRedirectToWelcomePage(options: { feedbackSubmitted?: boolea
176
176
  dispatch(redirectWithStoredParams('/'));
177
177
  },
178
178
  options.showThankYou ? 3000 : 500);
179
+ } else {
180
+ setTimeout(
181
+ () => {
182
+ window.location.reload();
183
+ },
184
+ 10);
179
185
  }
180
186
  };
181
187
  }
@@ -14,6 +14,7 @@ import DimensionsDetector from '../../base/responsive-ui/components/DimensionsDe
14
14
  import { updateSettings } from '../../base/settings/actions';
15
15
  import JitsiThemePaperProvider from '../../base/ui/components/JitsiThemeProvider.native';
16
16
  import { isEmbedded } from '../../base/util/embedUtils.native';
17
+ import { setRoomNameGlobal } from '../../base/conference/actions.any';
17
18
  import { _getRouteToRender } from '../getRouteToRender.native';
18
19
  import logger from '../logger';
19
20
 
@@ -23,8 +24,6 @@ import { AbstractApp, IProps as AbstractAppProps } from './AbstractApp';
23
24
  import '../middlewares.native';
24
25
  import '../reducers.native';
25
26
 
26
- import { setRoomNameGlobal } from '../../app/actions.native';
27
-
28
27
  declare let __DEV__: any;
29
28
 
30
29
  const { AppInfo } = NativeModules;
@@ -1,6 +1,5 @@
1
1
  import ReducerRegistry from '../base/redux/ReducerRegistry';
2
2
  import { _ROOT_NAVIGATION_READY } from '../mobile/navigation/actionTypes';
3
- import { SET_ROOM_NAME } from '../base/conference/actionTypes';
4
3
 
5
4
  /**
6
5
  * Listen for actions which changes the state of the app feature.
@@ -17,11 +16,6 @@ ReducerRegistry.register('features/app', (state: Object = {}, action) => {
17
16
  ...state,
18
17
  ready: action.ready
19
18
  };
20
- case SET_ROOM_NAME:
21
- return {
22
- ...state,
23
- roomName: action.roomName
24
- };
25
19
  default:
26
20
  return state;
27
21
  }
@@ -56,3 +56,4 @@ import '../video-quality/reducer';
56
56
  import '../videosipgw/reducer';
57
57
  import '../visitors/reducer';
58
58
  import '../whiteboard/reducer';
59
+ import '../overlay/reducer';
@@ -81,6 +81,7 @@ import { IVirtualBackground } from '../virtual-background/reducer';
81
81
  import { IVisitorsState } from '../visitors/reducer';
82
82
  import { IWebHid } from '../web-hid/reducer';
83
83
  import { IWhiteboardState } from '../whiteboard/reducer';
84
+ import { IOverlayState } from '../overlay/reducer';
84
85
 
85
86
  export interface IStore {
86
87
  dispatch: ThunkDispatch<IReduxState, void, AnyAction>;
@@ -173,6 +174,7 @@ export interface IReduxState {
173
174
  'features/web-hid': IWebHid;
174
175
  'features/whiteboard': IWhiteboardState;
175
176
  'features/app': any;
177
+ 'features/overlay': IOverlayState;
176
178
  }
177
179
 
178
180
  export interface IReloadNowOptions {
@@ -183,9 +183,8 @@ export function getConferenceName(stateful: IStateful): string {
183
183
  const state = toState(stateful);
184
184
  const { callee } = state['features/base/jwt'];
185
185
  const { callDisplayName } = state['features/base/config'];
186
- const { localSubject, pendingSubjectChange, room, subject } = getConferenceState(state);
186
+ const { localSubject, pendingSubjectChange, room, roomName, subject } = getConferenceState(state);
187
187
 
188
- const { roomName } = state['features/app'];
189
188
  let conferenceName = (localSubject
190
189
  || pendingSubjectChange
191
190
  || subject
@@ -19,6 +19,8 @@ export const SET_DELAYED_LOAD_OF_AVATAR_URL = 'SET_DELAYED_LOAD_OF_AVATAR_URL';
19
19
  */
20
20
  export const SET_JWT = 'SET_JWT';
21
21
 
22
+ export const SET_USER_INFO_BY_JWT = 'SET_USER_INFO_BY_JWT';
23
+
22
24
  /**
23
25
  * The type of redux action which sets a known avatar URL.
24
26
  *
@@ -1,4 +1,4 @@
1
- import { SET_DELAYED_LOAD_OF_AVATAR_URL, SET_JWT, SET_KNOWN_AVATAR_URL } from './actionTypes';
1
+ import {SET_DELAYED_LOAD_OF_AVATAR_URL, SET_JWT, SET_KNOWN_AVATAR_URL, SET_USER_INFO_BY_JWT} from './actionTypes';
2
2
 
3
3
  /**
4
4
  * Sets an avatar URL for delayed loading.
@@ -32,6 +32,13 @@ export function setJWT(jwt?: string) {
32
32
  };
33
33
  }
34
34
 
35
+ export function setUserInfoByJWT(userInfo?: any) {
36
+ return {
37
+ type: SET_USER_INFO_BY_JWT,
38
+ userInfo
39
+ };
40
+ }
41
+
35
42
  /**
36
43
  * Sets a known avatar URL.
37
44
  *
@@ -14,10 +14,11 @@ import MiddlewareRegistry from '../redux/MiddlewareRegistry';
14
14
  import StateListenerRegistry from '../redux/StateListenerRegistry';
15
15
  import { parseURIString } from '../util/uri';
16
16
 
17
- import { SET_JWT } from './actionTypes';
18
- import { setDelayedLoadOfAvatarUrl, setJWT, setKnownAvatarUrl } from './actions';
17
+ import {SET_JWT, SET_USER_INFO_BY_JWT} from './actionTypes';
18
+ import {setDelayedLoadOfAvatarUrl, setJWT, setKnownAvatarUrl, setUserInfoByJWT} from './actions';
19
19
  import { parseJWTFromURLParams } from './functions';
20
20
  import logger from './logger';
21
+ import {doGetJSON} from "../util/httpUtils";
21
22
 
22
23
  /**
23
24
  * Set up a state change listener to perform maintenance tasks when the conference
@@ -59,6 +60,8 @@ MiddlewareRegistry.register(store => next => action => {
59
60
  }
60
61
  case SET_JWT:
61
62
  return _setJWT(store, next, action);
63
+ case SET_USER_INFO_BY_JWT:
64
+ return _setUserInfoByJWT(store, next, action);
62
65
  }
63
66
 
64
67
  return next(action);
@@ -127,8 +130,24 @@ function _setConfigOrLocationURL({ dispatch, getState }: IStore, next: Function,
127
130
 
128
131
  const { locationURL } = getState()['features/base/connection'];
129
132
 
130
- dispatch(
131
- setJWT(locationURL ? parseJWTFromURLParams(locationURL) : undefined));
133
+ let jwt = locationURL ? parseJWTFromURLParams(locationURL) : undefined;
134
+ if (!jwt) {
135
+ jwt = window.sessionStorage.getItem('jwt');
136
+ }
137
+ if (jwt) {
138
+ const backendApi = "https://jitsi.dev.placetime.host/backend/api/v1";
139
+ doGetJSON(backendApi + "/users/me", undefined, {
140
+ headers: {
141
+ 'Authorization': 'Bearer ' + jwt,
142
+ },
143
+ }
144
+ ).then(res => {
145
+ dispatch(setJWT(jwt));
146
+ if (res.data) {
147
+ dispatch(setUserInfoByJWT(res.data));
148
+ }
149
+ });
150
+ }
132
151
 
133
152
  return result;
134
153
  }
@@ -234,6 +253,28 @@ function _setJWT(store: IStore, next: Function, action: AnyAction) {
234
253
  return next(action);
235
254
  }
236
255
 
256
+ function _setUserInfoByJWT(store: IStore, next: Function, action: AnyAction) {
257
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
258
+ const {userInfo} = action;
259
+
260
+ let user = {
261
+ id: userInfo.id,
262
+ name: userInfo.first_name + " " + userInfo.last_name,
263
+ email: userInfo.email,
264
+ avatarURL: userInfo.avatar,
265
+ };
266
+ console.log("AAAAAAA - User", user);
267
+
268
+ action.user = user;
269
+
270
+ const newUser = user ? { ...user } : {};
271
+
272
+ _overwriteLocalParticipant(
273
+ store, { ...newUser});
274
+
275
+ return next(action);
276
+ }
277
+
237
278
  /**
238
279
  * Undoes/resets the values overwritten by {@link _overwriteLocalParticipant}
239
280
  * by either clearing them or setting to default values. Only the values that
@@ -2,7 +2,7 @@ import PersistenceRegistry from '../redux/PersistenceRegistry';
2
2
  import ReducerRegistry from '../redux/ReducerRegistry';
3
3
  import { equals } from '../redux/functions';
4
4
 
5
- import { SET_DELAYED_LOAD_OF_AVATAR_URL, SET_JWT, SET_KNOWN_AVATAR_URL } from './actionTypes';
5
+ import {SET_DELAYED_LOAD_OF_AVATAR_URL, SET_JWT, SET_KNOWN_AVATAR_URL, SET_USER_INFO_BY_JWT} from './actionTypes';
6
6
  import logger from './logger';
7
7
 
8
8
  export interface IJwtState {
@@ -62,6 +62,17 @@ ReducerRegistry.register<IJwtState>(
62
62
 
63
63
  return equals(state, nextState) ? state : nextState;
64
64
  }
65
+ case SET_USER_INFO_BY_JWT: {
66
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
67
+ const { type, ...payload } = action;
68
+ const nextState = {
69
+ ...state,
70
+ ...payload
71
+ };
72
+
73
+ return equals(state, nextState) ? state : nextState;
74
+ }
75
+
65
76
  case SET_KNOWN_AVATAR_URL:
66
77
  return {
67
78
  ...state,
@@ -23,7 +23,7 @@ import { ASPECT_RATIO_NARROW, ASPECT_RATIO_WIDE } from './constants';
23
23
  * didn't fit in the height. We do need to measure the actual UI at runtime and
24
24
  * determine whether and how to render it.
25
25
  */
26
- const REDUCED_UI_THRESHOLD = 300;
26
+ const REDUCED_UI_THRESHOLD = 200;
27
27
 
28
28
  /**
29
29
  * Indicates a resize of the window.
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Size for the Avatar.
3
3
  */
4
- export const AVATAR_SIZE = 200;
4
+ export const AVATAR_SIZE = 180;
@@ -457,11 +457,10 @@ export function _mapStateToProps(state: IReduxState) {
457
457
  const showCopyUrlButton = inviteEnabledFlag || !disableInviteFunctions;
458
458
  const deviceStatusVisible = isDeviceStatusVisible(state);
459
459
  const { showHangUp = true } = getLobbyConfig(state);
460
- const { membersOnly, lobbyWaitingForHost } = state['features/base/conference'];
460
+ const { roomName, membersOnly, lobbyWaitingForHost } = state['features/base/conference'];
461
461
  const { isLobbyChatActive, lobbyMessageRecipient, messages } = state['features/chat'];
462
462
  const { showModeratorLogin } = state['features/authentication'];
463
463
 
464
- const { roomName } = state['features/app'];
465
464
  return {
466
465
  _deviceStatusVisible: deviceStatusVisible,
467
466
  _isDisplayNameRequiredActive: Boolean(isDisplayNameRequiredError),
@@ -159,7 +159,9 @@ class LobbyScreen extends AbstractLobbyScreen<IProps> {
159
159
  * @inheritdoc
160
160
  */
161
161
  override _renderParticipantInfo() {
162
- const { displayName } = this.state;
162
+ const url = new URLSearchParams(window.location.search);
163
+ const userName = url.get("userName");
164
+ const displayName = this.state?.displayName ? this.state?.displayName : (userName?.toString() || '');
163
165
  const { _isDisplayNameRequiredActive, t } = this.props;
164
166
  const showError = _isDisplayNameRequiredActive && !displayName;
165
167
 
@@ -15,7 +15,9 @@ import BasePageOverlay from "./components/web/BasePageOverlay";
15
15
  export function getOverlayToRender(state: IReduxState) {
16
16
  const overlays = [
17
17
  PageReloadOverlay,
18
- SuspendedOverlay
18
+ SuspendedOverlay,
19
+ ConferenceNotFoundOverlay,
20
+ BasePageOverlay
19
21
  ];
20
22
 
21
23
  for (const overlay of overlays) {
@@ -154,7 +154,7 @@ class OverflowMenu extends PureComponent<IProps, IState> {
154
154
  return (
155
155
  <BottomSheet
156
156
  renderFooter = { this._renderReactionMenu }>
157
- <Divider style = { styles.divider as ViewStyle } />
157
+ {/*<Divider style = { styles.divider as ViewStyle } />*/}
158
158
  <OpenCarmodeButton { ...topButtonProps } />
159
159
  <AudioOnlyButton { ...buttonProps } />
160
160
  { this._renderRaiseHandButton(buttonProps) }
@@ -99,7 +99,8 @@ const styles = {
99
99
  backgroundColor: BaseTheme.palette.uiBackground,
100
100
  flexDirection: 'column',
101
101
  maxWidth: 580,
102
- marginHorizontal: 'auto',
102
+ marginLeft: 'auto',
103
+ marginRight: 'auto',
103
104
  marginVertical: BaseTheme.spacing[0],
104
105
  paddingHorizontal: BaseTheme.spacing[2],
105
106
  width: '100%'