Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
get rid of optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
adr1enbe4udou1n committed Jul 12, 2020
1 parent 02c90c5 commit dd19b67
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ trim_trailing_whitespace = true
indent_style = tab

[*.md]
trim_trailing_whitespace=false
trim_trailing_whitespace = false
7 changes: 4 additions & 3 deletions packages/admin/src/components/ui/inputs/RichTextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<script>
import Input from "../../../mixins/input";
import Editor from "@tinymce/tinymce-vue";
import get from "lodash/get";
/**
* Full Wysiwyg HTML editor by using TinyMCE 5.
Expand Down Expand Up @@ -51,7 +52,7 @@ export default {
type: Array,
default() {
return (
this.$admin.options?.tinyMCE?.plugins || [
get(this.$admin.options, "tinyMCE.plugins") || [
"advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media paste code help wordcount",
Expand All @@ -66,7 +67,7 @@ export default {
type: String,
default() {
return (
this.$admin.options?.tinyMCE?.toolbar ||
get(this.$admin.options, "tinyMCE.toolbar") ||
"undo redo | formatselect | bold italic backcolor | \
alignleft aligncenter alignright alignjustify | \
bullist numlist outdent indent | image media | removeformat | help"
Expand All @@ -83,7 +84,7 @@ export default {
},
computed: {
getInit() {
let options = this.$admin.options?.tinyMCE || {};
let options = get(this.$admin.options, "tinyMCE") || {};
let init = this.init || {
language: options.language,
Expand Down
10 changes: 4 additions & 6 deletions packages/admin/src/components/ui/providers/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ import Resource from "../../../mixins/resource";
import Search from "../../../mixins/search";
import FormFilter from "../../internal/FormFilter";
import isEmpty from "lodash/isEmpty";
import get from "lodash/get";
import { mapState, mapActions } from "vuex";
/**
Expand Down Expand Up @@ -169,7 +170,7 @@ export default {
type: Array,
default() {
return (
this.$admin.options?.list?.itemsPerPageOptions || [
get(this.$admin.options, "list.itemsPerPageOptions") || [
5,
10,
15,
Expand Down Expand Up @@ -207,7 +208,7 @@ export default {
disableExport: {
type: Boolean,
default() {
return this.$admin.options?.list?.disableExport || false;
return get(this.$admin.options, "list.disableExport") || false;
},
},
/**
Expand All @@ -220,10 +221,7 @@ export default {
disableGlobalSearch: {
type: Boolean,
default() {
if (this.$admin.options.list) {
return this.$admin.options.list.disableGlobalSearch || false;
}
return false;
return get(this.$admin.options, "list.disableGlobalSearch") || false;
},
},
/**
Expand Down
5 changes: 3 additions & 2 deletions packages/admin/src/mixins/search.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { mapActions } from "vuex";
import get from "lodash/get";

/**
* Common props for resource search components, as `VaList` or `VaAutocompleteInput`.
Expand Down Expand Up @@ -53,7 +54,7 @@ export default {
itemsPerPage: {
type: Number,
default() {
return this.$admin.options?.list?.itemsPerPage || 15;
return get(this.$admin.options, "list.itemsPerPage") || 15;
},
},
/**
Expand All @@ -63,7 +64,7 @@ export default {
disableItemsPerPage: {
type: Boolean,
default() {
return this.$admin.options?.list?.disableItemsPerPage || false;
return get(this.$admin.options, "list.disableItemsPerPage") || false;
},
},
},
Expand Down

0 comments on commit dd19b67

Please sign in to comment.