Replace confirmation toggle with c-input-confirm
This commit is contained in:
parent
d3394a7d9a
commit
47ed5659a3
@ -115,13 +115,15 @@
|
||||
</b-form>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="route && route.routeID && route.canDeleteApigwRoute"
|
||||
:data-test-id="deletedButtonStatusCypressId"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit('delete')"
|
||||
>
|
||||
{{ getDeleteStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<c-button-submit
|
||||
:disabled="saveDisabled"
|
||||
@ -137,7 +139,6 @@
|
||||
|
||||
<script>
|
||||
import { NoID } from '@cortezaproject/corteza-js'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
|
||||
export default {
|
||||
name: 'CRouteEditorInfo',
|
||||
@ -147,10 +148,6 @@ export default {
|
||||
keyPrefix: 'editor.info',
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
route: {
|
||||
type: Object,
|
||||
|
||||
@ -68,13 +68,15 @@
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="application && application.applicationID && application.canDeleteApplication"
|
||||
:data-test-id="deleteButtonStatusCypressId"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit('delete')"
|
||||
>
|
||||
{{ getDeleteStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<c-button-submit
|
||||
:disabled="saveDisabled"
|
||||
@ -90,7 +92,6 @@
|
||||
|
||||
<script>
|
||||
import { NoID } from '@cortezaproject/corteza-js'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
|
||||
export default {
|
||||
name: 'CApplicationEditorInfo',
|
||||
@ -100,10 +101,6 @@ export default {
|
||||
keyPrefix: 'editor.info',
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
application: {
|
||||
type: Object,
|
||||
|
||||
@ -468,23 +468,15 @@
|
||||
<template
|
||||
v-if="canDelete"
|
||||
>
|
||||
<confirmation-toggle
|
||||
v-if="isDeleted"
|
||||
data-test-id="button-undelete"
|
||||
<c-input-confirm
|
||||
:data-test-id="isDeleted ? 'button-undelete': 'button-delete'"
|
||||
:disabled="processing"
|
||||
@confirmed="$emit('undelete', resource.authClientID)"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit(isDeleted ? 'undelete' : 'delete', resource.authClientID)"
|
||||
>
|
||||
{{ $t('undelete') }}
|
||||
</confirmation-toggle>
|
||||
|
||||
<confirmation-toggle
|
||||
v-else
|
||||
data-test-id="button-delete"
|
||||
:disabled="processing"
|
||||
@confirmed="$emit('delete', resource.authClientID)"
|
||||
>
|
||||
{{ $t('delete') }}
|
||||
</confirmation-toggle>
|
||||
{{ isDeleted ? $t('undelete') : $t('delete') }}
|
||||
</c-input-confirm>
|
||||
</template>
|
||||
|
||||
<c-button-submit
|
||||
@ -502,7 +494,6 @@
|
||||
<script>
|
||||
import { NoID } from '@cortezaproject/corteza-js'
|
||||
import { handle, components } from '@cortezaproject/corteza-vue'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
import CRolePicker from 'corteza-webapp-admin/src/components/CRolePicker'
|
||||
import CSelectUser from 'corteza-webapp-admin/src/components/Authclient/CSelectUser'
|
||||
import copy from 'copy-to-clipboard'
|
||||
@ -519,7 +510,6 @@ export default {
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
CRolePicker,
|
||||
CSelectUser,
|
||||
CInputDateTime,
|
||||
|
||||
@ -9,7 +9,6 @@ import { default as CTemplateEditorInfo } from './Template/C3'
|
||||
import { default as CUserEditorInfo } from './User/C3'
|
||||
import { default as CWorkflowEditorInfo } from './Workflow/C3'
|
||||
import { default as CResourceListStatusFilter } from './CResourceListStatusFilter.c3'
|
||||
import { default as ConfirmationToggle } from './ConfirmationToggle.c3'
|
||||
import { default as CSubmitButton } from './CSubmitButton.c3'
|
||||
|
||||
export default {
|
||||
@ -24,6 +23,5 @@ export default {
|
||||
CUserEditorInfo,
|
||||
CWorkflowEditorInfo,
|
||||
CResourceListStatusFilter,
|
||||
ConfirmationToggle,
|
||||
CSubmitButton,
|
||||
}
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
import { default as component } from './ConfirmationToggle.vue'
|
||||
import { components } from '@cortezaproject/corteza-vue'
|
||||
const { checkbox } = components.C3.controls
|
||||
|
||||
const props = {
|
||||
disabled: false,
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Confirmation toggle',
|
||||
group: ['Root components'],
|
||||
component,
|
||||
props,
|
||||
controls: [
|
||||
checkbox('Disabled', 'disabled'),
|
||||
],
|
||||
}
|
||||
@ -1,89 +0,0 @@
|
||||
<template>
|
||||
<div class="d-inline-flex">
|
||||
<template v-if="!inConfirmation">
|
||||
<b-button
|
||||
:variant="ctaClass"
|
||||
:disabled="disabled"
|
||||
class="confirmation-prompt flex-fill"
|
||||
@click.prevent="onPrompt"
|
||||
>
|
||||
<slot />
|
||||
</b-button>
|
||||
</template>
|
||||
|
||||
<template v-if="inConfirmation">
|
||||
<b-button
|
||||
:variant="confirmationClass"
|
||||
class="confirmation-confirm flex-fill mr-1"
|
||||
@click.prevent="onConfirmation()"
|
||||
>
|
||||
{{ $t('label.yes') }}
|
||||
</b-button>
|
||||
|
||||
<b-button
|
||||
variant="light"
|
||||
class="confirmation-cancel flex-fill"
|
||||
@click.prevent="inConfirmation=false"
|
||||
>
|
||||
{{ $t('label.no') }}
|
||||
</b-button>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
ctaClass: { type: String, default: 'danger' },
|
||||
confirmationClass: {
|
||||
default: 'danger',
|
||||
type: String,
|
||||
},
|
||||
disabled: Boolean,
|
||||
noPrompt: Boolean,
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
inConfirmation: false,
|
||||
}
|
||||
},
|
||||
|
||||
i18nOptions: {
|
||||
namespaces: 'admin',
|
||||
keyPrefix: 'general',
|
||||
},
|
||||
|
||||
methods: {
|
||||
onPrompt () {
|
||||
if (this.noPrompt) {
|
||||
this.$emit('confirmed')
|
||||
} else {
|
||||
this.inConfirmation = true
|
||||
}
|
||||
},
|
||||
|
||||
onConfirmation () {
|
||||
this.inConfirmation = false
|
||||
this.$emit('confirmed')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.btn {
|
||||
margin: 0 1px;
|
||||
}
|
||||
|
||||
.btn-url {
|
||||
color: var(--danger);
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
color: var(--danger);
|
||||
|
||||
.icon-trash {
|
||||
font-weight: 900;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -146,12 +146,14 @@
|
||||
</b-row>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="!fresh && !isPrimary && !disabled"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit('delete')"
|
||||
>
|
||||
{{ connection.deletedAt ? $t('general:label.undelete') : $t('general:label.delete') }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<c-button-submit
|
||||
:disabled="disabled || saveDisabled"
|
||||
@ -169,7 +171,6 @@
|
||||
import { NoID } from '@cortezaproject/corteza-js'
|
||||
import { components, handle } from '@cortezaproject/corteza-vue'
|
||||
import CLocation from 'corteza-webapp-admin/src/components/CLocation'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
const { CSensitivityLevelPicker } = components
|
||||
|
||||
export default {
|
||||
@ -181,7 +182,6 @@ export default {
|
||||
components: {
|
||||
CLocation,
|
||||
CSensitivityLevelPicker,
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
|
||||
@ -92,12 +92,14 @@
|
||||
</b-form>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="node && node.nodeID"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit('delete')"
|
||||
>
|
||||
{{ getDeleteStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<c-button-submit
|
||||
:disabled="saveDisabled"
|
||||
@ -113,7 +115,6 @@
|
||||
|
||||
<script>
|
||||
import { NoID } from '@cortezaproject/corteza-js'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
|
||||
export default {
|
||||
name: 'CFederationEditorInfo',
|
||||
@ -123,10 +124,6 @@ export default {
|
||||
keyPrefix: 'editor.info',
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
node: {
|
||||
type: Object,
|
||||
|
||||
@ -94,13 +94,15 @@
|
||||
</b-form>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="queue && queue.queueID && queue.canDeleteQueue"
|
||||
:data-test-id="deleteButtonStatusCypressId"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit('delete')"
|
||||
>
|
||||
{{ getDeleteStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<c-button-submit
|
||||
:disabled="saveDisabled"
|
||||
@ -117,7 +119,6 @@
|
||||
<script>
|
||||
import { NoID } from '@cortezaproject/corteza-js'
|
||||
import { handle } from '@cortezaproject/corteza-vue'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
|
||||
export default {
|
||||
name: 'CQueueEditorInfo',
|
||||
@ -127,10 +128,6 @@ export default {
|
||||
keyPrefix: 'editor.info',
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
consumers: {
|
||||
type: Array,
|
||||
|
||||
@ -142,22 +142,25 @@
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="!fresh && editable && role.canDeleteRole && !isDataPrivacyOfficer"
|
||||
:data-test-id="deletedButtonStatusCypressId"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit('delete')"
|
||||
>
|
||||
{{ getDeleteStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="!fresh && editable && !isDataPrivacyOfficer"
|
||||
:data-test-id="archivedButtonStatusCypressId"
|
||||
cta-class="secondary"
|
||||
variant="secondary"
|
||||
size="md"
|
||||
@confirmed="$emit('status')"
|
||||
>
|
||||
{{ getArchiveStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<c-button-submit
|
||||
:disabled="saveDisabled"
|
||||
@ -174,7 +177,6 @@
|
||||
<script>
|
||||
import { system, NoID } from '@cortezaproject/corteza-js'
|
||||
import { handle } from '@cortezaproject/corteza-vue'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
|
||||
export default {
|
||||
name: 'CRoleEditorInfo',
|
||||
@ -184,10 +186,6 @@ export default {
|
||||
keyPrefix: 'editor.info',
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
role: {
|
||||
type: system.Role,
|
||||
|
||||
@ -97,12 +97,14 @@
|
||||
</b-form>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="sensitivityLevel && sensitivityLevel.sensitivityLevelID"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit('delete')"
|
||||
>
|
||||
{{ getDeleteStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<c-button-submit
|
||||
:disabled="saveDisabled"
|
||||
@ -119,7 +121,6 @@
|
||||
<script>
|
||||
import { NoID } from '@cortezaproject/corteza-js'
|
||||
import { handle } from '@cortezaproject/corteza-vue'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
|
||||
export default {
|
||||
name: 'CSensitivityLevelEditorInfo',
|
||||
@ -129,10 +130,6 @@ export default {
|
||||
keyPrefix: 'editor.info',
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
sensitivityLevel: {
|
||||
type: Object,
|
||||
|
||||
@ -106,7 +106,6 @@ import _ from 'lodash'
|
||||
import OidcExternal from 'corteza-webapp-admin/src/components/Settings/System/Auth/ExternalOIDC'
|
||||
import StandardExternal from 'corteza-webapp-admin/src/components/Settings/System/Auth/ExternalStd'
|
||||
import SamlExternal from 'corteza-webapp-admin/src/components/Settings/System/Auth/ExternalSAML'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
|
||||
const idpStandard = [
|
||||
'google',
|
||||
@ -233,7 +232,6 @@ export default {
|
||||
OidcExternal,
|
||||
StandardExternal,
|
||||
SamlExternal,
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
|
||||
@ -121,13 +121,15 @@
|
||||
</b-form>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="!fresh && template.canDeleteTemplate"
|
||||
:data-test-id="getDeletedButtonStatusCypressId"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit('delete')"
|
||||
>
|
||||
{{ getDeleteStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<c-button-submit
|
||||
:disabled="saveDisabled"
|
||||
@ -144,7 +146,6 @@
|
||||
<script>
|
||||
import { NoID } from '@cortezaproject/corteza-js'
|
||||
import { handle } from '@cortezaproject/corteza-vue'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
|
||||
export default {
|
||||
name: 'CTemplateEditorInfo',
|
||||
@ -154,10 +155,6 @@ export default {
|
||||
keyPrefix: 'editor.info',
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
template: {
|
||||
type: Object,
|
||||
|
||||
@ -88,32 +88,36 @@
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="!fresh && user.canDeleteUser"
|
||||
:data-test-id="deletedButtonStatusCypressId"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit('delete')"
|
||||
>
|
||||
{{ getDeleteStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="!fresh"
|
||||
:data-test-id="suspendButtonStatusCypressId"
|
||||
cta-class="light"
|
||||
variant="light"
|
||||
size="md"
|
||||
@confirmed="$emit('status')"
|
||||
>
|
||||
{{ getSuspendStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="!fresh"
|
||||
data-test-id="button-sessions-revoke"
|
||||
:disabled="user.userID === userID"
|
||||
cta-class="light"
|
||||
variant="light"
|
||||
size="md"
|
||||
@confirmed="$emit('sessionsRevoke')"
|
||||
>
|
||||
{{ $t('revokeAllSession') }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<b-button
|
||||
v-if="!fresh && !user.emailConfirmed"
|
||||
@ -146,7 +150,6 @@
|
||||
<script>
|
||||
import { NoID } from '@cortezaproject/corteza-js'
|
||||
import { handle } from '@cortezaproject/corteza-vue'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
import { getSystemFields } from 'corteza-webapp-admin/src/lib/sysFields'
|
||||
|
||||
export default {
|
||||
@ -157,10 +160,6 @@ export default {
|
||||
keyPrefix: 'editor.info',
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
user: {
|
||||
type: Object,
|
||||
|
||||
@ -57,13 +57,14 @@
|
||||
</b-form>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
data-test-id="button-remove-password"
|
||||
cta-class="light"
|
||||
variant="light"
|
||||
size="md"
|
||||
@confirmed="$emit('submit')"
|
||||
>
|
||||
{{ $t('removePassword') }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<c-corredor-manual-buttons
|
||||
ui-page="user/editor"
|
||||
@ -85,7 +86,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
|
||||
export default {
|
||||
name: 'CUserEditorPassword',
|
||||
@ -95,10 +95,6 @@ export default {
|
||||
keyPrefix: 'editor.password',
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
processing: {
|
||||
type: Boolean,
|
||||
|
||||
@ -85,13 +85,15 @@
|
||||
</b-form>
|
||||
|
||||
<template #footer>
|
||||
<confirmation-toggle
|
||||
<c-input-confirm
|
||||
v-if="workflow && workflow.workflowID && workflow.canDeleteWorkflow"
|
||||
:disabled="deleteDisabled"
|
||||
variant="danger"
|
||||
size="md"
|
||||
@confirmed="$emit('delete')"
|
||||
>
|
||||
{{ getDeleteStatus }}
|
||||
</confirmation-toggle>
|
||||
</c-input-confirm>
|
||||
|
||||
<b-button
|
||||
v-if="workflow.workflowID"
|
||||
@ -115,7 +117,6 @@
|
||||
|
||||
<script>
|
||||
import { handle } from '@cortezaproject/corteza-vue'
|
||||
import ConfirmationToggle from 'corteza-webapp-admin/src/components/ConfirmationToggle'
|
||||
import { NoID } from '@cortezaproject/corteza-js'
|
||||
|
||||
export default {
|
||||
@ -126,10 +127,6 @@ export default {
|
||||
keyPrefix: 'editor.info',
|
||||
},
|
||||
|
||||
components: {
|
||||
ConfirmationToggle,
|
||||
},
|
||||
|
||||
props: {
|
||||
workflow: {
|
||||
type: Object,
|
||||
|
||||
@ -51,7 +51,6 @@ const mounter = (component, { localVue = createLocalVue(), $auth = {}, mocks = {
|
||||
stubs: [
|
||||
'router-view',
|
||||
'router-link',
|
||||
'confirmation-toggle',
|
||||
'user-roles',
|
||||
'c-permissions-button',
|
||||
...stubs,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user