Merge pull request #943 from dod-ccpo/remove-confirmation-popover
Remove confirmation-popover
This commit is contained in:
commit
378a0ea2bd
@ -1,8 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`ConfirmationPopover matches snapshot 1`] = `
|
||||
<v-popover-stub placement="top-start" delay="0" offset="0" trigger="click" container="body" popperoptions="[object Object]" popoverclass="vue-popover-theme" popoverbaseclass="tooltip popover" popoverinnerclass="tooltip-inner popover-inner" popoverwrapperclass="wrapper" popoverarrowclass="tooltip-arrow popover-arrow" autohide="true" handleresize="true"><template></template> <button type="button" class="tooltip-target">
|
||||
<div></div>
|
||||
Do something dangerous
|
||||
</button></v-popover-stub>
|
||||
`;
|
@ -1,31 +0,0 @@
|
||||
import { createLocalVue, shallowMount } from '@vue/test-utils'
|
||||
import VTooltip from 'v-tooltip'
|
||||
|
||||
import ConfirmationPopover from '../confirmation_popover'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(VTooltip)
|
||||
|
||||
describe('ConfirmationPopover', () => {
|
||||
const wrapper = shallowMount(ConfirmationPopover, {
|
||||
localVue,
|
||||
propsData: {
|
||||
action: '/some-url',
|
||||
btn_text: 'Do something dangerous',
|
||||
cancel_btn_text: 'Cancel',
|
||||
confirm_btn_text: 'Confirm',
|
||||
confirm_msg: 'Are you sure you want to do that?',
|
||||
csrf_token: '42',
|
||||
},
|
||||
})
|
||||
|
||||
it('matches snapshot', () => {
|
||||
expect(wrapper).toMatchSnapshot()
|
||||
})
|
||||
|
||||
it('renders form with hidden csrf input', () => {
|
||||
const input = wrapper.find('input[type=hidden]')
|
||||
expect(input.exists()).toBe(true)
|
||||
expect(input.attributes('value')).toBe('42')
|
||||
})
|
||||
})
|
@ -1,38 +0,0 @@
|
||||
export default {
|
||||
name: 'confirmation-popover',
|
||||
|
||||
props: {
|
||||
action: String,
|
||||
btn_text: String,
|
||||
btn_icon: String,
|
||||
btn_class: String,
|
||||
cancel_btn_text: String,
|
||||
confirm_btn_text: String,
|
||||
confirm_msg: String,
|
||||
csrf_token: String,
|
||||
name: String,
|
||||
},
|
||||
|
||||
template: `
|
||||
<v-popover placement='top-start'>
|
||||
<template slot="popover">
|
||||
<p>{{ confirm_msg }}</p>
|
||||
<div class='action-group'>
|
||||
<form method="POST" v-bind:action="action">
|
||||
<input id="csrf_token" name="csrf_token" type="hidden" v-bind:value="csrf_token">
|
||||
<button class='usa-button usa-button-primary' type='submit'>
|
||||
{{ confirm_btn_text }}
|
||||
</button>
|
||||
</form>
|
||||
<button class='usa-button usa-button-secondary' v-close-popover>
|
||||
{{ cancel_btn_text }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<button class="tooltip-target" v-bind:class="[btn_class]" type="button">
|
||||
<div v-html="btn_icon" />
|
||||
{{ btn_text }}
|
||||
</button>
|
||||
</v-popover>
|
||||
`,
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
import FormMixin from '../../mixins/form'
|
||||
import checkboxinput from '../checkbox_input'
|
||||
import textinput from '../text_input'
|
||||
import ConfirmationPopover from '../confirmation_popover'
|
||||
|
||||
export default {
|
||||
name: 'edit-officer-form',
|
||||
@ -11,7 +10,6 @@ export default {
|
||||
components: {
|
||||
checkboxinput,
|
||||
textinput,
|
||||
ConfirmationPopover,
|
||||
},
|
||||
|
||||
props: {
|
||||
|
@ -31,7 +31,6 @@ import SpendTable from './components/tables/spend_table'
|
||||
import EnvironmentsTable from './components/tables/application_environments'
|
||||
import TaskOrderList from './components/tables/task_order_list.js'
|
||||
import LocalDatetime from './components/local_datetime'
|
||||
import ConfirmationPopover from './components/confirmation_popover'
|
||||
import { isNotInVerticalViewport } from './lib/viewport'
|
||||
import DateSelector from './components/date_selector'
|
||||
import SidenavToggler from './components/sidenav_toggler'
|
||||
@ -73,7 +72,6 @@ const app = new Vue({
|
||||
EditEnvironmentRole,
|
||||
EditApplicationRoles,
|
||||
MultiStepModalForm,
|
||||
ConfirmationPopover,
|
||||
funding,
|
||||
uploadinput,
|
||||
DateSelector,
|
||||
|
@ -1,20 +0,0 @@
|
||||
{% macro ConfirmationButton(
|
||||
btn_text,
|
||||
action,
|
||||
btn_icon=None,
|
||||
btn_class=None,
|
||||
confirm_msg="Are you sure?",
|
||||
confirm_btn="Confirm",
|
||||
cancel_btn="Cancel")
|
||||
-%}
|
||||
<confirmation-popover
|
||||
btn_text='{{ btn_text }}'
|
||||
btn_icon='{{ btn_icon }}'
|
||||
btn_class='{{ btn_class }}'
|
||||
action='{{ action }}'
|
||||
csrf_token='{{ csrf_token() }}'
|
||||
confirm_msg='{{ confirm_msg }}'
|
||||
confirm_btn_text='{{ confirm_btn }}'
|
||||
cancel_btn_text='{{ cancel_btn }}'>
|
||||
</confirmation-popover>
|
||||
{%- endmacro %}
|
@ -1,5 +0,0 @@
|
||||
{% macro RequiredLabel() -%}
|
||||
<span class='label label--error'>{{ "common.response_label" | translate }}</span>
|
||||
{%- endmacro %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user