summaryrefslogtreecommitdiff
path: root/src/components/Global
diff options
context:
space:
mode:
authorDerick Montague <derick.montague@ibm.com>2020-10-22 00:20:00 +0300
committerDerick Montague <derick.montague@ibm.com>2020-11-03 19:47:51 +0300
commit602e98aa32f82fd3b0c3d250c7cc1f8da971db24 (patch)
tree2894194868ff987718a8b19f112b8106d662aa83 /src/components/Global
parent47165201c79b3d2c4ccc62a49a9c75d038ee8fe6 (diff)
downloadwebui-vue-602e98aa32f82fd3b0c3d250c7cc1f8da971db24.tar.xz
Update linting packages to use latest
- 99% of changes were small syntax changes that were changed by the lint command. There were a couple of small manual changes to meet the property order patterns established as part of the vue:recommended guidelines. There are rules that were set from errors to warnings and new stories are being opened to address those issues. Testing: - Successfully ran npm run serve - Successfully ran npm run lint - Verified functionality works as expected, e.g. success and failure use cases - Resolved any JavaScript errors thrown to the console Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Ie082f31c73ccbe8a60afa8f88a9ef6dbf33d9fd2
Diffstat (limited to 'src/components/Global')
-rw-r--r--src/components/Global/Alert.vue16
-rw-r--r--src/components/Global/InfoTooltip.vue6
-rw-r--r--src/components/Global/InputPasswordToggle.vue6
-rw-r--r--src/components/Global/LoadingBar.vue6
-rw-r--r--src/components/Global/PageContainer.vue2
-rw-r--r--src/components/Global/PageSection.vue6
-rw-r--r--src/components/Global/PageTitle.vue8
-rw-r--r--src/components/Global/Search.vue12
-rw-r--r--src/components/Global/StatusIcon.vue8
-rw-r--r--src/components/Global/TableCellCount.vue12
-rw-r--r--src/components/Global/TableDateFilter.vue28
-rw-r--r--src/components/Global/TableFilter.vue42
-rw-r--r--src/components/Global/TableRowAction.vue16
-rw-r--r--src/components/Global/TableToolbar.vue18
-rw-r--r--src/components/Global/TableToolbarExport.vue10
15 files changed, 95 insertions, 101 deletions
diff --git a/src/components/Global/Alert.vue b/src/components/Global/Alert.vue
index 88a4ae3d..e8de9e27 100644
--- a/src/components/Global/Alert.vue
+++ b/src/components/Global/Alert.vue
@@ -3,9 +3,9 @@
<div
v-if="
variant == 'info' ||
- variant == 'success' ||
- variant == 'warning' ||
- variant == 'danger'
+ variant == 'success' ||
+ variant == 'warning' ||
+ variant == 'danger'
"
class="alert-icon"
>
@@ -30,18 +30,18 @@ export default {
name: 'Alert',
components: {
BAlert: BAlert,
- StatusIcon: StatusIcon
+ StatusIcon: StatusIcon,
},
props: {
show: {
type: Boolean,
- default: true
+ default: true,
},
variant: {
type: String,
- default: ''
+ default: '',
},
- small: Boolean
- }
+ small: Boolean,
+ },
};
</script>
diff --git a/src/components/Global/InfoTooltip.vue b/src/components/Global/InfoTooltip.vue
index 15141660..f3cb7f12 100644
--- a/src/components/Global/InfoTooltip.vue
+++ b/src/components/Global/InfoTooltip.vue
@@ -13,9 +13,9 @@ export default {
props: {
title: {
type: String,
- default: ''
- }
- }
+ default: '',
+ },
+ },
};
</script>
diff --git a/src/components/Global/InputPasswordToggle.vue b/src/components/Global/InputPasswordToggle.vue
index 228746cf..bf3e4ca5 100644
--- a/src/components/Global/InputPasswordToggle.vue
+++ b/src/components/Global/InputPasswordToggle.vue
@@ -31,7 +31,7 @@ export default {
components: { IconView, IconViewOff },
data() {
return {
- isVisible: false
+ isVisible: false,
};
},
methods: {
@@ -44,8 +44,8 @@ export default {
if (inputEl.nodeName === 'INPUT') {
inputEl.type = this.isVisible ? 'text' : 'password';
}
- }
- }
+ },
+ },
};
</script>
diff --git a/src/components/Global/LoadingBar.vue b/src/components/Global/LoadingBar.vue
index 3f503c8b..d62ef1e2 100644
--- a/src/components/Global/LoadingBar.vue
+++ b/src/components/Global/LoadingBar.vue
@@ -18,7 +18,7 @@ export default {
loadingIndicatorValue: 0,
isLoadingComplete: false,
loadingIntervalId: null,
- timeoutId: null
+ timeoutId: null,
};
},
created() {
@@ -66,8 +66,8 @@ export default {
clearTimeout() {
if (this.timeoutId) clearTimeout(this.timeoutId);
this.timeoutId = null;
- }
- }
+ },
+ },
};
</script>
diff --git a/src/components/Global/PageContainer.vue b/src/components/Global/PageContainer.vue
index 8396bd5b..e766d38d 100644
--- a/src/components/Global/PageContainer.vue
+++ b/src/components/Global/PageContainer.vue
@@ -6,7 +6,7 @@
<script>
export default {
- name: 'PageContainer'
+ name: 'PageContainer',
};
</script>
diff --git a/src/components/Global/PageSection.vue b/src/components/Global/PageSection.vue
index 303b6e1e..dd39ddd5 100644
--- a/src/components/Global/PageSection.vue
+++ b/src/components/Global/PageSection.vue
@@ -11,9 +11,9 @@ export default {
props: {
sectionTitle: {
type: String,
- default: ''
- }
- }
+ default: '',
+ },
+ },
};
</script>
diff --git a/src/components/Global/PageTitle.vue b/src/components/Global/PageTitle.vue
index e3dc8d0c..45c75edb 100644
--- a/src/components/Global/PageTitle.vue
+++ b/src/components/Global/PageTitle.vue
@@ -11,14 +11,14 @@ export default {
props: {
description: {
type: String,
- default: ''
- }
+ default: '',
+ },
},
data() {
return {
- title: this.$route.meta.title
+ title: this.$route.meta.title,
};
- }
+ },
};
</script>
diff --git a/src/components/Global/Search.vue b/src/components/Global/Search.vue
index eeb909a8..778965e1 100644
--- a/src/components/Global/Search.vue
+++ b/src/components/Global/Search.vue
@@ -43,14 +43,14 @@ export default {
props: {
placeholder: {
type: String,
- default: function() {
+ default: function () {
return this.$t('global.form.search');
- }
- }
+ },
+ },
},
data() {
return {
- filter: null
+ filter: null,
};
},
methods: {
@@ -61,8 +61,8 @@ export default {
this.filter = '';
this.$emit('clearSearch');
this.$refs.searchInput.focus();
- }
- }
+ },
+ },
};
</script>
diff --git a/src/components/Global/StatusIcon.vue b/src/components/Global/StatusIcon.vue
index 4b2b47dd..4552633e 100644
--- a/src/components/Global/StatusIcon.vue
+++ b/src/components/Global/StatusIcon.vue
@@ -22,14 +22,14 @@ export default {
iconSuccess: IconCheckmark,
iconDanger: IconMisuse,
iconSecondary: IconError,
- iconWarning: IconWarning
+ iconWarning: IconWarning,
},
props: {
status: {
type: String,
- default: ''
- }
- }
+ default: '',
+ },
+ },
};
</script>
diff --git a/src/components/Global/TableCellCount.vue b/src/components/Global/TableCellCount.vue
index 4f44ec29..75617093 100644
--- a/src/components/Global/TableCellCount.vue
+++ b/src/components/Global/TableCellCount.vue
@@ -7,7 +7,7 @@
{{
$t('global.table.selectedItems', {
count: totalNumberOfCells,
- filterCount: filteredItemsCount
+ filterCount: filteredItemsCount,
})
}}
</p>
@@ -19,17 +19,17 @@ export default {
props: {
filteredItemsCount: {
type: Number,
- required: true
+ required: true,
},
totalNumberOfCells: {
type: Number,
- required: true
- }
+ required: true,
+ },
},
computed: {
filterActive() {
return this.filteredItemsCount !== this.totalNumberOfCells;
- }
- }
+ },
+ },
};
</script>
diff --git a/src/components/Global/TableDateFilter.vue b/src/components/Global/TableDateFilter.vue
index c0008dea..73b2b832 100644
--- a/src/components/Global/TableDateFilter.vue
+++ b/src/components/Global/TableDateFilter.vue
@@ -23,7 +23,7 @@
{{ $t('global.form.dateMustBeBefore', { date: toDate }) }}
</template>
</b-form-invalid-feedback>
- <template slot:append>
+ <template #append>
<b-form-datepicker
v-model="fromDate"
class="input-action"
@@ -38,7 +38,7 @@
button-variant="link"
aria-controls="input-from-date"
>
- <template v-slot:button-content>
+ <template #button-content>
<icon-calendar
:title="$t('global.calendar.openDatePicker')"
aria-hidden="true"
@@ -73,7 +73,7 @@
{{ $t('global.form.dateMustBeAfter', { date: fromDate }) }}
</template>
</b-form-invalid-feedback>
- <template slot:append>
+ <template #append>
<b-form-datepicker
v-model="toDate"
class="input-action"
@@ -88,7 +88,7 @@
button-variant="link"
aria-controls="input-to-date"
>
- <template v-slot:button-content>
+ <template #button-content>
<icon-calendar
:title="$t('global.calendar.openDatePicker')"
aria-hidden="true"
@@ -121,31 +121,31 @@ export default {
fromDate: '',
toDate: '',
offsetToDate: '',
- locale: this.$store.getters['global/languagePreference']
+ locale: this.$store.getters['global/languagePreference'],
};
},
validations() {
return {
fromDate: {
pattern: helpers.regex('pattern', isoDateRegex),
- maxDate: value => {
+ maxDate: (value) => {
if (!this.toDate) return true;
const date = new Date(value);
const maxDate = new Date(this.toDate);
if (date.getTime() > maxDate.getTime()) return false;
return true;
- }
+ },
},
toDate: {
pattern: helpers.regex('pattern', isoDateRegex),
- minDate: value => {
+ minDate: (value) => {
if (!this.fromDate) return true;
const date = new Date(value);
const minDate = new Date(this.fromDate);
if (date.getTime() < minDate.getTime()) return false;
return true;
- }
- }
+ },
+ },
};
},
watch: {
@@ -157,7 +157,7 @@ export default {
// entries from selected end date are included in filter
this.offsetToDate = new Date(newVal).setUTCHours(23, 59, 59, 999);
this.emitChange();
- }
+ },
},
methods: {
emitChange() {
@@ -165,9 +165,9 @@ export default {
this.$v.$reset(); //reset to re-validate on blur
this.$emit('change', {
fromDate: this.fromDate ? new Date(this.fromDate) : null,
- toDate: this.toDate ? new Date(this.offsetToDate) : null
+ toDate: this.toDate ? new Date(this.offsetToDate) : null,
});
- }
- }
+ },
+ },
};
</script>
diff --git a/src/components/Global/TableFilter.vue b/src/components/Global/TableFilter.vue
index d6a954be..c9fb1068 100644
--- a/src/components/Global/TableFilter.vue
+++ b/src/components/Global/TableFilter.vue
@@ -18,7 +18,7 @@
@hide="dropdownVisible = false"
@show="dropdownVisible = true"
>
- <template v-slot:button-content>
+ <template #button-content>
<icon-filter />
{{ $t('global.action.filter') }}
</template>
@@ -62,12 +62,12 @@ export default {
filters: {
type: Array,
default: () => [],
- validator: prop => {
+ validator: (prop) => {
return prop.every(
- filter => 'label' in filter && 'values' in filter && 'key' in filter
+ (filter) => 'label' in filter && 'values' in filter && 'key' in filter
);
- }
- }
+ },
+ },
},
data() {
return {
@@ -75,9 +75,9 @@ export default {
activeFilters: this.filters.map(({ key }) => {
return {
key,
- values: []
+ values: [],
};
- })
+ }),
};
},
computed: {
@@ -89,44 +89,38 @@ export default {
},
set(value) {
return value;
- }
- }
+ },
+ },
},
methods: {
removeTag(tag) {
- this.activeFilters.forEach(filter => {
- filter.values = filter.values.filter(val => val !== tag);
+ this.activeFilters.forEach((filter) => {
+ filter.values = filter.values.filter((val) => val !== tag);
});
this.emitChange();
},
clearAllTags() {
- this.activeFilters.forEach(filter => {
+ this.activeFilters.forEach((filter) => {
filter.values = [];
});
this.emitChange();
},
emitChange() {
this.$emit('filterChange', {
- activeFilters: this.activeFilters
+ activeFilters: this.activeFilters,
});
},
- onChange(
- checked,
- {
- filter: { key },
- value
- }
- ) {
- this.activeFilters.forEach(filter => {
+ onChange(checked, { filter: { key }, value }) {
+ this.activeFilters.forEach((filter) => {
if (filter.key === key) {
checked
? filter.values.push(value)
- : (filter.values = filter.values.filter(val => val !== value));
+ : (filter.values = filter.values.filter((val) => val !== value));
}
});
this.emitChange();
- }
- }
+ },
+ },
};
</script>
diff --git a/src/components/Global/TableRowAction.vue b/src/components/Global/TableRowAction.vue
index f86bce22..7e4af499 100644
--- a/src/components/Global/TableRowAction.vue
+++ b/src/components/Global/TableRowAction.vue
@@ -36,24 +36,24 @@ export default {
props: {
value: {
type: String,
- required: true
+ required: true,
},
enabled: {
type: Boolean,
- default: true
+ default: true,
},
title: {
type: String,
- default: null
+ default: null,
},
rowData: {
type: Object,
- default: () => {}
+ default: () => {},
},
exportName: {
type: String,
- default: 'export'
- }
+ default: 'export',
+ },
},
computed: {
dataForExport() {
@@ -64,7 +64,7 @@ export default {
},
href() {
return `data:text/json;charset=utf-8,${this.dataForExport}`;
- }
- }
+ },
+ },
};
</script>
diff --git a/src/components/Global/TableToolbar.vue b/src/components/Global/TableToolbar.vue
index 97d8f641..6a856b44 100644
--- a/src/components/Global/TableToolbar.vue
+++ b/src/components/Global/TableToolbar.vue
@@ -36,34 +36,34 @@ export default {
props: {
selectedItemsCount: {
type: Number,
- required: true
+ required: true,
},
actions: {
type: Array,
default: () => [],
- validator: prop => {
- return prop.every(action => {
+ validator: (prop) => {
+ return prop.every((action) => {
return (
action.hasOwnProperty('value') && action.hasOwnProperty('label')
);
});
- }
- }
+ },
+ },
},
data() {
return {
- isToolbarActive: false
+ isToolbarActive: false,
};
},
watch: {
- selectedItemsCount: function(selectedItemsCount) {
+ selectedItemsCount: function (selectedItemsCount) {
if (selectedItemsCount > 0) {
this.isToolbarActive = true;
} else {
this.isToolbarActive = false;
}
- }
- }
+ },
+ },
};
</script>
diff --git a/src/components/Global/TableToolbarExport.vue b/src/components/Global/TableToolbarExport.vue
index 59642f52..69646ea6 100644
--- a/src/components/Global/TableToolbarExport.vue
+++ b/src/components/Global/TableToolbarExport.vue
@@ -14,12 +14,12 @@ export default {
props: {
data: {
type: Array,
- default: () => []
+ default: () => [],
},
fileName: {
type: String,
- default: 'data'
- }
+ default: 'data',
+ },
},
computed: {
dataForExport() {
@@ -30,7 +30,7 @@ export default {
},
href() {
return `data:text/json;charset=utf-8,${this.dataForExport}`;
- }
- }
+ },
+ },
};
</script>