Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions client/src/components/Card/UserProfileCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
<div class="profile-card rounded-sm shadow-sm">
<!--User Info-->
<div class="profile-card-top">
<!--Avatar Placeholder Image-->
<SkelentonBox
:width="'120px'"
:height="'120px'"
class="rounded-circle skelenton-box"
/>
<!--Avatar-->
<img
:src="currentUser.avatar | placeholderAvatar"
alt="user avatar"
Expand Down Expand Up @@ -42,6 +49,7 @@
</template>

<script>
import SkelentonBox from '../Placeholder/SkeletonBox'
import { placeholderAvatarFilter } from '../../utils/mixins'
import { mapState } from 'vuex'

Expand All @@ -52,6 +60,9 @@ export default {
return '未訂閱'
}
},
components: {
SkelentonBox
},
mixins: [placeholderAvatarFilter],
computed: {
...mapState(['currentUser'])
Expand All @@ -75,6 +86,7 @@ export default {
}

img {
position: relative;
width: 120px;
height: 120px;
object-fit: cover;
Expand Down Expand Up @@ -109,4 +121,5 @@ export default {
width: 25px;
}

.skelenton-box { position: absolute; }
</style>
30 changes: 20 additions & 10 deletions client/src/components/OrderCommentForm.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<section class="form">
<form
ref="form"
novalidate
class="form-wrapper rounded-sm shadow-sm p-3"
@submit.stop.prevent="handleSubmit"
>
<h2 class="form-title mb-4">
您的評論
Expand Down Expand Up @@ -61,7 +61,7 @@
<div
v-if="comment.image"
class="file-image-wrapper"
@click="user.image = ''"
@click="comment.image = ''"
>
<img
:src="comment.image"
Expand All @@ -72,22 +72,30 @@
</div>
<!--Visible file upload button-->
<label
v-if="!comment.image || isProcessing"
v-else
for="file"
class="file-label"
>
<i class="fas fa-plus" />
</label>
</div>
<hr class="form-divider mt-4">
<!--Submit Button-->
<div class="btn-container text-center">
<button
<ProcessButton
class="btn"
type="submit"
:disabled="isProcessing || $v.$invalid"
:is-processing="isProcessing"
:v="{}"
:color="'primary'"
:border-radius="'.3rem'"
@after-click="handleSubmit"
>
送出評價
</button>
<template #initial>
<slot name="submit">
送出評價
</slot>
</template>
</ProcessButton>
</div>
</form>
</section>
Expand All @@ -96,13 +104,15 @@
<script>
import { handleFileChangeMethod } from '../utils/mixins'
import CustomRatingInput from '../components/CustomRatingInput'
import ProcessButton from '../components/Button/ProcessButton'
import { required, minLength, maxLength } from 'vuelidate/lib/validators'
import orderApi from '../apis/order'
import { Toast } from '../utils/helpers'

export default {
components: {
CustomRatingInput
CustomRatingInput,
ProcessButton
},
mixins: [handleFileChangeMethod],
data () {
Expand Down Expand Up @@ -131,7 +141,7 @@ export default {
async handleSubmit (e) {
try {
// prepare a FormData
const form = e.target
const form = this.$refs.form
const formData = new FormData(form)
const orderId = this.$route.params.order_id
// update processing status
Expand Down
4 changes: 2 additions & 2 deletions server/config/query/heroku.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = {
char: {
date: [sequelize.fn('to_char', sequelize.col('require_date'), 'YYMMDD'), 'date'],
time: [sequelize.fn('to_char', sequelize.col('require_date'), 'HH24:MI'), 'time'],
date_for_dashboard: [sequelize.fn('to_char', sequelize.col('require_date'), '%m/%d'), 'date'],
date_for_admin_dashboard: [sequelize.fn('to_char', sequelize.col('createdAt'), '%m/%d'), 'date']
date_for_dashboard: [sequelize.fn('to_char', sequelize.col('require_date'), 'MM/DD'), 'date'],
date_for_admin_dashboard: [sequelize.fn('to_char', sequelize.col('createdAt'), 'MM/DD'), 'date']
},
geo: {
geometry: 'ST_DistanceSphere',
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/adminController.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let adminController = {
let pageNum = (Number(page) < 1 || page === undefined) ? 1 : Number(page)
let restaurants = await Restaurant.findAndCountAll({
where: {
name: { [Op.substring]: name || '' },
name: process.env.heroku ? { [Op.iLike]: `%${name}%` || '' } : { [Op.substring]: name || '' },
CategoryId: category ? { [Op.eq]: category } : { [Op.gt]: 0 },
location: { [Op.substring]: dist || '' }
},
Expand Down