-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from louiiuol/develop
Develop
- Loading branch information
Showing
29 changed files
with
261 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
application/web-ui/src/app/components/shared/confess/confess.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
<button mat-icon-button id="close-dialog" color="primary" aria-label="close tinee dialog"> | ||
<app-icon (click)="close()" class="icon xs" name="close"></app-icon> | ||
<button mat-icon-button id='close-dialog' color='primary' aria-label='close tinee dialog'> | ||
<app-icon (click)='close()' class='icon xs' name='close'></app-icon> | ||
</button> | ||
<h3 mat-dialog-title class="header">Confess</h3> | ||
<h3 mat-dialog-title class='header'>Confess</h3> | ||
<form> | ||
<p class='legend'>What did you sworn about ?</p> | ||
<mat-form-field> | ||
<mat-label>Confess</mat-label> | ||
<input matInput placeholder="Damn it !" [formControl]="confession" required> | ||
<mat-error *ngIf="confession.invalid">That's not a confession !</mat-error> | ||
<input matInput placeholder='Damn it !' [formControl]='confessionControl' required> | ||
<mat-error *ngIf='confessionControl.invalid'>That's not a confession !</mat-error> | ||
</mat-form-field> | ||
<button color="primary" mat-raised-button (click)="confess()">Confess</button> | ||
<button color='primary' mat-raised-button | ||
disabled='{{confessionControl.invalid}}' (click)='confess()'>Confess</button> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
.../web-ui/src/app/components/views/dashboard/jar-board/jar-preview/jar-preview.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...omponents/views/jar-details/jar-active/confession-update/confession-update.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<button mat-icon-button id='close-dialog' color='primary' aria-label='close tinee dialog'> | ||
<app-icon (click)='close()' class='icon xs' name='close'></app-icon> | ||
</button> | ||
<h3 mat-dialog-title class='header'>Update your confession</h3> | ||
<form> | ||
<p class='legend'>That wasn't what you said ?</p> | ||
<mat-form-field> | ||
<mat-label>Confession</mat-label> | ||
<input matInput placeholder='Damn it !' [formControl]='confessionControl' required> | ||
<mat-error *ngIf='confessionControl.invalid'>That's not a confession !</mat-error> | ||
</mat-form-field> | ||
<button color='primary' mat-raised-button | ||
disabled='{{confessionControl.invalid}}' (click)='update()'>update</button> | ||
</form> |
1 change: 1 addition & 0 deletions
1
...omponents/views/jar-details/jar-active/confession-update/confession-update.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
h3 { padding: 2rem 3rem !important;} |
25 changes: 25 additions & 0 deletions
25
...onents/views/jar-details/jar-active/confession-update/confession-update.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ConfessionUpdateComponent } from './confession-update.component'; | ||
|
||
describe('ConfessionUpdateComponent', () => { | ||
let component: ConfessionUpdateComponent; | ||
let fixture: ComponentFixture<ConfessionUpdateComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ConfessionUpdateComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ConfessionUpdateComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
35 changes: 35 additions & 0 deletions
35
.../components/views/jar-details/jar-active/confession-update/confession-update.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Component, Inject } from '@angular/core'; | ||
import { FormControl, Validators } from '@angular/forms'; | ||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||
import { Patterns } from 'src/app/services/forms/utils'; | ||
import { ConfessionService } from 'src/app/services/domain/jar/member/confession.service'; | ||
import { ConfessionUpdateDialogData, Confess } from 'src/app/models'; | ||
import { FormFactory } from 'src/app/services'; | ||
|
||
@Component({ | ||
selector: 'app-confession-update', | ||
templateUrl: './confession-update.component.html', | ||
styleUrls: ['./confession-update.component.scss'] | ||
}) | ||
export class ConfessionUpdateComponent { | ||
|
||
readonly confessionControl = new FormControl(this.data.confession.swear, | ||
[Validators.required, Validators.pattern(Patterns.alphanumeric)]); | ||
|
||
constructor( | ||
private formFactory: FormFactory, private dialogRef: MatDialogRef<ConfessionUpdateComponent>, | ||
@Inject(MAT_DIALOG_DATA) private data: ConfessionUpdateDialogData, private confessionService: ConfessionService) { } | ||
|
||
|
||
update(): void { | ||
const confess = new Confess(this.confessionControl.value, this.data.confession.author.id, this.data.jarId); | ||
this.confessionService.updateConfession(this.data.jarId, confess, this.data.confession.id) | ||
.subscribe(() => { | ||
this.dialogRef.close(this.confessionControl.value); | ||
this.formFactory.handleSuccessMessages('Confession updated with success !'); | ||
}, err => this.formFactory.handleErrorMessages(err)); | ||
} | ||
|
||
close = (): void => this.dialogRef.close(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.