diff --git a/src/app/components/formatted-tickets/formatted-tickets.component.html b/src/app/components/formatted-tickets/formatted-tickets.component.html index 1404512..fa3997e 100755 --- a/src/app/components/formatted-tickets/formatted-tickets.component.html +++ b/src/app/components/formatted-tickets/formatted-tickets.component.html @@ -4,44 +4,8 @@

{{sprintName}}

-
-
-

{{issue.key | ticketkey}}

-

{{ issue.epic?(issue.epic.name | uppercase):"."}}

-
-
- -
- assignee photo area -

{{issue.complexity}}

-
-
- -
-
- -
-
-
-
-
- - + +
@@ -59,3 +23,65 @@

{{sprintName}}

+ + +
+
+

{{fullPostitIssues[i].key | ticketkey}}

+

{{ fullPostitIssues[i].epic?(fullPostitIssues[i].epic?.name | uppercase):"."}}

+
+
+ +
+ assignee photo area +

{{fullPostitIssues[i].complexity}}

+
+
+ +
+
+ +
+
+
+
+
+
+ + +
+
+

{{fullPostitIssues[fullTicketInEdition].key | ticketkey}}

+ +
+
+ +
+ assignee photo area + +
+
+ + +
+
\ No newline at end of file diff --git a/src/app/components/formatted-tickets/formatted-tickets.component.ts b/src/app/components/formatted-tickets/formatted-tickets.component.ts index e97b456..8bdde7f 100755 --- a/src/app/components/formatted-tickets/formatted-tickets.component.ts +++ b/src/app/components/formatted-tickets/formatted-tickets.component.ts @@ -6,6 +6,8 @@ import { PrintingConfigurationService } from '../../services/printing-configurat import { Subject } from 'rxjs' import { takeUntil } from 'rxjs/operators' import { Step } from '../progress-bar/step' +import { FormBuilder, FormGroup, FormArray } from '@angular/forms' +import { Epic } from 'src/app/services/scrum-issues/epic' @Component({ selector: 'app-formatted-tickets', @@ -21,14 +23,21 @@ export class FormattedTicketsComponent implements OnInit, OnDestroy { isComponentGrouped = false step = Step.PRINTING fullTicketInEdition: number | null = null + fullTicketForm: FormGroup private unsubscribe = new Subject() constructor( private issuesService: ScrumIssuesService, private printingConfigurationService: PrintingConfigurationService, - private route: ActivatedRoute + private route: ActivatedRoute, + private formBuilder: FormBuilder ) { this.sprintName = this.issuesService.sprint ? this.issuesService.sprint.name : '' + this.fullTicketForm = this.formBuilder.group({ + epic: [''], + summary: [''], + complexity: [''] + }) } ngOnInit(): void { @@ -121,10 +130,32 @@ export class FormattedTicketsComponent implements OnInit, OnDestroy { //Edition mode enterFullTicketEditionMode(index: number) { this.fullTicketInEdition = index + this.fullTicketForm.get('epic')?.patchValue(this.fullPostitIssues[index].epic?.name) + this.fullTicketForm.get('complexity')?.patchValue(this.fullPostitIssues[index].complexity) + this.fullTicketForm.get('summary')?.patchValue(this.fullPostitIssues[index].summary) } exitFullTicketEditionMode() { this.fullTicketInEdition = null + this.fullTicketForm.reset() + } + + onFullTicketSubmit() { + if (this.fullTicketInEdition !== null) { + var modifiedIssue = this.fullPostitIssues[this.fullTicketInEdition] + modifiedIssue.complexity = this.fullTicketForm.get('complexity')?.value + var modifiedEpicName = this.fullTicketForm.get('epic')?.value + var epic: Epic + if (modifiedEpicName != null) { + epic = new Epic('', modifiedEpicName) + } else { + epic = new Epic('', '.') + } + modifiedIssue.epic = epic + modifiedIssue.summary = this.fullTicketForm.get('summary')?.value + this.fullPostitIssues[this.fullTicketInEdition] = modifiedIssue + this.fullTicketInEdition = null + } } ngOnDestroy(): void { diff --git a/src/app/services/scrum-issues/epic.ts b/src/app/services/scrum-issues/epic.ts index 7e3de7f..e235330 100644 --- a/src/app/services/scrum-issues/epic.ts +++ b/src/app/services/scrum-issues/epic.ts @@ -1,4 +1,9 @@ -export interface Epic { +export class Epic { key: string name: string + + public constructor(key: string, name: string) { + this.key = key + this.name = name + } } diff --git a/src/app/services/scrum-issues/issue.ts b/src/app/services/scrum-issues/issue.ts index 008671b..6cfaa76 100755 --- a/src/app/services/scrum-issues/issue.ts +++ b/src/app/services/scrum-issues/issue.ts @@ -4,7 +4,7 @@ export interface Issue { key: string summary: string components: string[] - epic: Epic + epic: Epic | undefined type: string column: string complexity: string