@plusscommunities/pluss-core-app 6.0.0 → 6.0.2-auth.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 +4 -1
- package/src/apis/fileActions.js +19 -27
- package/src/components/ImageUploader.js +17 -10
- package/src/config.js +5 -0
- package/src/session.js +2 -2
- package/dist/module/actions/FollowerActions.js +0 -34
- package/dist/module/actions/FollowerActions.js.map +0 -1
- package/dist/module/actions/MediaActions.js +0 -29
- package/dist/module/actions/MediaActions.js.map +0 -1
- package/dist/module/actions/ResidentActions.js +0 -26
- package/dist/module/actions/ResidentActions.js.map +0 -1
- package/dist/module/actions/UserActions.js +0 -223
- package/dist/module/actions/UserActions.js.map +0 -1
- package/dist/module/actions/UserSettingsActions.js +0 -14
- package/dist/module/actions/UserSettingsActions.js.map +0 -1
- package/dist/module/actions/index.js +0 -6
- package/dist/module/actions/index.js.map +0 -1
- package/dist/module/actions/types.js +0 -17
- package/dist/module/actions/types.js.map +0 -1
- package/dist/module/apis/analyticsActions.js +0 -20
- package/dist/module/apis/analyticsActions.js.map +0 -1
- package/dist/module/apis/contactActions.js +0 -27
- package/dist/module/apis/contactActions.js.map +0 -1
- package/dist/module/apis/eventActions.js +0 -161
- package/dist/module/apis/eventActions.js.map +0 -1
- package/dist/module/apis/fileActions.js +0 -93
- package/dist/module/apis/fileActions.js.map +0 -1
- package/dist/module/apis/followerActions.js +0 -38
- package/dist/module/apis/followerActions.js.map +0 -1
- package/dist/module/apis/index.js +0 -12
- package/dist/module/apis/index.js.map +0 -1
- package/dist/module/apis/notificationActions.js +0 -60
- package/dist/module/apis/notificationActions.js.map +0 -1
- package/dist/module/apis/profileActions.js +0 -14
- package/dist/module/apis/profileActions.js.map +0 -1
- package/dist/module/apis/reactionActions.js +0 -76
- package/dist/module/apis/reactionActions.js.map +0 -1
- package/dist/module/apis/stringActions.js +0 -30
- package/dist/module/apis/stringActions.js.map +0 -1
- package/dist/module/apis/typeActions.js +0 -15
- package/dist/module/apis/typeActions.js.map +0 -1
- package/dist/module/apis/userActions.js +0 -104
- package/dist/module/apis/userActions.js.map +0 -1
- package/dist/module/assets/icons/reactions/heart.png +0 -0
- package/dist/module/assets/icons/reactions/party.png +0 -0
- package/dist/module/assets/icons/reactions/sad.png +0 -0
- package/dist/module/assets/icons/reactions/smile.png +0 -0
- package/dist/module/colours.js +0 -168
- package/dist/module/colours.js.map +0 -1
- package/dist/module/components/AddButton.js +0 -43
- package/dist/module/components/AddButton.js.map +0 -1
- package/dist/module/components/AddToCalendarButton.js +0 -225
- package/dist/module/components/AddToCalendarButton.js.map +0 -1
- package/dist/module/components/Attachment.js +0 -54
- package/dist/module/components/Attachment.js.map +0 -1
- package/dist/module/components/AudienceSelectorLauncher.js +0 -64
- package/dist/module/components/AudienceSelectorLauncher.js.map +0 -1
- package/dist/module/components/AudienceSelectorPage.js +0 -350
- package/dist/module/components/AudienceSelectorPage.js.map +0 -1
- package/dist/module/components/AutoOffsetImage.js +0 -186
- package/dist/module/components/AutoOffsetImage.js.map +0 -1
- package/dist/module/components/BackButton.js +0 -58
- package/dist/module/components/BackButton.js.map +0 -1
- package/dist/module/components/CategoryTabs.js +0 -154
- package/dist/module/components/CategoryTabs.js.map +0 -1
- package/dist/module/components/CommentReply.js +0 -328
- package/dist/module/components/CommentReply.js.map +0 -1
- package/dist/module/components/CommentSection.js +0 -822
- package/dist/module/components/CommentSection.js.map +0 -1
- package/dist/module/components/ConfirmPopup.js +0 -108
- package/dist/module/components/ConfirmPopup.js.map +0 -1
- package/dist/module/components/ConfirmationPopup.js +0 -72
- package/dist/module/components/ConfirmationPopup.js.map +0 -1
- package/dist/module/components/DropDownItem.js +0 -74
- package/dist/module/components/DropDownItem.js.map +0 -1
- package/dist/module/components/DropDownMenu.js +0 -41
- package/dist/module/components/DropDownMenu.js.map +0 -1
- package/dist/module/components/EmptyStateMain.js +0 -50
- package/dist/module/components/EmptyStateMain.js.map +0 -1
- package/dist/module/components/EmptyStateWidget.js +0 -47
- package/dist/module/components/EmptyStateWidget.js.map +0 -1
- package/dist/module/components/FontScaleButton.js +0 -36
- package/dist/module/components/FontScaleButton.js.map +0 -1
- package/dist/module/components/FontScalePopup.js +0 -75
- package/dist/module/components/FontScalePopup.js.map +0 -1
- package/dist/module/components/FormCard.js +0 -25
- package/dist/module/components/FormCard.js.map +0 -1
- package/dist/module/components/FormCardSection.js +0 -212
- package/dist/module/components/FormCardSection.js.map +0 -1
- package/dist/module/components/FormCardSectionOptionLauncher.js +0 -72
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +0 -1
- package/dist/module/components/FormattedText.js +0 -131
- package/dist/module/components/FormattedText.js.map +0 -1
- package/dist/module/components/GenericInput.js +0 -148
- package/dist/module/components/GenericInput.js.map +0 -1
- package/dist/module/components/GenericInputSection.js +0 -158
- package/dist/module/components/GenericInputSection.js.map +0 -1
- package/dist/module/components/Header.js +0 -458
- package/dist/module/components/Header.js.map +0 -1
- package/dist/module/components/ImagePopup.js +0 -240
- package/dist/module/components/ImagePopup.js.map +0 -1
- package/dist/module/components/ImageUploadProgress.js +0 -68
- package/dist/module/components/ImageUploadProgress.js.map +0 -1
- package/dist/module/components/ImageUploader.js +0 -789
- package/dist/module/components/ImageUploader.js.map +0 -1
- package/dist/module/components/InlineButton.js +0 -65
- package/dist/module/components/InlineButton.js.map +0 -1
- package/dist/module/components/Input.js +0 -154
- package/dist/module/components/Input.js.map +0 -1
- package/dist/module/components/LoadingCircles.js +0 -220
- package/dist/module/components/LoadingCircles.js.map +0 -1
- package/dist/module/components/LoadingIndicator.js +0 -86
- package/dist/module/components/LoadingIndicator.js.map +0 -1
- package/dist/module/components/LoadingStateWidget.js +0 -46
- package/dist/module/components/LoadingStateWidget.js.map +0 -1
- package/dist/module/components/MediaPlayer.js +0 -418
- package/dist/module/components/MediaPlayer.js.map +0 -1
- package/dist/module/components/MiddlePopup.js +0 -43
- package/dist/module/components/MiddlePopup.js.map +0 -1
- package/dist/module/components/PDFPopup.js +0 -191
- package/dist/module/components/PDFPopup.js.map +0 -1
- package/dist/module/components/PlussChat.js +0 -986
- package/dist/module/components/PlussChat.js.map +0 -1
- package/dist/module/components/PlussChatMessage.js +0 -262
- package/dist/module/components/PlussChatMessage.js.map +0 -1
- package/dist/module/components/PlussChatTime.js +0 -58
- package/dist/module/components/PlussChatTime.js.map +0 -1
- package/dist/module/components/Popup.js +0 -125
- package/dist/module/components/Popup.js.map +0 -1
- package/dist/module/components/PopupMenu.js +0 -119
- package/dist/module/components/PopupMenu.js.map +0 -1
- package/dist/module/components/PositionedImage.js +0 -313
- package/dist/module/components/PositionedImage.js.map +0 -1
- package/dist/module/components/ProfilePic.js +0 -106
- package/dist/module/components/ProfilePic.js.map +0 -1
- package/dist/module/components/RadioButton.js +0 -77
- package/dist/module/components/RadioButton.js.map +0 -1
- package/dist/module/components/Reaction.js +0 -116
- package/dist/module/components/Reaction.js.map +0 -1
- package/dist/module/components/Reactions.js +0 -71
- package/dist/module/components/Reactions.js.map +0 -1
- package/dist/module/components/SharingTools.js +0 -154
- package/dist/module/components/SharingTools.js.map +0 -1
- package/dist/module/components/Spinner.js +0 -22
- package/dist/module/components/Spinner.js.map +0 -1
- package/dist/module/components/StickyFooter.js +0 -34
- package/dist/module/components/StickyFooter.js.map +0 -1
- package/dist/module/components/TextStyle.js +0 -45
- package/dist/module/components/TextStyle.js.map +0 -1
- package/dist/module/components/Toggle.js +0 -65
- package/dist/module/components/Toggle.js.map +0 -1
- package/dist/module/components/TouchableSearchBar.js +0 -67
- package/dist/module/components/TouchableSearchBar.js.map +0 -1
- package/dist/module/components/UserListPopup.js +0 -135
- package/dist/module/components/UserListPopup.js.map +0 -1
- package/dist/module/components/UserListing.js +0 -267
- package/dist/module/components/UserListing.js.map +0 -1
- package/dist/module/components/VideoPopup.js +0 -113
- package/dist/module/components/VideoPopup.js.map +0 -1
- package/dist/module/components/WarningPopup.js +0 -82
- package/dist/module/components/WarningPopup.js.map +0 -1
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +0 -289
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +0 -1
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +0 -116
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +0 -1
- package/dist/module/components/index.js +0 -55
- package/dist/module/components/index.js.map +0 -1
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +0 -385
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +0 -1
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +0 -387
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +0 -1
- package/dist/module/config.js +0 -27
- package/dist/module/config.js.map +0 -1
- package/dist/module/constants.js +0 -19
- package/dist/module/constants.js.map +0 -1
- package/dist/module/fonts/index.js +0 -2
- package/dist/module/fonts/index.js.map +0 -1
- package/dist/module/fonts/pluss60-icons.js +0 -5
- package/dist/module/fonts/pluss60-icons.js.map +0 -1
- package/dist/module/fonts/pluss60-icons.json +0 -1097
- package/dist/module/helper.js +0 -397
- package/dist/module/helper.js.map +0 -1
- package/dist/module/index.js +0 -13
- package/dist/module/index.js.map +0 -1
- package/dist/module/js/images/detectFaces.js +0 -30
- package/dist/module/js/images/detectFaces.js.map +0 -1
- package/dist/module/js/images/findLandmarkRange.js +0 -93
- package/dist/module/js/images/findLandmarkRange.js.map +0 -1
- package/dist/module/js/images/getScaledOffset.js +0 -81
- package/dist/module/js/images/getScaledOffset.js.map +0 -1
- package/dist/module/js/site/getSiteLevelFromState.js +0 -29
- package/dist/module/js/site/getSiteLevelFromState.js.map +0 -1
- package/dist/module/js/site/isTVEnabled.js +0 -10
- package/dist/module/js/site/isTVEnabled.js.map +0 -1
- package/dist/module/session.js +0 -58
- package/dist/module/session.js.map +0 -1
- package/dist/module/styles.js +0 -67
- package/dist/module/styles.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-core-app",
|
|
3
|
-
"version": "6.0.0",
|
|
3
|
+
"version": "6.0.2-auth.0",
|
|
4
4
|
"description": "Core extension package for Pluss Communities platform",
|
|
5
5
|
"main": "dist/module/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
"patch": "npm version patch",
|
|
16
16
|
"betaupload": "npm run build && npm publish --access public --tag beta",
|
|
17
17
|
"betaupload:p": "npm run betapatch && npm run betaupload",
|
|
18
|
+
"authpatch": "npm version prepatch --preid=auth",
|
|
19
|
+
"authupload": "npm i && npm i && npm publish --access public --tag auth",
|
|
20
|
+
"authupload:p": "npm run authpatch && npm run authupload",
|
|
18
21
|
"upload": "npm run build && npm publish --access public",
|
|
19
22
|
"upload:p": "npm run patch && npm run upload"
|
|
20
23
|
},
|
package/src/apis/fileActions.js
CHANGED
|
@@ -1,41 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Storage } from 'aws-amplify';
|
|
1
|
+
import Axios from 'axios';
|
|
3
2
|
import { getUrl, generateImageName, randomString } from '../helper';
|
|
4
3
|
import { authedFunction } from '../session';
|
|
5
|
-
import Config from '../config';
|
|
6
4
|
|
|
7
5
|
export const fileActions = {
|
|
6
|
+
getPresignedUrl: async (filename, contentType) => {
|
|
7
|
+
// const newFilename = filename.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
|
|
8
|
+
const signedUrlRes = await authedFunction({
|
|
9
|
+
method: 'GET',
|
|
10
|
+
url: getUrl('media', 'get/presignedurl', { filename, contentType }),
|
|
11
|
+
});
|
|
12
|
+
return signedUrlRes.data;
|
|
13
|
+
},
|
|
8
14
|
getUploadUrl: (userId, fileName) => {
|
|
9
15
|
const newFilename = fileName.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
|
|
10
16
|
return `uploads/users/${userId}/public/${randomString()}/${newFilename}`;
|
|
11
17
|
},
|
|
12
|
-
uploadUserMediaWithProgress: async (
|
|
13
|
-
|
|
14
|
-
return fileActions.uploadBlobAWS(Config.env.awsUploadsBucket, url, blob, '', progressCallback);
|
|
18
|
+
uploadUserMediaWithProgress: async (blob, url, progressCallback = null) => {
|
|
19
|
+
return fileActions.uploadBlobAWS(url, blob, progressCallback);
|
|
15
20
|
},
|
|
16
|
-
// uploadUserMedia: async (userId, image, fileName) => {
|
|
17
|
-
// const blob = await fileActions.imageToBlob(image.uri);
|
|
18
|
-
// const url = fileActions.getUploadUrl(userId, fileName);
|
|
19
|
-
// return fileActions.uploadBlobAWS(Config.env.awsUploadsBucket, url, blob);
|
|
20
|
-
// },
|
|
21
|
-
// uploadSignatureImage: async (image, name) => {
|
|
22
|
-
// const blob = await fileActions.imageToBlob(image);
|
|
23
|
-
// const newImageName = generateImageName(name, 'signature.png');
|
|
24
|
-
// return fileActions.uploadBlobAWS(Config.env.awsStorageBucket, newImageName, blob, 'images/');
|
|
25
|
-
// },
|
|
26
21
|
imageToBlob: async imageUri => {
|
|
27
22
|
const response = await fetch(imageUri);
|
|
28
23
|
return response.blob();
|
|
29
24
|
},
|
|
30
|
-
uploadBlobAWS: (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
customPrefix: { public: '' },
|
|
38
|
-
progressCallback: progress =>
|
|
25
|
+
uploadBlobAWS: async (uri, blob, progressCallback = null) => {
|
|
26
|
+
return Axios.put(uri, blob, {
|
|
27
|
+
headers: {
|
|
28
|
+
'Content-Type': blob.type,
|
|
29
|
+
},
|
|
30
|
+
transformRequest: d => d,
|
|
31
|
+
onUploadProgress: progress =>
|
|
39
32
|
progressCallback &&
|
|
40
33
|
progressCallback({
|
|
41
34
|
uri,
|
|
@@ -43,8 +36,7 @@ export const fileActions = {
|
|
|
43
36
|
total: progress.total,
|
|
44
37
|
percentage: `${Math.floor((progress.loaded / progress.total) * 100)}%`,
|
|
45
38
|
}),
|
|
46
|
-
};
|
|
47
|
-
return Storage.put(`${prefix}${imageName}`, blob, access);
|
|
39
|
+
});
|
|
48
40
|
},
|
|
49
41
|
getStockPhotos: async () => {
|
|
50
42
|
const response = await authedFunction({
|
|
@@ -142,23 +142,25 @@ class ImageUploader extends Component {
|
|
|
142
142
|
let uploadUri;
|
|
143
143
|
try {
|
|
144
144
|
const fileName = `${getValueOrDefault(this.props.fileName, DEFAULT_IMAGE_NAME)}.${DEFULAT_IMAGE_TYPE}`;
|
|
145
|
-
uploadUri = fileActions.getUploadUrl(this.props.userId, fileName);
|
|
146
145
|
|
|
147
|
-
this.props.onUploadStarted(uploadUri, imageUri);
|
|
148
146
|
this.hideUploadMenu();
|
|
149
147
|
|
|
150
148
|
const resized = await this.resizeImageAsync(imageUri);
|
|
149
|
+
const blob = await fileActions.imageToBlob(resized.uri);
|
|
150
|
+
const presignedUriRes = await fileActions.getPresignedUrl(_.last(resized.uri.split('/')), blob.type);
|
|
151
|
+
uploadUri = presignedUriRes.key;
|
|
152
|
+
this.props.onUploadStarted(uploadUri, imageUri);
|
|
151
153
|
if (this.props.onlySelectImage) {
|
|
152
154
|
this.props.onImageSelected(resized, fileName);
|
|
153
155
|
return;
|
|
154
156
|
}
|
|
155
157
|
|
|
156
|
-
const
|
|
158
|
+
const uploadResult = await fileActions.uploadUserMediaWithProgress(blob, presignedUriRes.url, progress => {
|
|
157
159
|
if (this.props.onUploadProgress) this.props.onUploadProgress(progress);
|
|
158
160
|
});
|
|
159
161
|
|
|
160
|
-
this.props.onUploadSuccess(Config.env.baseUploadsUrl +
|
|
161
|
-
console.log('upload success', Config.env.baseUploadsUrl +
|
|
162
|
+
this.props.onUploadSuccess(Config.env.baseUploadsUrl + uploadUri, uploadUri);
|
|
163
|
+
console.log('upload success', Config.env.baseUploadsUrl + uploadUri);
|
|
162
164
|
} catch (e) {
|
|
163
165
|
console.log('handleImagePicked error', e);
|
|
164
166
|
this.props.onUploadFailed(uploadUri);
|
|
@@ -170,7 +172,6 @@ class ImageUploader extends Component {
|
|
|
170
172
|
const imagesUploaded = imagesSelected.map(image => {
|
|
171
173
|
const fileName = `${getValueOrDefault(this.props.fileName, DEFAULT_IMAGE_NAME)}.${DEFULAT_IMAGE_TYPE}`;
|
|
172
174
|
const uploadUri = fileActions.getUploadUrl(this.props.userId, fileName);
|
|
173
|
-
if (!this.props.onlySelectImage) this.props.onUploadStarted(uploadUri, image.uri);
|
|
174
175
|
return { imageUri: image.uri, uploadUri, fileName };
|
|
175
176
|
});
|
|
176
177
|
this.hideUploadMenu();
|
|
@@ -181,16 +182,21 @@ class ImageUploader extends Component {
|
|
|
181
182
|
const { imageUri, uploadUri, fileName } = image;
|
|
182
183
|
try {
|
|
183
184
|
const resized = await this.resizeImageAsync(imageUri);
|
|
185
|
+
const blob = await fileActions.imageToBlob(resized.uri);
|
|
184
186
|
if (this.props.onlySelectImage) {
|
|
185
187
|
this.props.onImageSelected(resized, fileName);
|
|
186
188
|
return;
|
|
187
189
|
}
|
|
190
|
+
const presignedUriRes = await fileActions.getPresignedUrl(_.last(resized.uri.split('/')), blob.type);
|
|
191
|
+
const uploadUri = presignedUriRes.key;
|
|
192
|
+
if (!this.props.onlySelectImage) this.props.onUploadStarted(uploadUri, imageUri);
|
|
188
193
|
|
|
189
|
-
const
|
|
194
|
+
const uploadResult = await fileActions.uploadUserMediaWithProgress(blob, presignedUriRes.url, progress => {
|
|
190
195
|
if (this.props.onUploadProgress) this.props.onUploadProgress(progress);
|
|
191
196
|
});
|
|
192
|
-
|
|
193
|
-
|
|
197
|
+
|
|
198
|
+
this.props.onUploadSuccess(Config.env.baseUploadsUrl + uploadUri, uploadUri);
|
|
199
|
+
console.log('upload success', Config.env.baseUploadsUrl + uploadUri);
|
|
194
200
|
} catch (e) {
|
|
195
201
|
console.log('handleMultiImagePicked error', e);
|
|
196
202
|
this.props.onUploadFailed(uploadUri);
|
|
@@ -203,7 +209,7 @@ class ImageUploader extends Component {
|
|
|
203
209
|
try {
|
|
204
210
|
const fileType = uri.substring(uri.lastIndexOf('.') + 1);
|
|
205
211
|
const fileName = `${getValueOrDefault(this.props.fileName, DEFAULT_VIDEO_NAME)}.${fileType}`;
|
|
206
|
-
uploadUri = fileActions.
|
|
212
|
+
uploadUri = await fileActions.getPresignedUrl(fileName);
|
|
207
213
|
|
|
208
214
|
this.props.onUploadStarted(uploadUri, uri);
|
|
209
215
|
this.hideUploadMenu();
|
|
@@ -266,6 +272,7 @@ class ImageUploader extends Component {
|
|
|
266
272
|
};
|
|
267
273
|
|
|
268
274
|
isEditingEnabled = () => {
|
|
275
|
+
return false;
|
|
269
276
|
return !this.props.multiple && !this.props.allowVideo && getValueOrDefault(this.props.allowsEditing, DEFAULT_ALLOWS_EDITING);
|
|
270
277
|
};
|
|
271
278
|
|
package/src/config.js
CHANGED
|
@@ -18,6 +18,11 @@ const CoreConfig = {
|
|
|
18
18
|
strings: {},
|
|
19
19
|
newEventDefaults: '',
|
|
20
20
|
defaultAllowComments: true,
|
|
21
|
+
AuthStrategy: {
|
|
22
|
+
getAccessToken: async () => null,
|
|
23
|
+
getCurrentUserId: async () => null,
|
|
24
|
+
hasActiveSession: async () => false,
|
|
25
|
+
},
|
|
21
26
|
},
|
|
22
27
|
init: (environment, navigation) => {
|
|
23
28
|
CoreConfig.env = environment;
|
package/src/session.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
import { Auth } from 'aws-amplify';
|
|
4
|
+
import Config from './config';
|
|
4
5
|
|
|
5
6
|
export const getSessionTokenAWS = async prefix => {
|
|
6
|
-
const
|
|
7
|
-
const token = data.accessToken.jwtToken;
|
|
7
|
+
const token = await Config.env.AuthStrategy.getAccessToken();
|
|
8
8
|
if (_.isUndefined(prefix)) return token;
|
|
9
9
|
return `${prefix} ${token}`;
|
|
10
10
|
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import { LOAD_FOLLOWERS, ADD_FOLLOWER, REMOVE_FOLLOWER } from './types';
|
|
3
|
-
import { followerActions } from '../apis/followerActions';
|
|
4
|
-
export const loadFollowers = followers => {
|
|
5
|
-
return {
|
|
6
|
-
type: LOAD_FOLLOWERS,
|
|
7
|
-
payload: followers
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export const getFollowers = userId => {
|
|
11
|
-
return async dispatch => {
|
|
12
|
-
followerActions.getFollowing(userId).then(res => {
|
|
13
|
-
// console.log('getFollowing', res.data);
|
|
14
|
-
if (res.data != null && res.data.Items != null && !_.isEmpty(res.data.Items)) {
|
|
15
|
-
dispatch(loadFollowers(res.data.Items));
|
|
16
|
-
}
|
|
17
|
-
}).catch(error => {
|
|
18
|
-
console.log('getFollowing', error);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export const addFollower = user => {
|
|
23
|
-
return {
|
|
24
|
-
type: ADD_FOLLOWER,
|
|
25
|
-
payload: user
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export const removeFollower = userId => {
|
|
29
|
-
return {
|
|
30
|
-
type: REMOVE_FOLLOWER,
|
|
31
|
-
payload: userId
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=FollowerActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_","LOAD_FOLLOWERS","ADD_FOLLOWER","REMOVE_FOLLOWER","followerActions","loadFollowers","followers","type","payload","getFollowers","userId","dispatch","getFollowing","then","res","data","Items","isEmpty","catch","error","console","log","addFollower","user","removeFollower"],"sources":["FollowerActions.js"],"sourcesContent":["import _ from 'lodash';\nimport { LOAD_FOLLOWERS, ADD_FOLLOWER, REMOVE_FOLLOWER } from './types';\nimport { followerActions } from '../apis/followerActions';\n\nexport const loadFollowers = followers => {\n return {\n type: LOAD_FOLLOWERS,\n payload: followers,\n };\n};\n\nexport const getFollowers = userId => {\n return async dispatch => {\n followerActions\n .getFollowing(userId)\n .then(res => {\n // console.log('getFollowing', res.data);\n if (res.data != null && res.data.Items != null && !_.isEmpty(res.data.Items)) {\n dispatch(loadFollowers(res.data.Items));\n }\n })\n .catch(error => {\n console.log('getFollowing', error);\n });\n };\n};\n\nexport const addFollower = user => {\n return {\n type: ADD_FOLLOWER,\n payload: user,\n };\n};\n\nexport const removeFollower = userId => {\n return {\n type: REMOVE_FOLLOWER,\n payload: userId,\n };\n};\n"],"mappings":"AAAA,OAAOA,CAAC,MAAM,QAAQ;AACtB,SAASC,cAAc,EAAEC,YAAY,EAAEC,eAAe,QAAQ,SAAS;AACvE,SAASC,eAAe,QAAQ,yBAAyB;AAEzD,OAAO,MAAMC,aAAa,GAAGC,SAAS,IAAI;EACxC,OAAO;IACLC,IAAI,EAAEN,cAAc;IACpBO,OAAO,EAAEF;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMG,YAAY,GAAGC,MAAM,IAAI;EACpC,OAAO,MAAMC,QAAQ,IAAI;IACvBP,eAAe,CACZQ,YAAY,CAACF,MAAM,CAAC,CACpBG,IAAI,CAACC,GAAG,IAAI;MACX;MACA,IAAIA,GAAG,CAACC,IAAI,IAAI,IAAI,IAAID,GAAG,CAACC,IAAI,CAACC,KAAK,IAAI,IAAI,IAAI,CAAChB,CAAC,CAACiB,OAAO,CAACH,GAAG,CAACC,IAAI,CAACC,KAAK,CAAC,EAAE;QAC5EL,QAAQ,CAACN,aAAa,CAACS,GAAG,CAACC,IAAI,CAACC,KAAK,CAAC,CAAC;MACzC;IACF,CAAC,CAAC,CACDE,KAAK,CAACC,KAAK,IAAI;MACdC,OAAO,CAACC,GAAG,CAAC,cAAc,EAAEF,KAAK,CAAC;IACpC,CAAC,CAAC;EACN,CAAC;AACH,CAAC;AAED,OAAO,MAAMG,WAAW,GAAGC,IAAI,IAAI;EACjC,OAAO;IACLhB,IAAI,EAAEL,YAAY;IAClBM,OAAO,EAAEe;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMC,cAAc,GAAGd,MAAM,IAAI;EACtC,OAAO;IACLH,IAAI,EAAEJ,eAAe;IACrBK,OAAO,EAAEE;EACX,CAAC;AACH,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { IMAGE_LIBRARY_LOADED, STOCK_IMAGES_LOADED, IMAGE_FOLDER_UPDATED, SAVE_IMAGE_POSITION } from './types';
|
|
2
|
-
export const stockImagesLoaded = images => {
|
|
3
|
-
return {
|
|
4
|
-
type: STOCK_IMAGES_LOADED,
|
|
5
|
-
payload: images
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export const imageLibraryLoaded = library => {
|
|
9
|
-
return {
|
|
10
|
-
type: IMAGE_LIBRARY_LOADED,
|
|
11
|
-
payload: library
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export const imageFolderUpdated = folder => {
|
|
15
|
-
return {
|
|
16
|
-
type: IMAGE_FOLDER_UPDATED,
|
|
17
|
-
payload: folder
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export const saveImagePosition = (uri, positions) => {
|
|
21
|
-
return {
|
|
22
|
-
type: SAVE_IMAGE_POSITION,
|
|
23
|
-
payload: {
|
|
24
|
-
uri,
|
|
25
|
-
positions
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=MediaActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["IMAGE_LIBRARY_LOADED","STOCK_IMAGES_LOADED","IMAGE_FOLDER_UPDATED","SAVE_IMAGE_POSITION","stockImagesLoaded","images","type","payload","imageLibraryLoaded","library","imageFolderUpdated","folder","saveImagePosition","uri","positions"],"sources":["MediaActions.js"],"sourcesContent":["import { IMAGE_LIBRARY_LOADED, STOCK_IMAGES_LOADED, IMAGE_FOLDER_UPDATED, SAVE_IMAGE_POSITION } from './types';\n\nexport const stockImagesLoaded = images => {\n return {\n type: STOCK_IMAGES_LOADED,\n payload: images,\n };\n};\n\nexport const imageLibraryLoaded = library => {\n return {\n type: IMAGE_LIBRARY_LOADED,\n payload: library,\n };\n};\n\nexport const imageFolderUpdated = folder => {\n return {\n type: IMAGE_FOLDER_UPDATED,\n payload: folder,\n };\n};\n\nexport const saveImagePosition = (uri, positions) => {\n return {\n type: SAVE_IMAGE_POSITION,\n payload: { uri, positions },\n };\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,EAAEC,mBAAmB,EAAEC,oBAAoB,EAAEC,mBAAmB,QAAQ,SAAS;AAE9G,OAAO,MAAMC,iBAAiB,GAAGC,MAAM,IAAI;EACzC,OAAO;IACLC,IAAI,EAAEL,mBAAmB;IACzBM,OAAO,EAAEF;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMG,kBAAkB,GAAGC,OAAO,IAAI;EAC3C,OAAO;IACLH,IAAI,EAAEN,oBAAoB;IAC1BO,OAAO,EAAEE;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAGC,MAAM,IAAI;EAC1C,OAAO;IACLL,IAAI,EAAEJ,oBAAoB;IAC1BK,OAAO,EAAEI;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAGA,CAACC,GAAG,EAAEC,SAAS,KAAK;EACnD,OAAO;IACLR,IAAI,EAAEH,mBAAmB;IACzBI,OAAO,EAAE;MAAEM,GAAG;MAAEC;IAAU;EAC5B,CAAC;AACH,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { UPDATE_RESIDENTS, LOADED_RESIDENTS, LOADED_LINKED_USERS, LOADED_LINKED_TO_USERS } from './types';
|
|
2
|
-
export const updateResidents = userContact => {
|
|
3
|
-
return {
|
|
4
|
-
type: UPDATE_RESIDENTS,
|
|
5
|
-
payload: userContact
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export const residentsLoaded = list => {
|
|
9
|
-
return {
|
|
10
|
-
type: LOADED_RESIDENTS,
|
|
11
|
-
payload: list
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export const linkedUsersLoaded = linkedUsers => {
|
|
15
|
-
return {
|
|
16
|
-
type: LOADED_LINKED_USERS,
|
|
17
|
-
payload: linkedUsers
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export const linkedToUsersLoaded = linkedToUsers => {
|
|
21
|
-
return {
|
|
22
|
-
type: LOADED_LINKED_TO_USERS,
|
|
23
|
-
payload: linkedToUsers
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=ResidentActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["UPDATE_RESIDENTS","LOADED_RESIDENTS","LOADED_LINKED_USERS","LOADED_LINKED_TO_USERS","updateResidents","userContact","type","payload","residentsLoaded","list","linkedUsersLoaded","linkedUsers","linkedToUsersLoaded","linkedToUsers"],"sources":["ResidentActions.js"],"sourcesContent":["import { UPDATE_RESIDENTS, LOADED_RESIDENTS, LOADED_LINKED_USERS, LOADED_LINKED_TO_USERS } from './types';\n\nexport const updateResidents = userContact => {\n return {\n type: UPDATE_RESIDENTS,\n payload: userContact,\n };\n};\n\nexport const residentsLoaded = list => {\n return {\n type: LOADED_RESIDENTS,\n payload: list,\n };\n};\n\nexport const linkedUsersLoaded = linkedUsers => {\n return {\n type: LOADED_LINKED_USERS,\n payload: linkedUsers,\n };\n};\n\nexport const linkedToUsersLoaded = linkedToUsers => {\n return {\n type: LOADED_LINKED_TO_USERS,\n payload: linkedToUsers,\n };\n};\n"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,gBAAgB,EAAEC,mBAAmB,EAAEC,sBAAsB,QAAQ,SAAS;AAEzG,OAAO,MAAMC,eAAe,GAAGC,WAAW,IAAI;EAC5C,OAAO;IACLC,IAAI,EAAEN,gBAAgB;IACtBO,OAAO,EAAEF;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMG,eAAe,GAAGC,IAAI,IAAI;EACrC,OAAO;IACLH,IAAI,EAAEL,gBAAgB;IACtBM,OAAO,EAAEE;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAGC,WAAW,IAAI;EAC9C,OAAO;IACLL,IAAI,EAAEJ,mBAAmB;IACzBK,OAAO,EAAEI;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMC,mBAAmB,GAAGC,aAAa,IAAI;EAClD,OAAO;IACLP,IAAI,EAAEH,sBAAsB;IAC5BI,OAAO,EAAEM;EACX,CAAC;AACH,CAAC"}
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
// import axios from 'axios';
|
|
2
|
-
import {
|
|
3
|
-
// SAVE_PROFILE_PIC_SUCCESS,
|
|
4
|
-
// SAVE_PROFILE_PIC_FAIL,
|
|
5
|
-
// ONBOARDING_UPDATE,
|
|
6
|
-
// HOME_ONBOARDING_UPDATE,
|
|
7
|
-
// USER_UPDATED,
|
|
8
|
-
UPDATE_USER_STATE
|
|
9
|
-
// UPDATE_USER_STATE_FAIL,
|
|
10
|
-
} from './types';
|
|
11
|
-
// import { baseUrl } from '../config';
|
|
12
|
-
// import { userActions } from '../webapi';
|
|
13
|
-
|
|
14
|
-
// const ROOT_URL = baseUrl;
|
|
15
|
-
|
|
16
|
-
// export const updateProfilePic = uri => {
|
|
17
|
-
// return async dispatch => {
|
|
18
|
-
// let userID = null;
|
|
19
|
-
// let token = null;
|
|
20
|
-
// if (userID) {
|
|
21
|
-
// dispatch({
|
|
22
|
-
// type: SAVE_PROFILE_PIC_SUCCESS,
|
|
23
|
-
// payload: { profilePic: uri },
|
|
24
|
-
// });
|
|
25
|
-
// await axios({
|
|
26
|
-
// method: 'post',
|
|
27
|
-
// url: `${ROOT_URL}/updateProfilePic`,
|
|
28
|
-
// data: {
|
|
29
|
-
// uri,
|
|
30
|
-
// userID,
|
|
31
|
-
// },
|
|
32
|
-
// headers: {
|
|
33
|
-
// authorization: `Bearer ${token}`,
|
|
34
|
-
// },
|
|
35
|
-
// })
|
|
36
|
-
// .then(() => {
|
|
37
|
-
// dispatch({
|
|
38
|
-
// type: SAVE_PROFILE_PIC_SUCCESS,
|
|
39
|
-
// payload: { profilePic: uri },
|
|
40
|
-
// });
|
|
41
|
-
// })
|
|
42
|
-
// .catch(error => {
|
|
43
|
-
// console.log(error.response.data);
|
|
44
|
-
// dispatch({ type: SAVE_PROFILE_PIC_FAIL });
|
|
45
|
-
// });
|
|
46
|
-
// }
|
|
47
|
-
// };
|
|
48
|
-
// };
|
|
49
|
-
|
|
50
|
-
// export const updateUser = (input, callback) => {
|
|
51
|
-
// return async dispatch => {
|
|
52
|
-
// console.log('update User Action hit');
|
|
53
|
-
// dispatch({
|
|
54
|
-
// type: USER_UPDATED,
|
|
55
|
-
// payload: input,
|
|
56
|
-
// });
|
|
57
|
-
// };
|
|
58
|
-
// };
|
|
59
|
-
|
|
60
|
-
export const softUpdateUser = input => {
|
|
61
|
-
return {
|
|
62
|
-
type: UPDATE_USER_STATE,
|
|
63
|
-
payload: input
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export const updateNavRead = input => {
|
|
67
|
-
return async dispatch => {
|
|
68
|
-
setTimeout(() => {
|
|
69
|
-
dispatch({
|
|
70
|
-
type: UPDATE_USER_STATE,
|
|
71
|
-
payload: {
|
|
72
|
-
openedNotifs: input
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}, 500);
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
/*
|
|
80
|
-
Update user data without triggering uploadingProfile or uploadingProfilePic
|
|
81
|
-
*/
|
|
82
|
-
// export const silentUpdateUser = (input, immediate) => {
|
|
83
|
-
// return async dispatch => {
|
|
84
|
-
// if (immediate) {
|
|
85
|
-
// dispatch({
|
|
86
|
-
// type: UPDATE_USER_STATE,
|
|
87
|
-
// payload: input,
|
|
88
|
-
// });
|
|
89
|
-
// }
|
|
90
|
-
// userActions
|
|
91
|
-
// .updateProfile(input)
|
|
92
|
-
// .then(res => {
|
|
93
|
-
// if (res.data.userCreationFail) {
|
|
94
|
-
// console.log('user update failed', res.data.message);
|
|
95
|
-
// dispatch({
|
|
96
|
-
// type: UPDATE_USER_STATE_FAIL,
|
|
97
|
-
// payload: res.data.message,
|
|
98
|
-
// });
|
|
99
|
-
// } else {
|
|
100
|
-
// dispatch({
|
|
101
|
-
// type: UPDATE_USER_STATE,
|
|
102
|
-
// payload: input,
|
|
103
|
-
// });
|
|
104
|
-
// }
|
|
105
|
-
// })
|
|
106
|
-
// .catch(err => {
|
|
107
|
-
// console.log('user update fail -- Silent Upate', err);
|
|
108
|
-
// });
|
|
109
|
-
// };
|
|
110
|
-
// };
|
|
111
|
-
|
|
112
|
-
// export const seenOnboarding = () => {
|
|
113
|
-
// return async dispatch => {
|
|
114
|
-
// dispatch({ type: ONBOARDING_UPDATE });
|
|
115
|
-
// let userID = null;
|
|
116
|
-
// let token = null;
|
|
117
|
-
// if (userID) {
|
|
118
|
-
// await axios({
|
|
119
|
-
// method: 'post',
|
|
120
|
-
// url: `${ROOT_URL}/updateProfile`,
|
|
121
|
-
// data: {
|
|
122
|
-
// userID,
|
|
123
|
-
// details: {
|
|
124
|
-
// onBoardingSeen: true,
|
|
125
|
-
// },
|
|
126
|
-
// },
|
|
127
|
-
// headers: {
|
|
128
|
-
// authorization: `Bearer ${token}`,
|
|
129
|
-
// },
|
|
130
|
-
// })
|
|
131
|
-
// .then(() => {})
|
|
132
|
-
// .catch(() => {
|
|
133
|
-
// console.log('onBoarding update fail');
|
|
134
|
-
// });
|
|
135
|
-
// }
|
|
136
|
-
// };
|
|
137
|
-
// };
|
|
138
|
-
|
|
139
|
-
/*
|
|
140
|
-
Will combine this eventually with above function
|
|
141
|
-
*/
|
|
142
|
-
// export const seenHomeOnboarding = () => {
|
|
143
|
-
// return async dispatch => {
|
|
144
|
-
// dispatch({ type: HOME_ONBOARDING_UPDATE });
|
|
145
|
-
// let userID = null;
|
|
146
|
-
// let token = null;
|
|
147
|
-
// if (userID) {
|
|
148
|
-
// await axios({
|
|
149
|
-
// method: 'post',
|
|
150
|
-
// url: `${ROOT_URL}/updateProfile`,
|
|
151
|
-
// data: {
|
|
152
|
-
// userID,
|
|
153
|
-
// details: {
|
|
154
|
-
// homeOnboardingSeen: true,
|
|
155
|
-
// },
|
|
156
|
-
// },
|
|
157
|
-
// headers: {
|
|
158
|
-
// authorization: `Bearer ${token}`,
|
|
159
|
-
// },
|
|
160
|
-
// })
|
|
161
|
-
// .then(() => {})
|
|
162
|
-
// .catch(() => {
|
|
163
|
-
// console.log('onBoarding update fail');
|
|
164
|
-
// });
|
|
165
|
-
// }
|
|
166
|
-
// };
|
|
167
|
-
// };
|
|
168
|
-
|
|
169
|
-
/*
|
|
170
|
-
Triggered at app startup for saving user current home takeover.
|
|
171
|
-
*/
|
|
172
|
-
// export const updateUserStartupTakeover = async input => {
|
|
173
|
-
// let userID = null;
|
|
174
|
-
// let token = null;
|
|
175
|
-
// if (userID) {
|
|
176
|
-
// await axios({
|
|
177
|
-
// method: 'post',
|
|
178
|
-
// url: `${ROOT_URL}/updateProfile`,
|
|
179
|
-
// data: {
|
|
180
|
-
// userID,
|
|
181
|
-
// details: input,
|
|
182
|
-
// },
|
|
183
|
-
// headers: {
|
|
184
|
-
// authorization: `Bearer ${token}`,
|
|
185
|
-
// },
|
|
186
|
-
// })
|
|
187
|
-
// .then(() => {})
|
|
188
|
-
// .catch(() => {
|
|
189
|
-
// console.log('startup takeover save fail -- Update User Startup Takeover');
|
|
190
|
-
// });
|
|
191
|
-
// }
|
|
192
|
-
// };
|
|
193
|
-
|
|
194
|
-
// export const registerStandaloneUser = takeover => {
|
|
195
|
-
// return async dispatch => {
|
|
196
|
-
// let userObj = null;
|
|
197
|
-
// if (userObj && takeover) {
|
|
198
|
-
// await axios({
|
|
199
|
-
// method: 'post',
|
|
200
|
-
// url: `${ROOT_URL}/registerStandaloneUser`,
|
|
201
|
-
// data: {
|
|
202
|
-
// userObj,
|
|
203
|
-
// takeoverKey: takeover.Key,
|
|
204
|
-
// },
|
|
205
|
-
// headers: {
|
|
206
|
-
// authorization: 'Gweg',
|
|
207
|
-
// },
|
|
208
|
-
// })
|
|
209
|
-
// .then(() => {
|
|
210
|
-
// dispatch({
|
|
211
|
-
// type: UPDATE_USER_STATE,
|
|
212
|
-
// payload: { standaloneRegistered: true },
|
|
213
|
-
// });
|
|
214
|
-
// })
|
|
215
|
-
// .catch(() => {
|
|
216
|
-
// console.log('register standalone user -- fail');
|
|
217
|
-
// });
|
|
218
|
-
// } else {
|
|
219
|
-
// console.log('Failed to detect user for takeover registration');
|
|
220
|
-
// }
|
|
221
|
-
// };
|
|
222
|
-
// };
|
|
223
|
-
//# sourceMappingURL=UserActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["UPDATE_USER_STATE","softUpdateUser","input","type","payload","updateNavRead","dispatch","setTimeout","openedNotifs"],"sources":["UserActions.js"],"sourcesContent":["// import axios from 'axios';\nimport {\n // SAVE_PROFILE_PIC_SUCCESS,\n // SAVE_PROFILE_PIC_FAIL,\n // ONBOARDING_UPDATE,\n // HOME_ONBOARDING_UPDATE,\n // USER_UPDATED,\n UPDATE_USER_STATE,\n // UPDATE_USER_STATE_FAIL,\n} from './types';\n// import { baseUrl } from '../config';\n// import { userActions } from '../webapi';\n\n// const ROOT_URL = baseUrl;\n\n// export const updateProfilePic = uri => {\n// return async dispatch => {\n// let userID = null;\n// let token = null;\n// if (userID) {\n// dispatch({\n// type: SAVE_PROFILE_PIC_SUCCESS,\n// payload: { profilePic: uri },\n// });\n// await axios({\n// method: 'post',\n// url: `${ROOT_URL}/updateProfilePic`,\n// data: {\n// uri,\n// userID,\n// },\n// headers: {\n// authorization: `Bearer ${token}`,\n// },\n// })\n// .then(() => {\n// dispatch({\n// type: SAVE_PROFILE_PIC_SUCCESS,\n// payload: { profilePic: uri },\n// });\n// })\n// .catch(error => {\n// console.log(error.response.data);\n// dispatch({ type: SAVE_PROFILE_PIC_FAIL });\n// });\n// }\n// };\n// };\n\n// export const updateUser = (input, callback) => {\n// return async dispatch => {\n// console.log('update User Action hit');\n// dispatch({\n// type: USER_UPDATED,\n// payload: input,\n// });\n// };\n// };\n\nexport const softUpdateUser = input => {\n return {\n type: UPDATE_USER_STATE,\n payload: input,\n };\n};\n\nexport const updateNavRead = input => {\n return async dispatch => {\n setTimeout(() => {\n dispatch({\n type: UPDATE_USER_STATE,\n payload: { openedNotifs: input },\n });\n }, 500);\n };\n};\n\n/* \nUpdate user data without triggering uploadingProfile or uploadingProfilePic\n*/\n// export const silentUpdateUser = (input, immediate) => {\n// return async dispatch => {\n// if (immediate) {\n// dispatch({\n// type: UPDATE_USER_STATE,\n// payload: input,\n// });\n// }\n// userActions\n// .updateProfile(input)\n// .then(res => {\n// if (res.data.userCreationFail) {\n// console.log('user update failed', res.data.message);\n// dispatch({\n// type: UPDATE_USER_STATE_FAIL,\n// payload: res.data.message,\n// });\n// } else {\n// dispatch({\n// type: UPDATE_USER_STATE,\n// payload: input,\n// });\n// }\n// })\n// .catch(err => {\n// console.log('user update fail -- Silent Upate', err);\n// });\n// };\n// };\n\n// export const seenOnboarding = () => {\n// return async dispatch => {\n// dispatch({ type: ONBOARDING_UPDATE });\n// let userID = null;\n// let token = null;\n// if (userID) {\n// await axios({\n// method: 'post',\n// url: `${ROOT_URL}/updateProfile`,\n// data: {\n// userID,\n// details: {\n// onBoardingSeen: true,\n// },\n// },\n// headers: {\n// authorization: `Bearer ${token}`,\n// },\n// })\n// .then(() => {})\n// .catch(() => {\n// console.log('onBoarding update fail');\n// });\n// }\n// };\n// };\n\n/* \n Will combine this eventually with above function\n*/\n// export const seenHomeOnboarding = () => {\n// return async dispatch => {\n// dispatch({ type: HOME_ONBOARDING_UPDATE });\n// let userID = null;\n// let token = null;\n// if (userID) {\n// await axios({\n// method: 'post',\n// url: `${ROOT_URL}/updateProfile`,\n// data: {\n// userID,\n// details: {\n// homeOnboardingSeen: true,\n// },\n// },\n// headers: {\n// authorization: `Bearer ${token}`,\n// },\n// })\n// .then(() => {})\n// .catch(() => {\n// console.log('onBoarding update fail');\n// });\n// }\n// };\n// };\n\n/* \nTriggered at app startup for saving user current home takeover. \n*/\n// export const updateUserStartupTakeover = async input => {\n// let userID = null;\n// let token = null;\n// if (userID) {\n// await axios({\n// method: 'post',\n// url: `${ROOT_URL}/updateProfile`,\n// data: {\n// userID,\n// details: input,\n// },\n// headers: {\n// authorization: `Bearer ${token}`,\n// },\n// })\n// .then(() => {})\n// .catch(() => {\n// console.log('startup takeover save fail -- Update User Startup Takeover');\n// });\n// }\n// };\n\n// export const registerStandaloneUser = takeover => {\n// return async dispatch => {\n// let userObj = null;\n// if (userObj && takeover) {\n// await axios({\n// method: 'post',\n// url: `${ROOT_URL}/registerStandaloneUser`,\n// data: {\n// userObj,\n// takeoverKey: takeover.Key,\n// },\n// headers: {\n// authorization: 'Gweg',\n// },\n// })\n// .then(() => {\n// dispatch({\n// type: UPDATE_USER_STATE,\n// payload: { standaloneRegistered: true },\n// });\n// })\n// .catch(() => {\n// console.log('register standalone user -- fail');\n// });\n// } else {\n// console.log('Failed to detect user for takeover registration');\n// }\n// };\n// };\n"],"mappings":"AAAA;AACA;AACE;AACA;AACA;AACA;AACA;AACAA;AACA;AAAA,OACK,SAAS;AAChB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,cAAc,GAAGC,KAAK,IAAI;EACrC,OAAO;IACLC,IAAI,EAAEH,iBAAiB;IACvBI,OAAO,EAAEF;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMG,aAAa,GAAGH,KAAK,IAAI;EACpC,OAAO,MAAMI,QAAQ,IAAI;IACvBC,UAAU,CAAC,MAAM;MACfD,QAAQ,CAAC;QACPH,IAAI,EAAEH,iBAAiB;QACvBI,OAAO,EAAE;UAAEI,YAAY,EAAEN;QAAM;MACjC,CAAC,CAAC;IACJ,CAAC,EAAE,GAAG,CAAC;EACT,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BLOCK_USER, UNBLOCK_USER } from './types';
|
|
2
|
-
export const blockUser = userId => {
|
|
3
|
-
return {
|
|
4
|
-
type: BLOCK_USER,
|
|
5
|
-
payload: userId
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export const unblockUser = userId => {
|
|
9
|
-
return {
|
|
10
|
-
type: UNBLOCK_USER,
|
|
11
|
-
payload: userId
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=UserSettingsActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BLOCK_USER","UNBLOCK_USER","blockUser","userId","type","payload","unblockUser"],"sources":["UserSettingsActions.js"],"sourcesContent":["import { BLOCK_USER, UNBLOCK_USER } from './types';\n\nexport const blockUser = userId => {\n return {\n type: BLOCK_USER,\n payload: userId,\n };\n};\n\nexport const unblockUser = userId => {\n return {\n type: UNBLOCK_USER,\n payload: userId,\n };\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,SAAS;AAElD,OAAO,MAAMC,SAAS,GAAGC,MAAM,IAAI;EACjC,OAAO;IACLC,IAAI,EAAEJ,UAAU;IAChBK,OAAO,EAAEF;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMG,WAAW,GAAGH,MAAM,IAAI;EACnC,OAAO;IACLC,IAAI,EAAEH,YAAY;IAClBI,OAAO,EAAEF;EACX,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.js"],"sourcesContent":["export * from './MediaActions';\nexport * from './FollowerActions';\nexport * from './ResidentActions';\nexport * from './UserActions';\nexport * from './UserSettingsActions';\n"],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,eAAe;AAC7B,cAAc,uBAAuB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const LOGOUT = 'LOGOUT';
|
|
2
|
-
export const CHANGE_ROLE = 'CHANGE_ROLE';
|
|
3
|
-
export const IMAGE_LIBRARY_LOADED = 'IMAGE_LIBRARY_LOADED';
|
|
4
|
-
export const STOCK_IMAGES_LOADED = 'STOCK_IMAGES_LOADED';
|
|
5
|
-
export const IMAGE_FOLDER_UPDATED = 'IMAGE_FOLDER_UPDATED';
|
|
6
|
-
export const SAVE_IMAGE_POSITION = 'SAVE_IMAGE_POSITION';
|
|
7
|
-
export const LOAD_FOLLOWERS = 'LOAD_FOLLOWERS';
|
|
8
|
-
export const ADD_FOLLOWER = 'ADD_FOLLOWER';
|
|
9
|
-
export const REMOVE_FOLLOWER = 'REMOVE_FOLLOWER';
|
|
10
|
-
export const UPDATE_RESIDENTS = 'UPDATE_RESIDENTS';
|
|
11
|
-
export const LOADED_RESIDENTS = 'LOADED_RESIDENTS';
|
|
12
|
-
export const LOADED_LINKED_USERS = 'LOADED_LINKED_USERS';
|
|
13
|
-
export const LOADED_LINKED_TO_USERS = 'LOADED_LINKED_TO_USERS';
|
|
14
|
-
export const UPDATE_USER_STATE = 'UPDATE_USER_STATE';
|
|
15
|
-
export const BLOCK_USER = 'BLOCK_USER';
|
|
16
|
-
export const UNBLOCK_USER = 'UNBLOCK_USER';
|
|
17
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["LOGOUT","CHANGE_ROLE","IMAGE_LIBRARY_LOADED","STOCK_IMAGES_LOADED","IMAGE_FOLDER_UPDATED","SAVE_IMAGE_POSITION","LOAD_FOLLOWERS","ADD_FOLLOWER","REMOVE_FOLLOWER","UPDATE_RESIDENTS","LOADED_RESIDENTS","LOADED_LINKED_USERS","LOADED_LINKED_TO_USERS","UPDATE_USER_STATE","BLOCK_USER","UNBLOCK_USER"],"sources":["types.js"],"sourcesContent":["export const LOGOUT = 'LOGOUT';\nexport const CHANGE_ROLE = 'CHANGE_ROLE';\nexport const IMAGE_LIBRARY_LOADED = 'IMAGE_LIBRARY_LOADED';\nexport const STOCK_IMAGES_LOADED = 'STOCK_IMAGES_LOADED';\nexport const IMAGE_FOLDER_UPDATED = 'IMAGE_FOLDER_UPDATED';\nexport const SAVE_IMAGE_POSITION = 'SAVE_IMAGE_POSITION';\nexport const LOAD_FOLLOWERS = 'LOAD_FOLLOWERS';\nexport const ADD_FOLLOWER = 'ADD_FOLLOWER';\nexport const REMOVE_FOLLOWER = 'REMOVE_FOLLOWER';\nexport const UPDATE_RESIDENTS = 'UPDATE_RESIDENTS';\nexport const LOADED_RESIDENTS = 'LOADED_RESIDENTS';\nexport const LOADED_LINKED_USERS = 'LOADED_LINKED_USERS';\nexport const LOADED_LINKED_TO_USERS = 'LOADED_LINKED_TO_USERS';\nexport const UPDATE_USER_STATE = 'UPDATE_USER_STATE';\nexport const BLOCK_USER = 'BLOCK_USER';\nexport const UNBLOCK_USER = 'UNBLOCK_USER';\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG,QAAQ;AAC9B,OAAO,MAAMC,WAAW,GAAG,aAAa;AACxC,OAAO,MAAMC,oBAAoB,GAAG,sBAAsB;AAC1D,OAAO,MAAMC,mBAAmB,GAAG,qBAAqB;AACxD,OAAO,MAAMC,oBAAoB,GAAG,sBAAsB;AAC1D,OAAO,MAAMC,mBAAmB,GAAG,qBAAqB;AACxD,OAAO,MAAMC,cAAc,GAAG,gBAAgB;AAC9C,OAAO,MAAMC,YAAY,GAAG,cAAc;AAC1C,OAAO,MAAMC,eAAe,GAAG,iBAAiB;AAChD,OAAO,MAAMC,gBAAgB,GAAG,kBAAkB;AAClD,OAAO,MAAMC,gBAAgB,GAAG,kBAAkB;AAClD,OAAO,MAAMC,mBAAmB,GAAG,qBAAqB;AACxD,OAAO,MAAMC,sBAAsB,GAAG,wBAAwB;AAC9D,OAAO,MAAMC,iBAAiB,GAAG,mBAAmB;AACpD,OAAO,MAAMC,UAAU,GAAG,YAAY;AACtC,OAAO,MAAMC,YAAY,GAAG,cAAc"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { getUrl } from '../helper';
|
|
2
|
-
import { authedFunction } from '../session';
|
|
3
|
-
export const analyticsActions = {
|
|
4
|
-
log: (site, actionType, entityType, entityId, data) => {
|
|
5
|
-
return authedFunction({
|
|
6
|
-
method: 'POST',
|
|
7
|
-
url: getUrl('analytics', 'log'),
|
|
8
|
-
data: {
|
|
9
|
-
site,
|
|
10
|
-
actionType,
|
|
11
|
-
entityType,
|
|
12
|
-
entityId,
|
|
13
|
-
data
|
|
14
|
-
}
|
|
15
|
-
}).catch(error => {
|
|
16
|
-
console.log('log error', error);
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=analyticsActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getUrl","authedFunction","analyticsActions","log","site","actionType","entityType","entityId","data","method","url","catch","error","console"],"sources":["analyticsActions.js"],"sourcesContent":["import { getUrl } from '../helper';\nimport { authedFunction } from '../session';\n\nexport const analyticsActions = {\n log: (site, actionType, entityType, entityId, data) => {\n return authedFunction({\n method: 'POST',\n url: getUrl('analytics', 'log'),\n data: {\n site,\n actionType,\n entityType,\n entityId,\n data,\n },\n }).catch(error => {\n console.log('log error', error);\n });\n },\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,WAAW;AAClC,SAASC,cAAc,QAAQ,YAAY;AAE3C,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,GAAG,EAAEA,CAACC,IAAI,EAAEC,UAAU,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,IAAI,KAAK;IACrD,OAAOP,cAAc,CAAC;MACpBQ,MAAM,EAAE,MAAM;MACdC,GAAG,EAAEV,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC;MAC/BQ,IAAI,EAAE;QACJJ,IAAI;QACJC,UAAU;QACVC,UAAU;QACVC,QAAQ;QACRC;MACF;IACF,CAAC,CAAC,CAACG,KAAK,CAACC,KAAK,IAAI;MAChBC,OAAO,CAACV,GAAG,CAAC,WAAW,EAAES,KAAK,CAAC;IACjC,CAAC,CAAC;EACJ;AACF,CAAC"}
|