Commit 47b370dc authored by David O'Regan's avatar David O'Regan

Refactor: update Vue data arrow syntax to shorthand syntax

Update Vue components to use the shorthand
inline function syntax for the data property
over an inine arrow function syntax style.
parent 18225011
......@@ -54,7 +54,8 @@ export default {
required: false,
},
},
data: () => ({
data() {
return {
currentServerSideSettings: {
host: null,
port: null,
......@@ -62,7 +63,8 @@ export default {
wafLogEnabled: null,
ciliumLogEnabled: null,
},
}),
};
},
computed: {
isSaving() {
return [UPDATING].includes(this.status);
......
......@@ -53,11 +53,13 @@ export default {
}),
},
},
data: () => ({
data() {
return {
modSecurityLogo,
initialValue: null,
initialMode: null,
}),
};
},
computed: {
modSecurityEnabled: {
get() {
......
......@@ -24,9 +24,11 @@ export default {
GlTable,
GlAlert,
},
data: () => ({
data() {
return {
errorMessage: '',
}),
};
},
methods: {
getFeatureDocumentationLinkLabel(item) {
return sprintf(s__('SecurityConfiguration|Feature documentation for %{featureName}'), {
......
......@@ -14,9 +14,11 @@ export default {
default: '',
},
},
data: () => ({
data() {
return {
isLoading: false,
}),
};
},
methods: {
async mutate() {
this.isLoading = true;
......
......@@ -37,9 +37,11 @@ export default {
required: true,
},
},
data: () => ({
data() {
return {
state: STATE_IDLING,
}),
};
},
computed: {
shortSha() {
return truncateSha(this.diffFile.content_sha);
......
......@@ -45,9 +45,11 @@ export default {
required: true,
},
},
data: () => ({
data() {
return {
disabled: false,
}),
};
},
i18n: {
compareAllButtonTitle: s__('Trials|Compare all plans'),
popoverTitle: s__('Trials|Hey there'),
......
......@@ -20,9 +20,11 @@ export default {
required: true,
},
},
data: () => ({
data() {
return {
tooltipTitle: '',
}),
};
},
mounted() {
this.updateTooltipTitle();
},
......
......@@ -62,9 +62,11 @@ export default {
default: false,
},
},
data: () => ({
data() {
return {
autoDevopsAlertDismissed: 'false',
}),
};
},
computed: {
devopsMessage() {
return this.autoDevopsEnabled
......
......@@ -18,10 +18,12 @@ export default {
default: 'h3',
},
},
data: () => ({
data() {
return {
collapseId: uniqueId('expandable-section-'),
visible: false,
}),
};
},
computed: {
toggleText() {
return this.visible ? __('Collapse') : __('Expand');
......
......@@ -29,11 +29,13 @@ export default {
default: () => [],
},
},
data: () => ({
data() {
return {
isRunningScan: null,
hasRunScanError: false,
runScanErrors: [],
}),
};
},
computed: {
error() {
if (this.hasRunScanError) {
......
......@@ -25,10 +25,12 @@ export default {
required: true,
},
},
data: () => ({
data() {
return {
isPreparingCsvExport: false,
showPopover: localStorage.getItem(STORAGE_KEY) !== 'true',
}),
};
},
computed: {
buttonProps() {
const { isPreparingCsvExport } = this;
......
......@@ -10,9 +10,11 @@ export default {
StandardFilter,
GlToggle,
},
data: () => ({
data() {
return {
filterConfigs: [severityFilter, scannerFilter],
}),
};
},
computed: {
...mapState('filters', ['filters']),
hideDismissed: {
......
......@@ -17,9 +17,11 @@ export default {
props: {
projects: { type: Array, required: false, default: undefined },
},
data: () => ({
data() {
return {
filterQuery: {},
}),
};
},
computed: {
filters() {
const filters = [stateFilter, severityFilter, scannerFilter, activityFilter];
......
......@@ -13,9 +13,11 @@ export default {
GlButton,
GlFormSelect,
},
data: () => ({
data() {
return {
dismissalReason: null,
}),
};
},
computed: {
...mapGetters('vulnerabilities', ['selectedVulnerabilitiesCount']),
canDismissVulnerability() {
......
......@@ -24,10 +24,12 @@ export default {
default: () => ({}),
},
},
data: () => ({
data() {
return {
queryError: false,
vulnerabilitiesCount: {},
}),
};
},
computed: {
isLoading() {
return this.$apollo.queries.vulnerabilitiesCount.loading;
......
......@@ -52,14 +52,16 @@ export default {
default: '',
},
},
data: () => ({
data() {
return {
slide: 0,
carouselImages: [
securityDependencyImageUrl,
securityScanningImageUrl,
securityDashboardImageUrl,
],
}),
};
},
computed: {
discoverButtonProps() {
return {
......
......@@ -57,10 +57,12 @@ export default {
required: true,
},
},
data: () => ({
data() {
return {
localDismissalComment: '',
dismissalCommentErrorMessage: '',
}),
};
},
computed: {
canCreateIssueForThisVulnerability() {
return Boolean(!this.isResolved && !this.vulnerability.hasIssue && this.canCreateIssue);
......
......@@ -18,9 +18,11 @@ export default {
default: false,
},
},
data: () => ({
data() {
return {
selectedButton: {},
}),
};
},
created() {
this.setButton(this.buttons[0]);
},
......
......@@ -40,12 +40,12 @@ export default {
required: true,
},
},
data: () => ({
data() {
return {
discussionsDictionary: {},
lastFetchedAt: null,
}),
};
},
computed: {
discussions() {
return Object.values(this.discussionsDictionary);
......@@ -92,21 +92,17 @@ export default {
};
},
},
created() {
this.fetchDiscussions();
},
updated() {
this.$nextTick(() => {
initUserPopovers(this.$el.querySelectorAll('.js-user-link'));
});
},
beforeDestroy() {
if (this.poll) this.poll.stop();
},
methods: {
dateToSeconds(date) {
return Date.parse(date) / 1000;
......@@ -199,7 +195,6 @@ export default {
}
}
});
// Emit an event that tells the header to refresh the vulnerability.
if (isVulnerabilityStateChanged) {
this.$emit('vulnerability-state-change');
......@@ -211,7 +206,6 @@ export default {
<template>
<div data-qa-selector="vulnerability_footer">
<solution-card v-if="hasSolution" v-bind="solutionInfo" />
<div v-if="vulnerability.mergeRequestFeedback" class="card gl-mt-5">
<merge-request-note
:feedback="vulnerability.mergeRequestFeedback"
......@@ -219,7 +213,6 @@ export default {
class="card-body"
/>
</div>
<related-jira-issues
v-if="glFeatures.jiraForVulnerabilities && createJiraIssueUrl"
class="gl-mt-6"
......@@ -231,7 +224,6 @@ export default {
:project-path="project.url"
:help-path="vulnerability.relatedIssuesHelpPath"
/>
<div class="notes" data-testid="detection-note">
<div class="system-note gl-display-flex gl-align-items-center gl-p-0! gl-mt-6!">
<div class="timeline-icon gl-m-0!">
......@@ -244,9 +236,7 @@ export default {
/>
</div>
</div>
<hr />
<ul v-if="discussions.length" ref="historyList" class="notes discussion-body">
<history-entry
v-for="discussion in discussions"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment