Commit d1d38bce authored by samdbeckham's avatar samdbeckham

Adds a `.modal--hide-footer` class to the security modal so we can conditionally hide it with CSS

parent 33116299
...@@ -57,6 +57,7 @@ export default { ...@@ -57,6 +57,7 @@ export default {
<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': modal.vulnerability.resolved}"
class="modal-security-report-dast" class="modal-security-report-dast"
> >
<slot> <slot>
...@@ -195,15 +196,15 @@ export default { ...@@ -195,15 +196,15 @@ export default {
</div> </div>
</slot> </slot>
<div slot="footer"> <div slot="footer">
<button
type="button"
class="btn btn-default"
data-dismiss="modal"
>
{{ __('Cancel' ) }}
</button>
<template v-if="!modal.vulnerability.resolved"> <template v-if="!modal.vulnerability.resolved">
<button
type="button"
class="btn btn-default"
data-dismiss="modal"
>
{{ __('Cancel' ) }}
</button>
<loading-button <loading-button
:loading="modal.isDismissingIssue" :loading="modal.isDismissingIssue"
:disabled="modal.isDismissingIssue" :disabled="modal.isDismissingIssue"
...@@ -221,6 +222,7 @@ export default { ...@@ -221,6 +222,7 @@ export default {
{{ __('View issue' ) }} {{ __('View issue' ) }}
</a> </a>
<loading-button <loading-button
v-else
:loading="modal.isCreatingNewIssue" :loading="modal.isCreatingNewIssue"
:disabled="modal.isCreatingNewIssue" :disabled="modal.isCreatingNewIssue"
:label="__('Create issue')" :label="__('Create issue')"
......
...@@ -139,4 +139,9 @@ ...@@ -139,4 +139,9 @@
width: $modal-lg; width: $modal-lg;
max-width: $modal-lg; max-width: $modal-lg;
} }
// This is temporary till we get the new modals hooked up
&.modal--hide-footer .modal-footer {
display: none;
}
} }
...@@ -211,8 +211,8 @@ describe('Security Reports modal', () => { ...@@ -211,8 +211,8 @@ describe('Security Reports modal', () => {
}); });
}); });
it('does not render a button to dismiss issue', () => { it('does not display the footer', () => {
expect(vm.$el.querySelector('.js-dismiss-btn')).toBeFalsy(); expect(vm.$el.classList.contains('modal--hide-footer')).toBeTruthy();
}); });
}); });
}); });
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