Call it copy cause thats less weird
This commit is contained in:
parent
e26944eb0a
commit
cb5b42a2a2
@ -5057,6 +5057,22 @@
|
|||||||
<context context-type="sourcefile">src/app/components/common/system-status-dialog/system-status-dialog.component.html</context>
|
<context context-type="sourcefile">src/app/components/common/system-status-dialog/system-status-dialog.component.html</context>
|
||||||
<context context-type="linenumber">156</context>
|
<context context-type="linenumber">156</context>
|
||||||
</context-group>
|
</context-group>
|
||||||
|
<context-group purpose="location">
|
||||||
|
<context context-type="sourcefile">src/app/components/manage/mail/mail.component.html</context>
|
||||||
|
<context context-type="linenumber">101</context>
|
||||||
|
</context-group>
|
||||||
|
<context-group purpose="location">
|
||||||
|
<context context-type="sourcefile">src/app/components/manage/mail/mail.component.html</context>
|
||||||
|
<context context-type="linenumber">118</context>
|
||||||
|
</context-group>
|
||||||
|
<context-group purpose="location">
|
||||||
|
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.html</context>
|
||||||
|
<context context-type="linenumber">42</context>
|
||||||
|
</context-group>
|
||||||
|
<context-group purpose="location">
|
||||||
|
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.html</context>
|
||||||
|
<context context-type="linenumber">57</context>
|
||||||
|
</context-group>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="595732867213154214" datatype="html">
|
<trans-unit id="595732867213154214" datatype="html">
|
||||||
<source>Regenerate auth token</source>
|
<source>Regenerate auth token</source>
|
||||||
@ -7476,25 +7492,6 @@
|
|||||||
<context context-type="linenumber">79</context>
|
<context context-type="linenumber">79</context>
|
||||||
</context-group>
|
</context-group>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="5834780181397311898" datatype="html">
|
|
||||||
<source>Clone</source>
|
|
||||||
<context-group purpose="location">
|
|
||||||
<context context-type="sourcefile">src/app/components/manage/mail/mail.component.html</context>
|
|
||||||
<context context-type="linenumber">101</context>
|
|
||||||
</context-group>
|
|
||||||
<context-group purpose="location">
|
|
||||||
<context context-type="sourcefile">src/app/components/manage/mail/mail.component.html</context>
|
|
||||||
<context context-type="linenumber">118</context>
|
|
||||||
</context-group>
|
|
||||||
<context-group purpose="location">
|
|
||||||
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.html</context>
|
|
||||||
<context context-type="linenumber">42</context>
|
|
||||||
</context-group>
|
|
||||||
<context-group purpose="location">
|
|
||||||
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.html</context>
|
|
||||||
<context context-type="linenumber">57</context>
|
|
||||||
</context-group>
|
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="6751234988479444294" datatype="html">
|
<trans-unit id="6751234988479444294" datatype="html">
|
||||||
<source>No mail rules defined.</source>
|
<source>No mail rules defined.</source>
|
||||||
<context-group purpose="location">
|
<context-group purpose="location">
|
||||||
|
@ -98,7 +98,7 @@
|
|||||||
<button (click)="editMailRule(rule)" *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.MailRule }" ngbDropdownItem i18n>Edit</button>
|
<button (click)="editMailRule(rule)" *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.MailRule }" ngbDropdownItem i18n>Edit</button>
|
||||||
<button (click)="editPermissions(rule)" *pngxIfOwner="rule" ngbDropdownItem i18n>Permissions</button>
|
<button (click)="editPermissions(rule)" *pngxIfOwner="rule" ngbDropdownItem i18n>Permissions</button>
|
||||||
<button (click)="deleteMailRule(rule)" *pngxIfPermissions="{ action: PermissionAction.Delete, type: PermissionType.MailRule }" ngbDropdownItem i18n>Delete</button>
|
<button (click)="deleteMailRule(rule)" *pngxIfPermissions="{ action: PermissionAction.Delete, type: PermissionType.MailRule }" ngbDropdownItem i18n>Delete</button>
|
||||||
<button (click)="cloneMailRule(rule)" *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.MailRule }" ngbDropdownItem i18n>Clone</button>
|
<button (click)="copyMailrule(rule)" *pngxIfPermissions="{ action: PermissionAction.Add, type: PermissionType.MailRule }" ngbDropdownItem i18n>Copy</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -114,8 +114,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group ms-2 d-none d-sm-inline-block">
|
<div class="btn-group ms-2 d-none d-sm-inline-block">
|
||||||
<button *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.MailRule }" class="btn btn-sm btn-outline-secondary" type="button" (click)="cloneMailRule(rule)">
|
<button *pngxIfPermissions="{ action: PermissionAction.Add, type: PermissionType.MailRule }" class="btn btn-sm btn-outline-secondary" type="button" (click)="copyMailrule(rule)">
|
||||||
<i-bs width="1em" height="1em" name="files"></i-bs> <ng-container i18n>Clone</ng-container>
|
<i-bs width="1em" height="1em" name="files"></i-bs> <ng-container i18n>Copy</ng-container>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -226,14 +226,14 @@ describe('MailComponent', () => {
|
|||||||
component.editMailRule()
|
component.editMailRule()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should support clone mail rule', () => {
|
it('should support copy mail rule', () => {
|
||||||
completeSetup()
|
completeSetup()
|
||||||
let modal: NgbModalRef
|
let modal: NgbModalRef
|
||||||
modalService.activeInstances.subscribe((refs) => (modal = refs[0]))
|
modalService.activeInstances.subscribe((refs) => (modal = refs[0]))
|
||||||
component.cloneMailRule(mailRules[0] as MailRule)
|
component.copyMailRule(mailRules[0] as MailRule)
|
||||||
const editDialog = modal.componentInstance as MailRuleEditDialogComponent
|
const editDialog = modal.componentInstance as MailRuleEditDialogComponent
|
||||||
expect(editDialog.object.id).toBeNull()
|
expect(editDialog.object.id).toBeNull()
|
||||||
expect(editDialog.object.name).toEqual(`${mailRules[0].name} (clone)`)
|
expect(editDialog.object.name).toEqual(`${mailRules[0].name} (copy)`)
|
||||||
expect(editDialog.dialogMode).toEqual(EditDialogMode.CREATE)
|
expect(editDialog.dialogMode).toEqual(EditDialogMode.CREATE)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -137,13 +137,13 @@ export class MailComponent
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
editMailRule(rule: MailRule = null, clone = false) {
|
editMailRule(rule: MailRule = null, forceCreate = false) {
|
||||||
const modal = this.modalService.open(MailRuleEditDialogComponent, {
|
const modal = this.modalService.open(MailRuleEditDialogComponent, {
|
||||||
backdrop: 'static',
|
backdrop: 'static',
|
||||||
size: 'xl',
|
size: 'xl',
|
||||||
})
|
})
|
||||||
modal.componentInstance.dialogMode =
|
modal.componentInstance.dialogMode =
|
||||||
rule && !clone ? EditDialogMode.EDIT : EditDialogMode.CREATE
|
rule && !forceCreate ? EditDialogMode.EDIT : EditDialogMode.CREATE
|
||||||
modal.componentInstance.object = rule
|
modal.componentInstance.object = rule
|
||||||
modal.componentInstance.succeeded
|
modal.componentInstance.succeeded
|
||||||
.pipe(takeUntil(this.unsubscribeNotifier))
|
.pipe(takeUntil(this.unsubscribeNotifier))
|
||||||
@ -163,10 +163,10 @@ export class MailComponent
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
cloneMailRule(rule: MailRule) {
|
copyMailRule(rule: MailRule) {
|
||||||
const clone = { ...rule }
|
const clone = { ...rule }
|
||||||
clone.id = null
|
clone.id = null
|
||||||
clone.name = `${rule.name} (clone)`
|
clone.name = `${rule.name} (copy)`
|
||||||
this.editMailRule(clone, true)
|
this.editMailRule(clone, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<div ngbDropdownMenu aria-labelledby="actionsMenuMobile">
|
<div ngbDropdownMenu aria-labelledby="actionsMenuMobile">
|
||||||
<button (click)="editWorkflow(workflow)" *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.Workflow }" ngbDropdownItem i18n>Edit</button>
|
<button (click)="editWorkflow(workflow)" *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.Workflow }" ngbDropdownItem i18n>Edit</button>
|
||||||
<button (click)="deleteWorkflow(workflow)" *pngxIfPermissions="{ action: PermissionAction.Delete, type: PermissionType.Workflow }" ngbDropdownItem i18n>Delete</button>
|
<button (click)="deleteWorkflow(workflow)" *pngxIfPermissions="{ action: PermissionAction.Delete, type: PermissionType.Workflow }" ngbDropdownItem i18n>Delete</button>
|
||||||
<button (click)="cloneWorkflow(workflow)" *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.Workflow }" ngbDropdownItem i18n>Clone</button>
|
<button (click)="copyWorkflow(workflow)" *pngxIfPermissions="{ action: PermissionAction.Add, type: PermissionType.Workflow }" ngbDropdownItem i18n>Copy</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -53,8 +53,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group ms-2 d-none d-sm-block">
|
<div class="btn-group ms-2 d-none d-sm-block">
|
||||||
<button *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.Workflow }" class="btn btn-sm btn-outline-secondary" type="button" (click)="cloneWorkflow(workflow)">
|
<button *pngxIfPermissions="{ action: PermissionAction.Add, type: PermissionType.Workflow }" class="btn btn-sm btn-outline-secondary" type="button" (click)="copyWorkflow(workflow)">
|
||||||
<i-bs width="1em" height="1em" name="files"></i-bs> <ng-container i18n>Clone</ng-container>
|
<i-bs width="1em" height="1em" name="files"></i-bs> <ng-container i18n>Copy</ng-container>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -174,12 +174,12 @@ describe('WorkflowsComponent', () => {
|
|||||||
expect(reloadSpy).toHaveBeenCalled()
|
expect(reloadSpy).toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should support clone', () => {
|
it('should support copy', () => {
|
||||||
let modal: NgbModalRef
|
let modal: NgbModalRef
|
||||||
modalService.activeInstances.subscribe((m) => (modal = m[m.length - 1]))
|
modalService.activeInstances.subscribe((m) => (modal = m[m.length - 1]))
|
||||||
|
|
||||||
const cloneButton = fixture.debugElement.queryAll(By.css('button'))[6]
|
const copyButton = fixture.debugElement.queryAll(By.css('button'))[6]
|
||||||
cloneButton.triggerEventHandler('click')
|
copyButton.triggerEventHandler('click')
|
||||||
|
|
||||||
expect(modal).not.toBeUndefined()
|
expect(modal).not.toBeUndefined()
|
||||||
const editDialog = modal.componentInstance as WorkflowEditDialogComponent
|
const editDialog = modal.componentInstance as WorkflowEditDialogComponent
|
||||||
|
@ -57,13 +57,13 @@ export class WorkflowsComponent
|
|||||||
.join(', ')
|
.join(', ')
|
||||||
}
|
}
|
||||||
|
|
||||||
editWorkflow(workflow: Workflow, clone: boolean = false) {
|
editWorkflow(workflow: Workflow, forceCreate: boolean = false) {
|
||||||
const modal = this.modalService.open(WorkflowEditDialogComponent, {
|
const modal = this.modalService.open(WorkflowEditDialogComponent, {
|
||||||
backdrop: 'static',
|
backdrop: 'static',
|
||||||
size: 'xl',
|
size: 'xl',
|
||||||
})
|
})
|
||||||
modal.componentInstance.dialogMode =
|
modal.componentInstance.dialogMode =
|
||||||
workflow && !clone ? EditDialogMode.EDIT : EditDialogMode.CREATE
|
workflow && !forceCreate ? EditDialogMode.EDIT : EditDialogMode.CREATE
|
||||||
if (workflow) {
|
if (workflow) {
|
||||||
// quick "deep" clone so original doesn't get modified
|
// quick "deep" clone so original doesn't get modified
|
||||||
const clone = Object.assign({}, workflow)
|
const clone = Object.assign({}, workflow)
|
||||||
@ -87,7 +87,7 @@ export class WorkflowsComponent
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
cloneWorkflow(workflow: Workflow) {
|
copyWorkflow(workflow: Workflow) {
|
||||||
const clone = Object.assign({}, workflow)
|
const clone = Object.assign({}, workflow)
|
||||||
clone.id = null
|
clone.id = null
|
||||||
clone.name = `${workflow.name} (copy)`
|
clone.name = `${workflow.name} (copy)`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user