Skip to content

Commit 86070b2

Browse files
authored
Merge pull request #467 from Seluj78/466-final-checklist
466 final checklist
2 parents 9175d01 + bb8e622 commit 86070b2

26 files changed

+970
-89
lines changed

docker-compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@ services:
8282
build:
8383
context: .
8484
dockerfile: frontend.Dockerfile
85-
volumes:
86-
- './frontend:/frontend'
8785
ports:
88-
- '4242:8080'
86+
- '4242:5000'
8987
networks:
9088
- backend-net
9189

frontend.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ ENV PATH /frontend/node_modules/.bin:$PATH
66

77
COPY frontend/package.json /frontend/package.json
88
COPY frontend/yarn.lock /frontend/yarn.lock
9+
COPY ./frontend .
910

1011
RUN yarn install
1112

12-
CMD ["yarn", "serve"]
13+
RUN yarn build
14+
15+
CMD ["serve", "-s", "dist"]

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"jwt-decode": "^3.0.0",
1717
"nouislider": "^14.6.2",
1818
"secure-ls": "^1.2.6",
19+
"serve": "^11.3.2",
1920
"tailwindcss": "^1.8.10",
2021
"vee-validate": "^3.4.1",
2122
"vue": "^2.6.11",

frontend/src/App.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ body,
3737
height: 100%;
3838
}
3939
40+
body {
41+
margin: 0;
42+
}
43+
4044
::placeholder {
4145
@apply font-normal;
4246
}

frontend/src/components/app/matches/Chat.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ export default {
101101
const response = await this.$http.post('/messages/send', {
102102
to_uid: this.user.id.toString(),
103103
content: this.message,
104-
});
104+
}, { accessTokenRequired: true });
105105
this.messages.push(response.data.new_message);
106106
this.message = '';
107107
this.$emit('new-message');
108108
this.scrollChatToBottom();
109109
},
110110
async fetchNewMessages() {
111-
await this.$http.post(`/messages/see/${this.chatWithUserId}`);
112-
const messagesRequest = await this.$http.get(`/conversations/${this.chatWithUserId}`);
111+
await this.$http.post(`/messages/see/${this.chatWithUserId}`, null, { accessTokenRequired: true });
112+
const messagesRequest = await this.$http.get(`/conversations/${this.chatWithUserId}`, { accessTokenRequired: true });
113113
const newMessages = messagesRequest.data.messages;
114114
const oldMessageCount = this.messages.length;
115115
this.messages = newMessages;
@@ -121,11 +121,11 @@ export default {
121121
}
122122
},
123123
async prepareChatForNewUser() {
124-
await this.$http.post(`/messages/see/${this.chatWithUserId}`);
125-
const messagesRequest = await this.$http.get(`/conversations/${this.chatWithUserId}`);
124+
await this.$http.post(`/messages/see/${this.chatWithUserId}`, null, { accessTokenRequired: true });
125+
const messagesRequest = await this.$http.get(`/conversations/${this.chatWithUserId}`, { accessTokenRequired: true });
126126
this.messages = messagesRequest.data.messages;
127127
this.determineFirstMessagesOfTimespans(this.messages);
128-
const userRequest = await this.$http.get(`/users/${this.chatWithUserId}`);
128+
const userRequest = await this.$http.get(`/users/${this.chatWithUserId}`, { accessTokenRequired: true });
129129
this.user = userRequest.data;
130130
this.scrollChatToBottom();
131131
},

frontend/src/components/app/matches/MessageBubble.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ export default {
5656
}
5757
if (!isLiked) {
5858
this.message.is_liked = true;
59-
await this.$http.post(`/messages/like/${id}`);
59+
await this.$http.post(`/messages/like/${id}`, null, { accessTokenRequired: true });
6060
} else {
6161
this.message.is_liked = false;
62-
await this.$http.post(`/messages/unlike/${id}`);
62+
await this.$http.post(`/messages/unlike/${id}`, null, { accessTokenRequired: true });
6363
}
6464
},
6565
},

frontend/src/components/app/onboarding/Location.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default {
5151
this.$emit('next-slide');
5252
},
5353
async sendLocation() {
54-
await this.$http.put('/profile/edit/geolocation', this.locationData);
54+
await this.$http.put('/profile/edit/geolocation', this.locationData, { accessTokenRequired: true });
5555
},
5656
},
5757
mounted() {

frontend/src/components/app/onboarding/MainAndSecondaryImagesUpload.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ export default {
5252
const formData = new FormData();
5353
formData.append('file[]', this.imagesUploaded[i].content);
5454
if (i === 0) {
55-
await this.$http.post('/profile/images?is_primary=true', formData);
55+
await this.$http.post('/profile/images?is_primary=true', formData, { accessTokenRequired: true });
5656
} else {
57-
await this.$http.post('/profile/images?is_primary=false', formData);
57+
await this.$http.post('/profile/images?is_primary=false', formData, { accessTokenRequired: true });
5858
}
5959
} catch (error) {}
6060
}

frontend/src/components/app/settings/AccountInput.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,25 +85,25 @@ export default {
8585
this.currentValueBackup = this.currentValue;
8686
try {
8787
if (this.type === 'firstName') {
88-
await this.$http.patch('/profile/edit/first_name', { first_name: this.currentValue });
88+
await this.$http.patch('/profile/edit/first_name', { first_name: this.currentValue }, { accessTokenRequired: true });
8989
} else if (this.type === 'lastName') {
90-
await this.$http.patch('/profile/edit/last_name', { last_name: this.currentValue });
90+
await this.$http.patch('/profile/edit/last_name', { last_name: this.currentValue }, { accessTokenRequired: true });
9191
} else if (this.type === 'email') {
92-
await this.$http.put('/profile/edit/email', { email: this.currentValue });
92+
await this.$http.put('/profile/edit/email', { email: this.currentValue }, { accessTokenRequired: true });
9393
} else if (this.type === 'username') {
94-
await this.$http.patch('/profile/edit/username', { username: this.currentValue });
94+
await this.$http.patch('/profile/edit/username', { username: this.currentValue }, { accessTokenRequired: true });
9595
} else if (this.type === 'bio') {
96-
await this.$http.patch('/profile/edit/bio', { bio: this.currentValue });
96+
await this.$http.patch('/profile/edit/bio', { bio: this.currentValue }, { accessTokenRequired: true });
9797
} else if (this.type === 'password') {
9898
await this.$http.put('/profile/edit/password', {
9999
old_password: this.passwordOld,
100100
new_password: this.currentValue,
101-
});
101+
}, { accessTokenRequired: true });
102102
this.currentValue = '';
103103
this.passwordRepeat = '';
104104
this.passwordOld = '';
105105
}
106-
const user = await this.$http.get(`/users/${this.$store.getters.getLoggedInUser.id}`);
106+
const user = await this.$http.get(`/users/${this.$store.getters.getLoggedInUser.id}`, { accessTokenRequired: true });
107107
await this.$store.dispatch('login', user.data);
108108
} catch (error) {
109109
this.error = error.response.data.error.message;

frontend/src/components/app/users/User.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,28 @@ export default {
3535
goBack() {
3636
this.$router.go(-1);
3737
},
38+
sortImages() {
39+
const userImagesLength = this.user.images.length;
40+
for (let i = 0; i < userImagesLength; i += 1) {
41+
if (this.user.images[i].is_primary && i !== 0) {
42+
this.user.images.splice(0, 0, this.user.images[i]);
43+
this.user.images.splice(i + 1, 1);
44+
return;
45+
}
46+
}
47+
},
3848
},
3949
watch: {
4050
async $route() {
41-
const userRequest = await this.$http.get(`/profile/view/${this.$route.params.id}`);
51+
const userRequest = await this.$http.get(`/profile/view/${this.$route.params.id}`, { accessTokenRequired: true });
4252
this.user = userRequest.data.profile;
4353
},
4454
},
4555
async beforeMount() {
4656
try {
47-
const userRequest = await this.$http.get(`/profile/view/${this.$route.params.id}`);
57+
const userRequest = await this.$http.get(`/profile/view/${this.$route.params.id}`, { accessTokenRequired: true });
4858
this.user = userRequest.data.profile;
59+
this.sortImages();
4960
} catch (error) {
5061
this.error = error.response.data.error.message;
5162
}

0 commit comments

Comments
 (0)