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

Document computed properties

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