Commit 600a6b52 authored by Filipa Lacerda's avatar Filipa Lacerda

Document computed properties

parent 6781c46d
<script>
import { mapActions, mapState } from 'vuex';
import { s__ } from '~/locale';
import Modal from '~/vue_shared/components/gl_modal.vue';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
import Icon from '~/vue_shared/components/icon.vue';
import ExpandButton from '~/vue_shared/components/expand_button.vue';
import { mapActions, mapState } from 'vuex';
import { s__ } from '~/locale';
import Modal from '~/vue_shared/components/gl_modal.vue';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
import Icon from '~/vue_shared/components/icon.vue';
import ExpandButton from '~/vue_shared/components/expand_button.vue';
export default {
export default {
components: {
Modal,
LoadingButton,
......@@ -32,10 +32,13 @@ export default {
this.modal.vulnerability.dismissalFeedback.author
);
},
shouldHideModalFooter() {
/**
* The slot for the footer should be rendered if any of the conditions is true.
*/
shouldRenderFooterSection() {
return (
this.modal.isResolved ||
(!this.canCreateFeedbackPermission && !this.canCreateIssuePermission)
!this.modal.isResolved &&
(this.canCreateFeedbackPermission || this.canCreateIssuePermission)
);
},
},
......@@ -64,13 +67,13 @@ export default {
return key === 'links' && this.hasValue(field);
},
},
};
};
</script>
<template>
<modal
id="modal-mrwidget-security-issue"
:header-title-text="modal.title"
:class="{ 'modal-hide-footer': shouldHideModalFooter }"
:class="{ 'modal-hide-footer': !shouldRenderFooterSection }"
class="modal-security-report-dast"
>
<slot>
......@@ -209,7 +212,7 @@ export default {
</div>
</slot>
<div slot="footer">
<template v-if="!modal.isResolved && (canCreateFeedbackPermission || canCreateIssuePermission)">
<template v-if="shouldRenderFooterSection">
<button
type="button"
class="btn btn-default"
......
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