@plusscommunities/pluss-circles-app-groups 1.2.2-beta.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.
Files changed (130) hide show
  1. package/dist/module/actions/ChatActions.js +81 -0
  2. package/dist/module/actions/ChatActions.js.map +1 -0
  3. package/dist/module/actions/GroupActions.js +335 -0
  4. package/dist/module/actions/GroupActions.js.map +1 -0
  5. package/dist/module/actions/index.js +41 -0
  6. package/dist/module/actions/index.js.map +1 -0
  7. package/dist/module/actions/types.js +26 -0
  8. package/dist/module/actions/types.js.map +1 -0
  9. package/dist/module/assets/fonts.js +3 -0
  10. package/dist/module/assets/fonts.js.map +1 -0
  11. package/dist/module/components/chat/Chat.js +613 -0
  12. package/dist/module/components/chat/Chat.js.map +1 -0
  13. package/dist/module/components/chat/ChatList.js +557 -0
  14. package/dist/module/components/chat/ChatList.js.map +1 -0
  15. package/dist/module/components/chat/ContactsList.js +204 -0
  16. package/dist/module/components/chat/ContactsList.js.map +1 -0
  17. package/dist/module/components/chat/KioskPeoplePage.js +345 -0
  18. package/dist/module/components/chat/KioskPeoplePage.js.map +1 -0
  19. package/dist/module/components/chat/PeopleContainer.js +24 -0
  20. package/dist/module/components/chat/PeopleContainer.js.map +1 -0
  21. package/dist/module/components/chat/PeoplePage.js +438 -0
  22. package/dist/module/components/chat/PeoplePage.js.map +1 -0
  23. package/dist/module/components/common/index.js +26 -0
  24. package/dist/module/components/common/index.js.map +1 -0
  25. package/dist/module/components/events/EventInvitePopup.js +563 -0
  26. package/dist/module/components/events/EventInvitePopup.js.map +1 -0
  27. package/dist/module/components/groups/EditGroup.js +548 -0
  28. package/dist/module/components/groups/EditGroup.js.map +1 -0
  29. package/dist/module/components/groups/GroupDetails.js +388 -0
  30. package/dist/module/components/groups/GroupDetails.js.map +1 -0
  31. package/dist/module/components/groups/GroupsList.js +111 -0
  32. package/dist/module/components/groups/GroupsList.js.map +1 -0
  33. package/dist/module/components/groups/GroupsWidget.js +150 -0
  34. package/dist/module/components/groups/GroupsWidget.js.map +1 -0
  35. package/dist/module/components/groups/NewGroup.js +703 -0
  36. package/dist/module/components/groups/NewGroup.js.map +1 -0
  37. package/dist/module/components/groups/PublicGroup.js +131 -0
  38. package/dist/module/components/groups/PublicGroup.js.map +1 -0
  39. package/dist/module/components/groups/PublicGroupAction.js +296 -0
  40. package/dist/module/components/groups/PublicGroupAction.js.map +1 -0
  41. package/dist/module/components/notifications/GroupInvite.js +166 -0
  42. package/dist/module/components/notifications/GroupInvite.js.map +1 -0
  43. package/dist/module/components/notifications/GroupInviteAction.js +338 -0
  44. package/dist/module/components/notifications/GroupInviteAction.js.map +1 -0
  45. package/dist/module/components/notifications/GroupMessage.js +131 -0
  46. package/dist/module/components/notifications/GroupMessage.js.map +1 -0
  47. package/dist/module/components/takeover/TakeoverBackground.js +27 -0
  48. package/dist/module/components/takeover/TakeoverBackground.js.map +1 -0
  49. package/dist/module/config/index.js +9 -0
  50. package/dist/module/config/index.js.map +1 -0
  51. package/dist/module/core.config.js +17 -0
  52. package/dist/module/core.config.js.map +1 -0
  53. package/dist/module/feature.config.js +266 -0
  54. package/dist/module/feature.config.js.map +1 -0
  55. package/dist/module/index.js +27 -0
  56. package/dist/module/index.js.map +1 -0
  57. package/dist/module/js/Colors.js +17 -0
  58. package/dist/module/js/Colors.js.map +1 -0
  59. package/dist/module/js/NavigationService.js +8 -0
  60. package/dist/module/js/NavigationService.js.map +1 -0
  61. package/dist/module/js/Styles.js +3 -0
  62. package/dist/module/js/Styles.js.map +1 -0
  63. package/dist/module/js/circles/MapStateToDirectMessages.js +11 -0
  64. package/dist/module/js/circles/MapStateToDirectMessages.js.map +1 -0
  65. package/dist/module/js/index.js +21 -0
  66. package/dist/module/js/index.js.map +1 -0
  67. package/dist/module/reducers/ChatsReducer.js +82 -0
  68. package/dist/module/reducers/ChatsReducer.js.map +1 -0
  69. package/dist/module/reducers/GroupsReducer.js +174 -0
  70. package/dist/module/reducers/GroupsReducer.js.map +1 -0
  71. package/dist/module/reducers/reducerKeys.js +4 -0
  72. package/dist/module/reducers/reducerKeys.js.map +1 -0
  73. package/dist/module/values.config.default.js +33 -0
  74. package/dist/module/values.config.default.js.map +1 -0
  75. package/dist/module/values.config.groups.js +33 -0
  76. package/dist/module/values.config.groups.js.map +1 -0
  77. package/dist/module/values.config.js +33 -0
  78. package/dist/module/values.config.js.map +1 -0
  79. package/dist/module/webapi/circleActions.js +127 -0
  80. package/dist/module/webapi/circleActions.js.map +1 -0
  81. package/dist/module/webapi/helper.js +4 -0
  82. package/dist/module/webapi/helper.js.map +1 -0
  83. package/dist/module/webapi/index.js +7 -0
  84. package/dist/module/webapi/index.js.map +1 -0
  85. package/dist/module/webapi/messageActions.js +45 -0
  86. package/dist/module/webapi/messageActions.js.map +1 -0
  87. package/package.json +55 -0
  88. package/src/actions/ChatActions.js +92 -0
  89. package/src/actions/GroupActions.js +368 -0
  90. package/src/actions/index.js +43 -0
  91. package/src/actions/types.js +29 -0
  92. package/src/assets/fonts.js +3 -0
  93. package/src/components/chat/Chat.js +568 -0
  94. package/src/components/chat/ChatList.js +491 -0
  95. package/src/components/chat/ContactsList.js +168 -0
  96. package/src/components/chat/KioskPeoplePage.js +317 -0
  97. package/src/components/chat/PeopleContainer.js +21 -0
  98. package/src/components/chat/PeoplePage.js +418 -0
  99. package/src/components/common/index.js +26 -0
  100. package/src/components/events/EventInvitePopup.js +508 -0
  101. package/src/components/groups/EditGroup.js +486 -0
  102. package/src/components/groups/GroupDetails.js +335 -0
  103. package/src/components/groups/GroupsList.js +93 -0
  104. package/src/components/groups/GroupsWidget.js +134 -0
  105. package/src/components/groups/NewGroup.js +650 -0
  106. package/src/components/groups/PublicGroup.js +116 -0
  107. package/src/components/groups/PublicGroupAction.js +266 -0
  108. package/src/components/notifications/GroupInvite.js +154 -0
  109. package/src/components/notifications/GroupInviteAction.js +295 -0
  110. package/src/components/notifications/GroupMessage.js +114 -0
  111. package/src/components/takeover/TakeoverBackground.js +26 -0
  112. package/src/config/index.js +9 -0
  113. package/src/core.config.js +5 -0
  114. package/src/feature.config.js +274 -0
  115. package/src/index.js +24 -0
  116. package/src/js/Colors.js +17 -0
  117. package/src/js/NavigationService.js +9 -0
  118. package/src/js/Styles.js +3 -0
  119. package/src/js/circles/MapStateToDirectMessages.js +10 -0
  120. package/src/js/index.js +24 -0
  121. package/src/reducers/ChatsReducer.js +63 -0
  122. package/src/reducers/GroupsReducer.js +142 -0
  123. package/src/reducers/reducerKeys.js +4 -0
  124. package/src/values.config.default.js +39 -0
  125. package/src/values.config.groups.js +39 -0
  126. package/src/values.config.js +39 -0
  127. package/src/webapi/circleActions.js +104 -0
  128. package/src/webapi/helper.js +4 -0
  129. package/src/webapi/index.js +8 -0
  130. package/src/webapi/messageActions.js +39 -0
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@plusscommunities/pluss-circles-app-groups",
3
+ "version": "1.2.2-beta.0",
4
+ "description": "Extension package to enable circles on Pluss Communities Platform",
5
+ "main": "dist/module/index.js",
6
+ "module": "dist/module/index.js",
7
+ "react-native": "src/index.js",
8
+ "files": [
9
+ "dist/",
10
+ "src/"
11
+ ],
12
+ "scripts": {
13
+ "build": "npm i && bob build",
14
+ "betapatch": "npm version prepatch --preid=beta",
15
+ "patch": "npm version patch",
16
+ "betaupload": "npm run build && npm publish --access public --tag beta",
17
+ "betaupload:p": "npm run betapatch && npm run betaupload",
18
+ "upload": "npm run build && npm publish --access public",
19
+ "upload:p": "npm run patch && npm run upload",
20
+ "copy:add": "run(){ ext=${1:-default}; test -f src/values.config.$ext.js || cp src/values.config.default.js src/values.config.$ext.js; }; run",
21
+ "copy:get": "echo $npm_package_name",
22
+ "copy:set": "run(){ target='\\@plusscommunities\\/pluss-circles-app'; ext=${1:-default}; [ $ext == 'default' ] && replace=$target || replace=$target'-'$ext; echo 'Setting target to '$replace; test -f src/values.config.$ext.js && cp -f src/values.config.$ext.js src/values.config.js; sed -i '' -e 's/'$target'.*\"/'$replace'\"/g' package.json; }; run",
23
+ "copy:upload": "npm run patch; for file in `ls ./src/values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run upload; done; npm run copy:set;",
24
+ "copy:betaupload": "npm run betapatch; for file in `ls ./src/values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run betaupload; done; npm run copy:set;"
25
+ },
26
+ "author": "Phillip Suh",
27
+ "license": "ISC",
28
+ "dependencies": {
29
+ "@plusscommunities/pluss-core-app": "1.5.5",
30
+ "axios": "^0.16.2",
31
+ "lodash": "^4.17.4",
32
+ "moment": "^2.18.1",
33
+ "react": "17.0.1",
34
+ "react-native": "0.64.3",
35
+ "react-native-elements": "^0.17.0",
36
+ "react-native-iphone-x-helper": "^1.3.1",
37
+ "react-native-webview": "11.15.0",
38
+ "react-redux": "^7.2.6"
39
+ },
40
+ "peerDependencies": {
41
+ "expo-linear-gradient": "~11.0.3",
42
+ "expo-constants": "~13.0.0",
43
+ "redux-persist": "^6.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "react-native-builder-bob": "^0.18.2"
47
+ },
48
+ "react-native-builder-bob": {
49
+ "source": "src",
50
+ "output": "dist",
51
+ "targets": [
52
+ "module"
53
+ ]
54
+ }
55
+ }
@@ -0,0 +1,92 @@
1
+ import _ from 'lodash';
2
+ import {
3
+ START_FETCHING_CIRCLE_CHATS,
4
+ RECEIVED_CIRCLE_CHATS,
5
+ DELETED_CIRCLE_CHAT,
6
+ DISCONNECTED_CIRCLE_CHAT,
7
+ DISCONNECTED_CIRCLE_CHAT_LIST,
8
+ BLOCKED_CIRCLE_USER,
9
+ RECEIVED_BLOCKED_CIRCLE_USERS,
10
+ RECEIVED_CIRCLE_MESSAGES,
11
+ } from './types';
12
+
13
+ export const createChat = (users, title) => {
14
+ console.log('CREATE CHAT ACTION HIT.......???');
15
+ };
16
+
17
+ export const deleteChat = chatKey => {
18
+ return async dispatch => {
19
+ dispatch(deletedChat(chatKey));
20
+ };
21
+ };
22
+
23
+ export const disconnectChatList = () => {
24
+ return dispatch => {
25
+ dispatch(disconnectedChatList());
26
+ };
27
+ };
28
+
29
+ export const disconnectChat = chatKey => {
30
+ return dispatch => {
31
+ dispatch(disconnectedChat());
32
+ };
33
+ };
34
+
35
+ export const blockUser = (userKey, targetUserKey) => {
36
+ return async dispatch => {
37
+ dispatch(blockedUser());
38
+ };
39
+ };
40
+
41
+ const deletedChat = chatKey => {
42
+ return {
43
+ type: DELETED_CIRCLE_CHAT,
44
+ payload: chatKey,
45
+ };
46
+ };
47
+
48
+ const startFetchingChats = () => ({
49
+ type: START_FETCHING_CIRCLE_CHATS,
50
+ });
51
+
52
+ const receivedChats = (chats, userKey) => {
53
+ // Calculate total unread count
54
+ let unreadCount = 0;
55
+ chats.forEach(chat => {
56
+ if (chat.unread) unreadCount += chat.unread[userKey];
57
+ });
58
+
59
+ return {
60
+ type: RECEIVED_CIRCLE_CHATS,
61
+ payload: chats,
62
+ unreadCount,
63
+ };
64
+ };
65
+
66
+ const disconnectedChatList = () => ({
67
+ type: DISCONNECTED_CIRCLE_CHAT_LIST,
68
+ });
69
+
70
+ const disconnectedChat = () => ({
71
+ type: DISCONNECTED_CIRCLE_CHAT,
72
+ });
73
+
74
+ const blockedUser = () => {
75
+ return {
76
+ type: BLOCKED_CIRCLE_USER,
77
+ };
78
+ };
79
+
80
+ const receivedBlockedUsers = blocked => {
81
+ return {
82
+ type: RECEIVED_BLOCKED_CIRCLE_USERS,
83
+ payload: blocked,
84
+ };
85
+ };
86
+
87
+ export const updateChatMessages = (chatKey, messages) => {
88
+ return {
89
+ type: RECEIVED_CIRCLE_MESSAGES,
90
+ payload: { chatKey, messages },
91
+ };
92
+ };
@@ -0,0 +1,368 @@
1
+ import _ from 'lodash';
2
+ import { circleActions } from '../webapi';
3
+ import { getUrl } from '../webapi/helper';
4
+ import { getSessionTokenAWS, getSessionUidAWS, authedFunction } from '../js';
5
+ import NavigationService from '../js/NavigationService';
6
+ import {
7
+ PUBLIC_CIRCLES_LOAD_INITIALISE,
8
+ CIRCLES_LOAD_INITIALISE,
9
+ CIRCLE_INVITES_UPDATED,
10
+ CIRCLE_INVITES_LOADED,
11
+ CREATED_CIRCLE,
12
+ CIRCLES_LOADED,
13
+ UPDATE_CIRCLE_UNREAD,
14
+ CLEAR_SINGLE_CIRCLE_UNREAD,
15
+ } from './types';
16
+ import { values } from '../values.config';
17
+
18
+ export const refreshGroups = () => {
19
+ return async dispatch => {
20
+ const res = await circleActions.getGroups();
21
+ dispatch({
22
+ type: CIRCLES_LOAD_INITIALISE,
23
+ payload: res.data.Items,
24
+ });
25
+ };
26
+ };
27
+
28
+ export const loadGroups = groups => {
29
+ return dispatch => {
30
+ dispatch({
31
+ type: CIRCLES_LOADED,
32
+ payload: groups,
33
+ });
34
+ };
35
+ };
36
+
37
+ export const updatePublicGroups = publicGroups => {
38
+ return async dispatch => {
39
+ dispatch({
40
+ type: PUBLIC_CIRCLES_LOAD_INITIALISE,
41
+ payload: publicGroups,
42
+ });
43
+ };
44
+ };
45
+
46
+ export const updateGroups = groups => {
47
+ return async dispatch => {
48
+ dispatch({
49
+ type: CIRCLES_LOAD_INITIALISE,
50
+ payload: groups,
51
+ });
52
+ };
53
+ };
54
+
55
+ export const updateUnreadCounter = (groups, userId) => {
56
+ return async dispatch => {
57
+ if (!_.isEmpty(groups)) {
58
+ let counter = 0;
59
+ groups.forEach(element => {
60
+ if (!element.Deleted && !_.isUndefined(element.Unread) && !_.isEmpty(element.Unread) && !_.isUndefined(element.Unread[userId])) {
61
+ counter += element.Unread[userId];
62
+ }
63
+ });
64
+
65
+ dispatch({
66
+ type: UPDATE_CIRCLE_UNREAD,
67
+ payload: counter,
68
+ });
69
+ }
70
+ };
71
+ };
72
+
73
+ export const clearGroupCounter = (groupId, userId, isPrivate) => {
74
+ circleActions.clearGroupUnread(groupId, userId);
75
+ return {
76
+ type: CLEAR_SINGLE_CIRCLE_UNREAD,
77
+ payload: { groupId, userId, isPrivate },
78
+ };
79
+ };
80
+
81
+ export const createGroup = group => {
82
+ return dispatch => {
83
+ dispatch({
84
+ type: CREATED_CIRCLE,
85
+ payload: group,
86
+ });
87
+ /* if (events != null && events.length > 0) {
88
+ dispatch({
89
+ type: UPDATE_EVENT_TIMEFRAME,
90
+ payload: null
91
+ });
92
+ } */
93
+ };
94
+ };
95
+
96
+ export const updateInvites = invites => {
97
+ return dispatch => {
98
+ dispatch({
99
+ type: CIRCLE_INVITES_LOADED,
100
+ payload: invites,
101
+ });
102
+ };
103
+ };
104
+
105
+ export const getGroupInvites = () => {
106
+ return async dispatch => {
107
+ let userID = null;
108
+ let token = null;
109
+ await getSessionUidAWS()
110
+ .then(userEyeDee => {
111
+ userID = userEyeDee;
112
+ })
113
+ .catch(() => {
114
+ console.log('FAIL AT FETCH USER ID -- Silent Upate');
115
+ });
116
+ await getSessionTokenAWS('Bearer')
117
+ .then(sessionToken => {
118
+ token = sessionToken;
119
+ })
120
+ .catch(() => {
121
+ console.log('FAIL AT FETCH TOKEN -- Silent Upate');
122
+ });
123
+ if (userID != null && token != null) {
124
+ circleActions
125
+ .getGroupInvites(userID, token)
126
+ .then(res => {
127
+ dispatch({
128
+ type: CIRCLE_INVITES_LOADED,
129
+ payload: res.data.Items,
130
+ });
131
+ })
132
+ .catch(err => {
133
+ console.log('fetch circle invites FAIL');
134
+ console.log(err);
135
+ });
136
+ }
137
+ };
138
+ };
139
+
140
+ export const handleGroupInvite = (invite, action, tempUserId) => {
141
+ const tempEvent = _.clone(invite);
142
+ const newInvite = _.cloneDeep(invite);
143
+ newInvite.Deleted = true;
144
+ return async dispatch => {
145
+ dispatch({
146
+ type: CIRCLE_INVITES_UPDATED,
147
+ payload: [newInvite],
148
+ });
149
+ if (action) {
150
+ tempEvent.fetchingLatest = true;
151
+ const ads = _.findIndex(tempEvent.Invites, item => {
152
+ return item.userId === tempUserId;
153
+ });
154
+ const userToUse = tempEvent.Invites[ads];
155
+ tempEvent.Invites.splice(ads, 1);
156
+ tempEvent.Audience.push(userToUse);
157
+
158
+ const chat = {
159
+ key: invite.Id,
160
+ title: invite.Title,
161
+ unread: [],
162
+ userKeys: [],
163
+ userNames: [],
164
+ userProfilePics: [],
165
+ };
166
+ dispatch({
167
+ type: CIRCLES_LOADED,
168
+ payload: [tempEvent],
169
+ });
170
+ setTimeout(() => {
171
+ NavigationService.navigate(values.screenCircleChat, {
172
+ chat,
173
+ new: true,
174
+ back: values.screenCircleChatList,
175
+ });
176
+ }, 100);
177
+ }
178
+
179
+ let userID = null;
180
+ await getSessionUidAWS()
181
+ .then(userEyeDee => {
182
+ userID = userEyeDee;
183
+ })
184
+ .catch(() => {
185
+ console.log('FAIL AT FETCH USER ID -- Silent Upate');
186
+ });
187
+
188
+ if (userID != null) {
189
+ await authedFunction({
190
+ method: 'post',
191
+ url: getUrl(values.serviceKey, 'handleGroupInvite'),
192
+ data: {
193
+ userID,
194
+ inviteID: invite.Id,
195
+ action,
196
+ },
197
+ })
198
+ .then(res => {
199
+ if (action) {
200
+ dispatch({
201
+ type: CIRCLES_LOADED,
202
+ payload: [res.data.group],
203
+ });
204
+ }
205
+ })
206
+ .catch(err => {
207
+ console.log('handle event invite fail', err);
208
+ });
209
+ } else {
210
+ console.log('no user');
211
+ }
212
+ };
213
+ };
214
+
215
+ export const joinGroup = group => {
216
+ const tempGroup = _.clone(group);
217
+ return async dispatch => {
218
+ tempGroup.fetchingLatest = true;
219
+
220
+ const chat = {
221
+ key: group.Id,
222
+ title: group.Title,
223
+ unread: [],
224
+ userKeys: [],
225
+ userNames: [],
226
+ userProfilePics: [],
227
+ };
228
+ dispatch({
229
+ type: CIRCLES_LOADED,
230
+ payload: [tempGroup],
231
+ });
232
+ setTimeout(() => {
233
+ NavigationService.navigate(values.screenCircleChat, {
234
+ chat,
235
+ new: true,
236
+ back: values.screenCircleChatList,
237
+ });
238
+ }, 100);
239
+
240
+ await circleActions
241
+ .joinGroup(group.Id)
242
+ .then(res => {
243
+ dispatch({
244
+ type: CIRCLES_LOADED,
245
+ payload: [res.data.group],
246
+ });
247
+ })
248
+ .catch(err => {
249
+ console.log('handle join group fail', err);
250
+ });
251
+ };
252
+ };
253
+
254
+ export const softLeaveGroup = group => {
255
+ const newGroup = _.cloneDeep(group);
256
+ newGroup.Deleted = true;
257
+ return async dispatch => {
258
+ dispatch({
259
+ type: CIRCLES_LOADED,
260
+ payload: [newGroup],
261
+ });
262
+ await authedFunction({
263
+ method: 'post',
264
+ url: getUrl(values.serviceKey, 'leaveGroup'),
265
+ data: {
266
+ groupID: group.Id,
267
+ },
268
+ });
269
+ };
270
+ };
271
+
272
+ export const deleteGroup = group => {
273
+ group.Deleted = true;
274
+ return async dispatch => {
275
+ dispatch({
276
+ type: CIRCLES_LOADED,
277
+ payload: [group],
278
+ });
279
+
280
+ let userID = null;
281
+ let token = null;
282
+ await getSessionUidAWS()
283
+ .then(userEyeDee => {
284
+ userID = userEyeDee;
285
+ })
286
+ .catch(() => {
287
+ console.log('FAIL AT FETCH USER ID -- Silent Upate');
288
+ });
289
+ await getSessionTokenAWS('Bearer')
290
+ .then(sessionToken => {
291
+ token = sessionToken;
292
+ })
293
+ .catch(() => {
294
+ console.log('FAIL AT FETCH TOKEN -- Silent Upate');
295
+ });
296
+ if (userID != null && token != null) {
297
+ await authedFunction({
298
+ method: 'post',
299
+ url: getUrl(values.serviceKey, 'deleteUsersGroup'),
300
+ data: {
301
+ userID,
302
+ group,
303
+ },
304
+ headers: {
305
+ authorization: token,
306
+ },
307
+ });
308
+ }
309
+ };
310
+ };
311
+
312
+ export const editGroup = (group, usersToAdd, usersToRemove) => {
313
+ return async dispatch => {
314
+ // push to local store
315
+ const localGroup = { ...group };
316
+ if (!localGroup.Invites) {
317
+ localGroup.Invites = [];
318
+ }
319
+ localGroup.Invites = _.filter(localGroup.Invites, user => {
320
+ return !_.some(usersToRemove, userId => {
321
+ return user.userId === userId;
322
+ });
323
+ });
324
+ localGroup.Invites = [...localGroup.Invites, ...usersToAdd];
325
+ localGroup.Audience = _.filter(localGroup.Audience, user => {
326
+ return !_.some(usersToRemove, userId => {
327
+ return user.userId === userId;
328
+ });
329
+ });
330
+ dispatch({
331
+ type: CIRCLES_LOADED,
332
+ payload: [localGroup],
333
+ });
334
+
335
+ // save to database
336
+ let userID = null;
337
+ let token = null;
338
+ await getSessionUidAWS()
339
+ .then(userEyeDee => {
340
+ userID = userEyeDee;
341
+ })
342
+ .catch(() => {
343
+ console.log('FAIL AT FETCH USER ID -- Silent Upate');
344
+ });
345
+ await getSessionTokenAWS('Bearer')
346
+ .then(sessionToken => {
347
+ token = sessionToken;
348
+ })
349
+ .catch(() => {
350
+ console.log('FAIL AT FETCH TOKEN -- Silent Upate');
351
+ });
352
+ if (userID != null && token != null) {
353
+ await authedFunction({
354
+ method: 'post',
355
+ url: getUrl(values.serviceKey, 'editUsersGroup'),
356
+ data: {
357
+ userID,
358
+ group,
359
+ usersToAdd,
360
+ usersToRemove,
361
+ },
362
+ headers: {
363
+ authorization: token,
364
+ },
365
+ });
366
+ }
367
+ };
368
+ };
@@ -0,0 +1,43 @@
1
+ import { Actions } from '../core.config';
2
+
3
+ export const getFollowers = Actions.getFollowers;
4
+ export const addFollower = Actions.addFollower;
5
+ export const selectEventTime = Actions.selectEventTime;
6
+ export const residentsLoaded = Actions.residentsLoaded;
7
+ export const linkedUsersLoaded = Actions.linkedToUsersLoaded;
8
+ export const linkedToUsersLoaded = Actions.linkedToUsersLoaded;
9
+ export const updateNavRead = Actions.updateNavRead;
10
+
11
+ // export * from './AlertActions';
12
+ // export * from './AreaActions';
13
+ // export * from './AuthActions';
14
+ // export * from './ConnectionActions';
15
+ // export * from './UserActions';
16
+ // export * from './EventActions';
17
+ // export * from './FeedbackActions';
18
+ // export * from './PlaceActions';
19
+ // export * from './ReminderActions';
20
+ // export * from './TakeoverActions';
21
+ // export * from './PopularEventsActions';
22
+ // export * from './NavigationActions';
23
+ // export * from './PersonalEventActions';
24
+ // export * from './UserSettingsActions';
25
+ export * from './ChatActions';
26
+ // export * from './NotificationActions';
27
+ // export * from './ProfileActions';
28
+ // export * from './ContactActions';
29
+ // export * from './EventContactActions';
30
+ // export * from './FollowerActions';
31
+ // export * from './InfoActions';
32
+ export * from './GroupActions';
33
+ // export * from './GeneralActions';
34
+ // export * from './ResidentActions';
35
+ // export * from './ServiceActions';
36
+ // export * from './OfferActions';
37
+ // export * from './SessionActions';
38
+ // export * from './PaymentActions';
39
+ // export * from './JobActions';
40
+ // export * from './NewsActions';
41
+ // export * from './MediaActions';
42
+ // export * from './FacilityActions';
43
+ // export * from './DeviceActions';
@@ -0,0 +1,29 @@
1
+ import { values } from '../values.config';
2
+ import { ActionTypes } from '../core.config';
3
+
4
+ export const LOGOUT = ActionTypes.LOGOUT;
5
+ export const CHANGE_ROLE = ActionTypes.CHANGE_ROLE;
6
+
7
+ // Chat Actions
8
+ export const SOFT_ADD_CIRCLE_CHAT = `SOFT_ADD_${values.actionCircleKey}_CHAT`;
9
+ export const RECEIVED_CIRCLE_MESSAGES = `RECEIVED_${values.actionCircleKey}_MESSAGES`;
10
+ export const START_FETCHING_CIRCLE_CHATS = `START_FETCHING_${values.actionCircleKey}_CHATS`;
11
+ export const RECEIVED_CIRCLE_CHATS = `RECEIVED_${values.actionCircleKey}_CHATS`;
12
+ export const CREATED_CIRCLE_CHAT = `CREATED_${values.actionCircleKey}_CHAT`;
13
+ export const DELETED_CIRCLE_CHAT = `DELETED_${values.actionCircleKey}_CHAT`;
14
+ export const DISCONNECTED_CIRCLE_CHAT = `DISCONNECTED_${values.actionCircleKey}_CHAT`;
15
+ export const DISCONNECTED_CIRCLE_CHAT_LIST = `DISCONNECTED_${values.actionCircleKey}_CHAT_LIST`;
16
+ export const BLOCKED_CIRCLE_USER = `BLOCKED_${values.actionCircleKey}_USER`;
17
+ export const RECEIVED_BLOCKED_CIRCLE_USERS = `RECEIVED_BLOCKED_${values.actionCircleKey}_USERS`;
18
+
19
+ // Circle Actions
20
+ export const PUBLIC_CIRCLES_LOAD_INITIALISE = `PUBLIC_${values.actionCircleKey}S_LOAD_INITIALISE`;
21
+ export const CIRCLES_LOAD_INITIALISE = `${values.actionCircleKey}S_LOAD_INITIALISE`;
22
+ export const CIRCLES_LOADED = `${values.actionCircleKey}S_LOADED`;
23
+ export const CREATED_CIRCLE = `CREATED_${values.actionCircleKey}`;
24
+ export const CLEAR_CIRCLES = `CLEAR_${values.actionCircleKey}S`;
25
+ export const UPDATE_CIRCLE_UNREAD = `UPDATE_${values.actionCircleKey}_UNREAD`;
26
+ export const CLEAR_SINGLE_CIRCLE_UNREAD = `CLEAR_SINGLE_${values.actionCircleKey}_UNREAD`;
27
+
28
+ export const CIRCLE_INVITES_LOADED = `${values.actionCircleKey}_INVITES_LOADED`;
29
+ export const CIRCLE_INVITES_UPDATED = `${values.actionCircleKey}_INVITES_UPDATED`;
@@ -0,0 +1,3 @@
1
+ import { Fonts } from '../core.config';
2
+
3
+ export const Pl60Icon = Fonts.Pl60Icon;