From 0d902cb9f8c21cd2fe5d19a0f69c672b17f125b9 Mon Sep 17 00:00:00 2001 From: Cathy Hu Date: Fri, 28 Aug 2020 13:25:51 +0200 Subject: [PATCH] [frontend] Add initial design for platforms --- .../app/dashboard/board/board.component.html | 2 +- .../board/platforms/platforms.component.html | 6 ++- .../board/platforms/platforms.component.scss | 11 +++++ .../board/platforms/platforms.component.ts | 4 +- .../email-settings.component.html | 40 +++++++++++++++++ .../email-settings.component.scss | 6 +++ .../email-settings.component.spec.ts | 24 ++++++++++ .../email-settings.component.ts | 19 ++++++++ .../src/app/platforms/platforms.module.ts | 21 +++++++++ .../telegram-settings.component.html | 44 +++++++++++++++++++ .../telegram-settings.component.scss | 6 +++ .../telegram-settings.component.spec.ts | 24 ++++++++++ .../telegram-settings.component.ts | 19 ++++++++ .../twitter-settings.component.html | 44 +++++++++++++++++++ .../twitter-settings.component.scss | 6 +++ .../twitter-settings.component.spec.ts | 24 ++++++++++ .../twitter-settings.component.ts | 19 ++++++++ .../app/shared/material/material.module.ts | 3 ++ 18 files changed, 319 insertions(+), 3 deletions(-) create mode 100644 kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.html create mode 100644 kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.scss create mode 100644 kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.spec.ts create mode 100644 kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.ts create mode 100644 kibicara-frontend/src/app/platforms/platforms.module.ts create mode 100644 kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.html create mode 100644 kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.scss create mode 100644 kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.spec.ts create mode 100644 kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.ts create mode 100644 kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.html create mode 100644 kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.scss create mode 100644 kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.spec.ts create mode 100644 kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.ts diff --git a/kibicara-frontend/src/app/dashboard/board/board.component.html b/kibicara-frontend/src/app/dashboard/board/board.component.html index 0508cae..2306506 100644 --- a/kibicara-frontend/src/app/dashboard/board/board.component.html +++ b/kibicara-frontend/src/app/dashboard/board/board.component.html @@ -15,7 +15,7 @@ - + diff --git a/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.html b/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.html index 8e46a98..d8555c8 100644 --- a/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.html +++ b/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.html @@ -1 +1,5 @@ -

platforms works!

+
+ + + +
diff --git a/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.scss b/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.scss index e69de29..400bd40 100644 --- a/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.scss +++ b/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.scss @@ -0,0 +1,11 @@ +.platforms-container { + margin: 10px; + display: grid; + gap: 10px; + align-items: stretch; + justify-items: stretch; + grid-template-columns: 1fr 1fr 1fr; + @media (max-width: 600px) { + grid-template-columns: 1fr; + } +} diff --git a/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.ts b/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.ts index 4a8c94f..208d8a3 100644 --- a/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.ts +++ b/kibicara-frontend/src/app/dashboard/board/platforms/platforms.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'app-platforms', @@ -6,6 +6,8 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./platforms.component.scss'], }) export class PlatformsComponent implements OnInit { + @Input() hoodId; + constructor() {} ngOnInit(): void {} diff --git a/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.html b/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.html new file mode 100644 index 0000000..d439400 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.html @@ -0,0 +1,40 @@ + + + E-Mails + + + + + + + + +
+ Telegramdummy + + +
+ +
+
+ + + + +
+
diff --git a/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.scss b/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.scss new file mode 100644 index 0000000..b76aeea --- /dev/null +++ b/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.scss @@ -0,0 +1,6 @@ +.entry { + display: grid; + grid-template-columns: 4fr 40px 20px; + width: 100%; + align-items: center; +} diff --git a/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.spec.ts b/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.spec.ts new file mode 100644 index 0000000..900c895 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EmailSettingsComponent } from './email-settings.component'; + +describe('EmailSettingsComponent', () => { + let component: EmailSettingsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [EmailSettingsComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EmailSettingsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.ts b/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.ts new file mode 100644 index 0000000..78cb972 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/email/email-settings/email-settings.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { Observable } from 'rxjs/internal/Observable'; +import { EmailService } from 'src/app/core/api'; + +@Component({ + selector: 'app-email-settings', + templateUrl: './email-settings.component.html', + styleUrls: ['./email-settings.component.scss'], +}) +export class EmailSettingsComponent implements OnInit { + @Input() hoodId; + emails$: Observable>; + + constructor(private emailService: EmailService) {} + + ngOnInit(): void { + this.emails$ = this.emailService.getEmails(this.hoodId); + } +} diff --git a/kibicara-frontend/src/app/platforms/platforms.module.ts b/kibicara-frontend/src/app/platforms/platforms.module.ts new file mode 100644 index 0000000..8900f10 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/platforms.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { TelegramSettingsComponent } from './telegram/telegram-settings/telegram-settings.component'; +import { SharedModule } from '../shared/shared.module'; +import { TwitterSettingsComponent } from './twitter/twitter-settings/twitter-settings.component'; +import { EmailSettingsComponent } from './email/email-settings/email-settings.component'; + +@NgModule({ + declarations: [ + TelegramSettingsComponent, + TwitterSettingsComponent, + EmailSettingsComponent, + ], + imports: [CommonModule, SharedModule], + exports: [ + TelegramSettingsComponent, + TwitterSettingsComponent, + EmailSettingsComponent, + ], +}) +export class PlatformsModule {} diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.html b/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.html new file mode 100644 index 0000000..8c8cc4c --- /dev/null +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.html @@ -0,0 +1,44 @@ + + + Telegram + + + + + + + + +
+ Telegramdummy + + +
+ +
+
+ + + + + +
+
diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.scss b/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.scss new file mode 100644 index 0000000..b76aeea --- /dev/null +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.scss @@ -0,0 +1,6 @@ +.entry { + display: grid; + grid-template-columns: 4fr 40px 20px; + width: 100%; + align-items: center; +} diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.spec.ts b/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.spec.ts new file mode 100644 index 0000000..c07c68a --- /dev/null +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TelegramSettingsComponent } from './telegram-settings.component'; + +describe('TelegramSettingsComponent', () => { + let component: TelegramSettingsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [TelegramSettingsComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TelegramSettingsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.ts b/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.ts new file mode 100644 index 0000000..96b9dc6 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { TelegramService } from 'src/app/core/api'; +import { Observer, Observable } from 'rxjs'; + +@Component({ + selector: 'app-telegram-settings', + templateUrl: './telegram-settings.component.html', + styleUrls: ['./telegram-settings.component.scss'], +}) +export class TelegramSettingsComponent implements OnInit { + @Input() hoodId; + telegrams$: Observable>; + + constructor(private telegramService: TelegramService) {} + + ngOnInit(): void { + this.telegrams$ = this.telegramService.getTelegrams(this.hoodId); + } +} diff --git a/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.html b/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.html new file mode 100644 index 0000000..a96e05b --- /dev/null +++ b/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.html @@ -0,0 +1,44 @@ + + + Twitter + + + + + + + + +
+ Twitterdummy + + +
+ +
+
+ + + + + +
+
diff --git a/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.scss b/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.scss new file mode 100644 index 0000000..b76aeea --- /dev/null +++ b/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.scss @@ -0,0 +1,6 @@ +.entry { + display: grid; + grid-template-columns: 4fr 40px 20px; + width: 100%; + align-items: center; +} diff --git a/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.spec.ts b/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.spec.ts new file mode 100644 index 0000000..31594a0 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TwitterSettingsComponent } from './twitter-settings.component'; + +describe('TwitterSettingsComponent', () => { + let component: TwitterSettingsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [TwitterSettingsComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TwitterSettingsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.ts b/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.ts new file mode 100644 index 0000000..209cc16 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { Observable } from 'rxjs'; +import { TwitterService } from 'src/app/core/api'; + +@Component({ + selector: 'app-twitter-settings', + templateUrl: './twitter-settings.component.html', + styleUrls: ['./twitter-settings.component.scss'], +}) +export class TwitterSettingsComponent implements OnInit { + @Input() hoodId; + twitters$: Observable>; + + constructor(private twitterService: TwitterService) {} + + ngOnInit(): void { + this.twitters$ = this.twitterService.getTwitters(this.hoodId); + } +} diff --git a/kibicara-frontend/src/app/shared/material/material.module.ts b/kibicara-frontend/src/app/shared/material/material.module.ts index 1864ac5..53ca395 100644 --- a/kibicara-frontend/src/app/shared/material/material.module.ts +++ b/kibicara-frontend/src/app/shared/material/material.module.ts @@ -10,6 +10,7 @@ import { MatListModule } from '@angular/material/list'; import { MatInputModule } from '@angular/material/input'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; @NgModule({ declarations: [], @@ -25,6 +26,7 @@ import { MatSnackBarModule } from '@angular/material/snack-bar'; MatInputModule, MatDialogModule, MatSnackBarModule, + MatSlideToggleModule, ], exports: [ MatButtonModule, @@ -38,6 +40,7 @@ import { MatSnackBarModule } from '@angular/material/snack-bar'; MatInputModule, MatDialogModule, MatSnackBarModule, + MatSlideToggleModule, ], }) export class MaterialModule {}