Skip to content

Commit

Permalink
Merge pull request #11 from eddieferrer/frontend_dependency_updates
Browse files Browse the repository at this point in the history
Updated front end dependencies
  • Loading branch information
eddieferrer authored Jun 29, 2020
2 parents e595938 + 596a7fb commit 31f121d
Show file tree
Hide file tree
Showing 43 changed files with 6,603 additions and 4,512 deletions.
2 changes: 2 additions & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ module.exports = {
],
rules: {
'import/no-unresolved': 0,
'import/extensions': ['error', 'never'],
'no-plusplus': 0,
'no-useless-catch': 0,
'no-underscore-dangle': 0,
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
Expand Down
10,672 changes: 6,382 additions & 4,290 deletions frontend/package-lock.json

Large diffs are not rendered by default.

62 changes: 32 additions & 30 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,49 @@
"dependencies": {
"@sentry/browser": "^5.12.4",
"@sentry/integrations": "^5.12.4",
"axios": "^0.19.0",
"axios": "^0.19.2",
"bulma": "^0.7.5",
"bulma-divider": "^0.2.0",
"bulma-steps-component": "^0.5.3",
"core-js": "^3.4.4",
"lazysizes": "^5.2.0-beta1",
"core-js": "^3.6.5",
"lazysizes": "^5.2.2",
"lodash.debounce": "^4.0.8",
"postscribe": "^2.0.8",
"register-service-worker": "^1.6.2",
"vue": "^2.6.10",
"vue-analytics": "^5.17.0",
"vue-loading-overlay": "^3.2.0",
"vue-meta": "^2.0.5",
"register-service-worker": "^1.7.1",
"vue": "^2.6.11",
"vue-analytics": "^5.22.1",
"vue-loading-overlay": "^3.3.2",
"vue-meta": "^2.4.0",
"vue-multiselect": "^2.1.6",
"vue-router": "^3.0.7",
"vuex": "^3.1.1"
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.2",
"@vue/cli-plugin-e2e-cypress": "^4.1.2",
"@vue/cli-plugin-eslint": "^4.1.2",
"@vue/cli-plugin-pwa": "^4.1.2",
"@vue/cli-plugin-unit-jest": "^4.1.2",
"@vue/cli-service": "^4.1.2",
"@vue/eslint-config-prettier": "^4.0.0",
"@vue/test-utils": "^1.0.0-beta.29",
"@vue/cli-plugin-babel": "^4.4.6",
"@vue/cli-plugin-e2e-cypress": "^4.4.6",
"@vue/cli-plugin-eslint": "^4.4.6",
"@vue/cli-plugin-pwa": "^4.4.6",
"@vue/cli-plugin-unit-jest": "^4.4.6",
"@vue/cli-service": "^4.4.6",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/test-utils": "^1.0.3",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.2",
"babel-jest": "^24.8.0",
"eslint": "^6.0.1",
"eslint-config-airbnb-base": "^13.2.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-vue": "^5.2.3",
"git-revision-webpack-plugin": "^3.0.4",
"husky": "^3.0.0",
"node-sass": "^4.12.0",
"sass-loader": "^7.0.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.1.0",
"eslint": "^7.3.1",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^6.2.2",
"git-revision-webpack-plugin": "^3.0.6",
"husky": "^4.2.5",
"node-sass": "^4.14.1",
"prettier": "^2.0.5",
"sass-loader": "^7.1.0",
"vue-cli-plugin-webpack-bundle-analyzer": "^2.0.0",
"vue-template-compiler": "^2.6.10",
"webpack-bundle-analyzer": "^3.5.2"
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^3.8.0"
},
"husky": {
"hooks": {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ import store from '@/store/store';
import router from '@/router';
router.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.requiresAuth)) {
if (to.matched.some((record) => record.meta.requiresAuth)) {
// this route requires auth, check if logged in
// if not, redirect to login page.
if (!store.getters.isAuthenticated) {
Expand All @@ -159,7 +159,7 @@ router.beforeEach((to, from, next) => {
} else {
next();
}
} else if (to.matched.some(record => record.meta.requiresAdmin)) {
} else if (to.matched.some((record) => record.meta.requiresAdmin)) {
store.dispatch('GET_USER').then(() => {
if (!store.getters.isAdmin) {
next({
Expand Down
38 changes: 19 additions & 19 deletions frontend/src/components/BrandItems.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
</template>

<script>
import ComponentLoader from '@/components/ComponentLoader';
import BrandItemListFilters from './BrandItemListFilters';
import ItemListSearchSort from './ItemListSearchSort';
import FindMySizeBlock from './FindMySizeBlock';
import ComponentLoader from '@/components/ComponentLoader';
export default {
name: 'BrandItems',
Expand Down Expand Up @@ -131,7 +131,7 @@ export default {
// model or brand in filter
if (this.filter !== '') {
itemsFiltered = itemsFiltered.filter(
item =>
(item) =>
item.model.toLowerCase().includes(this.filter.toLowerCase()) ||
item.brand.name.toLowerCase().includes(this.filter.toLowerCase())
);
Expand All @@ -140,33 +140,33 @@ export default {
// shoe_type filter
if (this.shoe_type.length > 0) {
itemsFiltered = itemsFiltered.filter(
item => this.shoe_type.indexOf(item.type.toLowerCase()) > -1
(item) => this.shoe_type.indexOf(item.type.toLowerCase()) > -1
);
}
// rating filter
if (this.min_rating && !Number.isNaN(this.min_rating)) {
itemsFiltered = itemsFiltered.filter(item => item.stats.avg_rating >= this.min_rating);
itemsFiltered = itemsFiltered.filter((item) => item.stats.avg_rating >= this.min_rating);
}
if (this.max_rating && !Number.isNaN(this.max_rating)) {
itemsFiltered = itemsFiltered.filter(item => item.stats.avg_rating <= this.max_rating);
itemsFiltered = itemsFiltered.filter((item) => item.stats.avg_rating <= this.max_rating);
this.resetPages();
}
// foot shape rating filter
if (this.foot_shape.min && !Number.isNaN(this.foot_shape.min)) {
itemsFiltered = itemsFiltered.filter(item => {
itemsFiltered = itemsFiltered.filter((item) => {
const found = item.stats.ratings.find(
rating => rating.foot_shape_descriptor_id === this.foot_shape.shape
(rating) => rating.foot_shape_descriptor_id === this.foot_shape.shape
);
return found.avg_rating >= this.foot_shape.min;
});
}
if (this.foot_shape.max && !Number.isNaN(this.foot_shape.max)) {
itemsFiltered = itemsFiltered.filter(item => {
itemsFiltered = itemsFiltered.filter((item) => {
const found = item.stats.ratings.find(
rating => rating.foot_shape_descriptor_id === this.foot_shape.shape
(rating) => rating.foot_shape_descriptor_id === this.foot_shape.shape
);
return found.avg_rating <= this.foot_shape.max;
});
Expand All @@ -176,35 +176,35 @@ export default {
// gender filter
if (this.gender.length > 0) {
itemsFiltered = itemsFiltered.filter(
item => this.gender.indexOf(item.gender.name.toLowerCase()) > -1
(item) => this.gender.indexOf(item.gender.name.toLowerCase()) > -1
);
}
// mostCommonFit filter
if (this.mostCommonFit.length > 0) {
itemsFiltered = itemsFiltered.filter(
item => this.mostCommonFit.indexOf(item.stats.popular_fit_descriptor.toLowerCase()) > -1
(item) => this.mostCommonFit.indexOf(item.stats.popular_fit_descriptor.toLowerCase()) > -1
);
}
// recommendedFootShape filter
if (this.recommendedFootShape.length > 0) {
itemsFiltered = itemsFiltered.filter(item => {
itemsFiltered = itemsFiltered.filter((item) => {
// this.recommendedFootShape.indexOf(item.stats.highest_rated_foot_shape.toLowerCase().trim()) > -1
const footshapearr = item.stats.highest_rated_foot_shape
.toLowerCase()
.replace(/\s/g, '')
.trim()
.split('&');
const found = this.recommendedFootShape.some(r => footshapearr.indexOf(r) >= 0);
const found = this.recommendedFootShape.some((r) => footshapearr.indexOf(r) >= 0);
return found;
});
}
// brand filter
if (this.brand.length > 0) {
itemsFiltered = itemsFiltered.filter(
item => this.brand.indexOf(item.brand.name.toLowerCase()) > -1
(item) => this.brand.indexOf(item.brand.name.toLowerCase()) > -1
);
}
Expand Down Expand Up @@ -262,7 +262,7 @@ export default {
.dispatch('GET_LIST_ITEMS', {
target: this.target,
})
.then(response => {
.then((response) => {
this.items = response.data.items;
})
.catch(() => {
Expand All @@ -272,16 +272,16 @@ export default {
this.isLoadingComponent = false;
});
this.$on('sortOrder', value => {
this.$on('sortOrder', (value) => {
this.sort_order = value;
});
this.$on('filterItems', value => {
this.$on('filterItems', (value) => {
this.filter = value;
});
this.$on('sortItems', value => {
this.$on('sortItems', (value) => {
this.sort = value;
});
this.$on('allFilterValues', filterValues => {
this.$on('allFilterValues', (filterValues) => {
this.gender = filterValues.gender;
this.max_rating = filterValues.max_rating;
this.min_rating = filterValues.min_rating;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/ChangePasswordForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default {
confirmPassword: vm.confirmPassword,
token: vm.getParameterByName('token'),
})
.then(response => {
.then((response) => {
if (response.data.status === 'success') {
vm.status = 'success';
vm.message = response.data.message;
Expand All @@ -122,7 +122,7 @@ export default {
vm.password_change_error.confirmPassword = response.data.message.confirmPassword;
}
})
.catch(error => {
.catch((error) => {
// eslint-disable-next-line no-console
console.log(error);
})
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/ChangePasswordModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default {
newPassword: changePasswordModalComponent.new_password,
newPasswordConfirm: changePasswordModalComponent.new_password_confirm,
})
.then(response => {
.then((response) => {
if (response.data.status === 'success') {
changePasswordModalComponent.$emit('close');
changePasswordModalComponent.$store.dispatch('SHOW_FLASH_MESSAGE', {
Expand All @@ -152,7 +152,7 @@ export default {
changePasswordModalComponent.formErrors = true;
}
})
.catch(error => {
.catch((error) => {
// eslint-disable-next-line no-console
console.log(error);
})
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/ConfirmDeleteModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
const confirmDeleteModalComponent = this;
this.$store
.dispatch('REMOVE_PROFILE_ITEM', itemid)
.then(response => {
.then((response) => {
if (response.data.status === 'success') {
confirmDeleteModalComponent.$store.dispatch('SHOW_FLASH_MESSAGE', {
class: 'has-background-success',
Expand All @@ -70,7 +70,7 @@ export default {
confirmDeleteModalComponent.$emit('close');
}
})
.catch(error => {
.catch((error) => {
// eslint-disable-next-line no-console
console.log(error);
})
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/DeleteAccountModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
const deleteAccountModalComponent = this;
this.$store
.dispatch('DELETE_ACCOUNT', deleteAccountModalComponent.userId)
.then(response => {
.then((response) => {
if (response.data.status === 'success') {
deleteAccountModalComponent.$emit('close');
const endUrl = response.data.new_url;
Expand All @@ -69,7 +69,7 @@ export default {
});
}
})
.catch(error => {
.catch((error) => {
// eslint-disable-next-line no-console
console.log(error);
})
Expand Down
20 changes: 11 additions & 9 deletions frontend/src/components/EditItemModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@
</template>

<script>
import SizeOptions from '@/mixins/SizeOptions';
import RatingOptions from '@/mixins/RatingOptions';
import FitOptions from '@/mixins/FitOptions';
import MultiSelectSize from './MultiSelectSize';
import MultiSelectRating from './MultiSelectRating';
import MultiSelectFit from './MultiSelectFit';
import Modal from './Modal';
import SizeOptions from '@/mixins/SizeOptions';
import RatingOptions from '@/mixins/RatingOptions';
import FitOptions from '@/mixins/FitOptions';
export default {
name: 'EditItemModal',
Expand Down Expand Up @@ -110,7 +110,9 @@ export default {
const reducedArray = this.size_option_groups[0].sizes.concat(
this.size_option_groups[1].sizes
);
return reducedArray.filter(sizeArray => sizeArray.value === this.item.size.toString())[0];
return reducedArray.filter(
(sizeArray) => sizeArray.value === this.item.size.toString()
)[0];
}
return {};
},
Expand All @@ -122,7 +124,7 @@ export default {
get() {
if (this.item.rating) {
return this.rating_options.filter(
ratingArray => ratingArray.id === this.item.rating.toString()
(ratingArray) => ratingArray.id === this.item.rating.toString()
)[0];
}
return {};
Expand All @@ -134,7 +136,7 @@ export default {
currentFit: {
get() {
if (this.item.fit) {
return this.fit_options.filter(fitArray => fitArray.id === this.item.fit.toString())[0];
return this.fit_options.filter((fitArray) => fitArray.id === this.item.fit.toString())[0];
}
return {};
},
Expand All @@ -146,7 +148,7 @@ export default {
watch: {
item(newVal) {
// store value for reset
this.originalItemValue = Object.assign({}, newVal);
this.originalItemValue = { ...newVal };
},
},
methods: {
Expand Down Expand Up @@ -174,14 +176,14 @@ export default {
fit: this.item.fit,
comments: this.item.comments,
})
.then(response => {
.then((response) => {
if (response.data.status === 'success') {
// update properties of item
editItemModalComponent.item.fit_descriptor = response.data.user_item.fit_descriptor;
editItemModalComponent.close();
}
})
.catch(error => {
.catch((error) => {
// eslint-disable-next-line no-console
console.log(error);
})
Expand Down
Loading

0 comments on commit 31f121d

Please sign in to comment.