Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shinoshu committed Dec 16, 2019
1 parent 052becd commit 4fc8100
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#d04649",
"activityBar.activeBorder": "#37cb34",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#37cb34",
"activityBarBadge.foreground": "#15202b",
"titleBar.activeBackground": "#b52e31",
"titleBar.inactiveBackground": "#b52e3199",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveForeground": "#e7e7e799",
"statusBar.background": "#b52e31",
"statusBarItem.hoverBackground": "#d04649",
"statusBar.foreground": "#e7e7e7"
},
"peacock.color": "#b52e31"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, EventEmitter, Output } from '@angular/core';
import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
import { FormGroup, FormControl, FormBuilder, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material';
import { v4 } from 'uuid';

Expand All @@ -11,8 +11,8 @@ import { v4 } from 'uuid';
export class UserAdditionalDialogComponent implements OnInit {
form = this.fb.group({
id: [v4()],
name: [''],
email: [''],
name: ['', Validators.required],
email: ['', Validators.required],
});

constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, EventEmitter, Output } from '@angular/core';
import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
import { FormGroup, FormControl, FormBuilder, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material';
import { v4 } from 'uuid';

Expand All @@ -11,8 +11,8 @@ import { v4 } from 'uuid';
export class UserEditingDialogComponent implements OnInit {
form = this.fb.group({
id: [v4()],
name: [''],
email: [''],
name: ['', Validators.required],
email: ['', Validators.required],
});

constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,19 @@ export class CollectionPageComponent implements OnInit {
const dialogRef = this.dialog.open(UserAdditionalDialogComponent);

dialogRef.afterClosed().subscribe(result => {
this.store.dispatch(addUser({ user: result }));
if (result) {
this.store.dispatch(addUser({ user: result }));
}
});
}

openEditingDialog() {
const dialogRef = this.dialog.open(UserEditingDialogComponent);

dialogRef.afterClosed().subscribe(result => {
this.store.dispatch(addUser({ user: result }));
if (result) {
this.store.dispatch(addUser({ user: result }));
}
});
}
}

0 comments on commit 4fc8100

Please sign in to comment.