diff --git a/src/ClientApp/angular.json b/src/ClientApp/angular.json index 915c264..b4ecedd 100644 --- a/src/ClientApp/angular.json +++ b/src/ClientApp/angular.json @@ -20,9 +20,7 @@ "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.app.json", - "assets": [ - "src/assets" - ], + "assets": ["src/assets"], "styles": [ "node_modules/@fortawesome/fontawesome-free/css/all.min.css", "src/styles.scss" @@ -66,32 +64,11 @@ "browserTarget": "VotRomania:build" } }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "main": "src/test.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "src/tsconfig.spec.json", - "karmaConfig": "src/karma.conf.js", - "styles": [ - "src/styles.scss" - ], - "scripts": [], - "assets": [ - "src/assets" - ] - } - }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { - "tsConfig": [ - "src/tsconfig.app.json", - "src/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] + "tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"], + "exclude": ["**/node_modules/**"] } }, "server": { @@ -121,28 +98,6 @@ } } } - }, - "VotRomania-e2e": { - "root": "e2e/", - "projectType": "application", - "architect": { - "e2e": { - "builder": "@angular-devkit/build-angular:protractor", - "options": { - "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "VotRomania:serve" - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": "e2e/tsconfig.e2e.json", - "exclude": [ - "**/node_modules/**" - ] - } - } - } } }, "defaultProject": "VotRomania", diff --git a/src/ClientApp/e2e/protractor.conf.js b/src/ClientApp/e2e/protractor.conf.js deleted file mode 100644 index d60eff0..0000000 --- a/src/ClientApp/e2e/protractor.conf.js +++ /dev/null @@ -1,28 +0,0 @@ -// Protractor configuration file, see link for more information -// https://github.com/angular/protractor/blob/master/lib/config.ts - -const { SpecReporter } = require("jasmine-spec-reporter"); - -exports.config = { - allScriptsTimeout: 11000, - specs: ["./src/**/*.e2e-spec.ts"], - capabilities: { - browserName: "chrome" - }, - directConnect: true, - baseUrl: "http://localhost:4200/", - framework: "jasmine", - jasmineNodeOpts: { - showColors: true, - defaultTimeoutInterval: 30000, - print: function() {} - }, - onPrepare() { - require("ts-node").register({ - project: require("path").join(__dirname, "./tsconfig.e2e.json") - }); - jasmine - .getEnv() - .addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); - } -}; diff --git a/src/ClientApp/e2e/src/app.e2e-spec.ts b/src/ClientApp/e2e/src/app.e2e-spec.ts deleted file mode 100644 index 5b3b4b2..0000000 --- a/src/ClientApp/e2e/src/app.e2e-spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { AppPage } from './app.po'; - -describe('App', () => { - let page: AppPage; - - beforeEach(() => { - page = new AppPage(); - }); - - it('should display welcome message', () => { - page.navigateTo(); - expect(page.getMainHeading()).toEqual('Hello, world!'); - }); -}); diff --git a/src/ClientApp/e2e/src/app.po.ts b/src/ClientApp/e2e/src/app.po.ts deleted file mode 100644 index 24bc8b3..0000000 --- a/src/ClientApp/e2e/src/app.po.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { browser, by, element } from 'protractor'; - -export class AppPage { - navigateTo() { - return browser.get('/'); - } - - getMainHeading() { - return element(by.css('app-root h1')).getText(); - } -} diff --git a/src/ClientApp/e2e/tsconfig.e2e.json b/src/ClientApp/e2e/tsconfig.e2e.json deleted file mode 100644 index a6dd622..0000000 --- a/src/ClientApp/e2e/tsconfig.e2e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/app", - "module": "commonjs", - "target": "es5", - "types": [ - "jasmine", - "jasminewd2", - "node" - ] - } -} \ No newline at end of file diff --git a/src/ClientApp/package.json b/src/ClientApp/package.json index 348b93d..becbe7d 100644 --- a/src/ClientApp/package.json +++ b/src/ClientApp/package.json @@ -6,9 +6,7 @@ "start": "ng serve", "build": "ng build --prod", "build:watch": "ng build --watch", - "test": "ng test", - "lint": "ng lint", - "e2e": "ng e2e" + "lint": "ng lint" }, "private": true, "dependencies": { @@ -42,23 +40,13 @@ "@angular/cli": "8.3.14", "@angular/compiler-cli": "8.2.12", "@angular/language-service": "8.2.12", - "@types/jasmine": "~3.4.4", - "@types/jasminewd2": "~2.0.8", "@types/lodash": "^4.14.150", "@types/node": "~12.11.6", "codelyzer": "^5.2.0", - "jasmine-core": "~3.5.0", - "jasmine-spec-reporter": "~4.2.1", - "karma": "^4.4.1", - "karma-chrome-launcher": "~3.1.0", - "karma-coverage-istanbul-reporter": "~2.1.0", - "karma-jasmine": "~2.0.1", - "karma-jasmine-html-reporter": "^1.4.2", "typescript": "3.5.3" }, "optionalDependencies": { "node-sass": "^4.12.0", - "protractor": "~5.4.2", "ts-node": "~8.4.1", "tslint": "~5.20.0" } diff --git a/src/ClientApp/src/app/about/about.component.html b/src/ClientApp/src/app/about/about.component.html deleted file mode 100644 index 48dd0fa..0000000 --- a/src/ClientApp/src/app/about/about.component.html +++ /dev/null @@ -1,43 +0,0 @@ - -
-

{{ 'about.title' | translate }}

-
-

- {{ 'about.p1' | translate }} -

-

- {{ 'about.p2' | translate }} -

-

- {{ 'about.p3' | translate }} -

-

- {{ 'about.p4.1' | translate }} Civic Labs, {{ 'about.p4.2' | translate }} -

-

- {{ 'about.p5.1' | translate }} știrioficiale.ro, rohelp.ro, redirectioneaza.ro - {{ 'about.p5.2' | translate }}. -

-
-
-
-
-

{{ 'about.p6' | translate }}

- Civic Labs -
-
-

{{ 'about.p7' | translate }}

- Code4Romania -
-
-

{{ 'about.p8' | translate }}

- Observator -
-
-
-
-
- - \ No newline at end of file diff --git a/src/ClientApp/src/app/about/about.component.scss b/src/ClientApp/src/app/about/about.component.scss deleted file mode 100644 index 98ce5e9..0000000 --- a/src/ClientApp/src/app/about/about.component.scss +++ /dev/null @@ -1,34 +0,0 @@ -.title { - margin-top: 80px; - margin-bottom: 40px; -} - -.about { - p { - font-size: 16px; - line-height: 24px; - } -} - -.contributors { - margin-top: 80px; - margin-bottom: 80px; - - display: flex; - justify-content: space-around; - flex-direction: row; - - p { - margin-bottom: 24px; - } -} - -@media screen and (max-width: 575px) { - .contributors { - flex-direction: column; - .contributor { - margin-bottom: 40px; - margin-left: 40px; - } - } -} diff --git a/src/ClientApp/src/app/about/about.component.ts b/src/ClientApp/src/app/about/about.component.ts deleted file mode 100644 index 9a3c389..0000000 --- a/src/ClientApp/src/app/about/about.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-about', - templateUrl: './about.component.html', - styleUrls: ['./about.component.scss'] -}) -export class AboutComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/ClientApp/src/app/app.module.ts b/src/ClientApp/src/app/app.module.ts index 357fb8c..e65fb51 100644 --- a/src/ClientApp/src/app/app.module.ts +++ b/src/ClientApp/src/app/app.module.ts @@ -1,44 +1,30 @@ -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { HttpClientModule, HttpClient } from '@angular/common/http'; -import { RouterModule, Routes } from '@angular/router'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { NgModule } from "@angular/core"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { HttpClientModule, HttpClient } from "@angular/common/http"; +import { RouterModule, Routes } from "@angular/router"; +import { MatAutocompleteModule } from "@angular/material/autocomplete"; -import { EffectsModule } from '@ngrx/effects'; -import { ApplicationEffects } from './state/effects'; -import { AppComponent } from './app.component'; -import { NavMenuComponent } from './nav-menu/nav-menu.component'; -import { HomeComponent } from './home/home.component'; -import { GeneralInfoComponent } from './general-info/general-info.component'; -import { VotersGuideComponent } from './voters-guide/voters-guide.component'; -import { FooterComponent } from './footer/footer.component'; -import { StoreModule } from '@ngrx/store'; -import { appStateReducer } from './state/reducers'; -import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; -import { CollapseModule } from 'ngx-bootstrap/collapse'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ShareCardComponent } from './share-card/share-card.component'; -import { DonateCardComponent } from './donate-card/donate-card.component'; -import { PollingStationCardInfoComponent } from './polling-station-card-info/polling-station-card-info.component'; -import { PollingStationSearchComponent } from './polling-station-search/polling-station-search.component'; -// import { HereAddressService } from './services/here-address.service'; -import { DataService } from './services/data.service'; -import { AboutComponent } from './about/about.component'; -import { CookiePolicyComponent } from './cookie-policy/cookie-policy.component'; -import { AdminModule } from './admin/admin.module'; -import { TranslateHttpLoader } from '@ngx-translate/http-loader'; -import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; -import { JoinTranslationsPipe } from './join-translations.pipe'; -import { VotRomaniaComponent } from './vot-romania/vot.romania.component'; -import { MapNoteComponent } from './map-note/map.note.component'; +import { EffectsModule } from "@ngrx/effects"; +import { ApplicationEffects } from "./state/effects"; +import { AppComponent } from "./app.component"; +import { NavMenuComponent } from "./nav-menu/nav-menu.component"; +import { FooterComponent } from "./footer/footer.component"; +import { StoreModule } from "@ngrx/store"; +import { appStateReducer } from "./state/reducers"; +import { BsDropdownModule } from "ngx-bootstrap/dropdown"; +import { CollapseModule } from "ngx-bootstrap/collapse"; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { DataService } from "./services/data.service"; +import { AdminModule } from "./admin/admin.module"; +import { TranslateHttpLoader } from "@ngx-translate/http-loader"; +import { TranslateModule, TranslateLoader } from "@ngx-translate/core"; +import { JoinTranslationsPipe } from "./join-translations.pipe"; const appRoutes: Routes = [ - { path: '', component: HomeComponent, pathMatch: 'full' }, - { path: 'about', component: AboutComponent }, - { path: 'cookies-policy', component: CookiePolicyComponent }, { - path: 'admin', - loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule) + path: "admin", + loadChildren: () => + import("./admin/admin.module").then((m) => m.AdminModule), }, ]; @@ -46,19 +32,8 @@ const appRoutes: Routes = [ declarations: [ AppComponent, NavMenuComponent, - HomeComponent, - GeneralInfoComponent, - VotersGuideComponent, FooterComponent, - ShareCardComponent, - DonateCardComponent, - PollingStationCardInfoComponent, - PollingStationSearchComponent, - AboutComponent, - CookiePolicyComponent, JoinTranslationsPipe, - VotRomaniaComponent, - MapNoteComponent, ], imports: [ BrowserAnimationsModule, @@ -74,20 +49,16 @@ const appRoutes: Routes = [ MatAutocompleteModule, TranslateModule.forRoot({ loader: { - provide: TranslateLoader, - useFactory: HttpLoaderFactory, - deps: [HttpClient] - } - }) + provide: TranslateLoader, + useFactory: HttpLoaderFactory, + deps: [HttpClient], + }, + }), ], - providers: [ - // HereAddressService, - DataService - ], - bootstrap: [AppComponent] + providers: [DataService], + bootstrap: [AppComponent], }) -export class AppModule { } - +export class AppModule {} // required for AOT compilation export function HttpLoaderFactory(http: HttpClient) { diff --git a/src/ClientApp/src/app/cookie-policy/cookie-policy.component.html b/src/ClientApp/src/app/cookie-policy/cookie-policy.component.html deleted file mode 100644 index 55211a9..0000000 --- a/src/ClientApp/src/app/cookie-policy/cookie-policy.component.html +++ /dev/null @@ -1,106 +0,0 @@ -
-

{{ 'cookie.title' | translate }}

-

{{ 'cookie.p1' | translate }}

- -

{{ 'cookie.p2' | translate }}

- -

{{ 'cookie.subt1' | translate }}

-

{{ 'cookie.p3' | translate }}

- -

{{ 'cookie.p4' | translate }}

- -

{{ 'cookie.p5' | translate }}

- -

{{ 'cookie.p6' | translate }}

- -

{{ 'cookie.p7' | translate }}

- -

{{ 'cookie.subt2' | translate }}

-

{{ 'cookie.p8' | translate }}

- -

{{ 'cookie.subt3' | translate }}

-

{{ 'cookie.p9' | translate }}

- -

{{ 'cookie.subt4' | translate }}

-

{{ 'cookie.p10' | translate }}

- -

{{ 'cookie.subt5' | translate }}

-

{{ 'cookie.p11' | translate }}

- - -

{{ 'cookie.subt6' | translate }}

-

{{ 'cookie.p12' | translate }}

- -

{{ 'cookie.subt7' | translate }}

-

{{ 'cookie.p13' | translate }}

- -

{{ 'cookie.subt8' | translate }}

-

{{ 'cookie.p14' | translate }}

- -

{{ 'cookie.subt9' | translate }}

-

- {{ 'cookie.p15' | translate }} -

- -

{{ 'cookie.subt10' | translate }}

-

{{ 'cookie.p16' | translate }}

- -

{{ 'cookie.subt11' | translate }}

-

{{ 'cookie.p17' | translate }}

- -

{{ 'cookie.p18' | translate }}

- -

{{ 'cookie.subt12' | translate }}

-

{{ 'cookie.p19' | translate }}

- -

- {{ 'cookie.p20' | translate }} -

- -

{{ 'cookie.p21' | translate }}

- -

{{ 'cookie.subt13' | translate }}

-

{{ 'cookie.p22' | translate }}

- -

{{ 'cookie.p23' | translate }}

- -

{{ 'cookie.subt14' | translate }}

-

{{ 'cookie.p24' | translate }}

- -

{{ 'cookie.subt15' | translate }}

-

{{ 'cookie.p25' | translate }} -

- -

{{ 'cookie.p26' | translate }}

- -

{{ 'cookie.p27' | translate }}

- -

{{ 'cookie.p28' | translate }}

- -
\ No newline at end of file diff --git a/src/ClientApp/src/app/cookie-policy/cookie-policy.component.scss b/src/ClientApp/src/app/cookie-policy/cookie-policy.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/ClientApp/src/app/cookie-policy/cookie-policy.component.ts b/src/ClientApp/src/app/cookie-policy/cookie-policy.component.ts deleted file mode 100644 index ebfdf47..0000000 --- a/src/ClientApp/src/app/cookie-policy/cookie-policy.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-cookie-policy', - templateUrl: './cookie-policy.component.html', - styleUrls: ['./cookie-policy.component.scss'] -}) -export class CookiePolicyComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/ClientApp/src/app/donate-card/donate-card.component.html b/src/ClientApp/src/app/donate-card/donate-card.component.html deleted file mode 100644 index 783811a..0000000 --- a/src/ClientApp/src/app/donate-card/donate-card.component.html +++ /dev/null @@ -1,12 +0,0 @@ -
-
-
-
-

{{ 'donate_card.title' | translate }}

-

{{ 'donate_card.text' | translate }}

- -
-
-
-
- diff --git a/src/ClientApp/src/app/donate-card/donate-card.component.scss b/src/ClientApp/src/app/donate-card/donate-card.component.scss deleted file mode 100644 index 88e3e0f..0000000 --- a/src/ClientApp/src/app/donate-card/donate-card.component.scss +++ /dev/null @@ -1,8 +0,0 @@ -.donate-link-button { - color: #FFF; - background-color: #4DCB79; -} - -.box-dark { - background: #352245; -} diff --git a/src/ClientApp/src/app/donate-card/donate-card.component.ts b/src/ClientApp/src/app/donate-card/donate-card.component.ts deleted file mode 100644 index 2684ec8..0000000 --- a/src/ClientApp/src/app/donate-card/donate-card.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-donate-card', - templateUrl: './donate-card.component.html', - styleUrls: ['./donate-card.component.scss'] -}) -export class DonateCardComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/ClientApp/src/app/general-info/general-info.component.html b/src/ClientApp/src/app/general-info/general-info.component.html deleted file mode 100644 index c1cc6c6..0000000 --- a/src/ClientApp/src/app/general-info/general-info.component.html +++ /dev/null @@ -1,8 +0,0 @@ -
- -

- {{ 'introduction' | translate }} -

-
\ No newline at end of file diff --git a/src/ClientApp/src/app/general-info/general-info.component.scss b/src/ClientApp/src/app/general-info/general-info.component.scss deleted file mode 100644 index e81ba98..0000000 --- a/src/ClientApp/src/app/general-info/general-info.component.scss +++ /dev/null @@ -1,16 +0,0 @@ -.wrapper { - background: #352245; - display: flex; - align-items: center; - flex-direction: column; - - .logo{ - margin-top: 30px; - } - - p { - color: white; - font-style: normal; - font-weight: normal; - } -} diff --git a/src/ClientApp/src/app/general-info/general-info.component.ts b/src/ClientApp/src/app/general-info/general-info.component.ts deleted file mode 100644 index 6fd0465..0000000 --- a/src/ClientApp/src/app/general-info/general-info.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Observable } from 'rxjs'; -import { ApplicationState } from '../state/reducers'; -import { Store, select } from '@ngrx/store'; -import { getGeneralInfo } from '../state/selectors'; - -@Component({ - selector: 'app-general-info', - templateUrl: './general-info.component.html', - styleUrls: ['./general-info.component.scss'] -}) -export class GeneralInfoComponent implements OnInit { - message$: Observable; - constructor(private store: Store) { } - - ngOnInit() { - this.message$ = this.store.pipe(select(getGeneralInfo)); - } - -} diff --git a/src/ClientApp/src/app/home/home.component.html b/src/ClientApp/src/app/home/home.component.html deleted file mode 100644 index 79507bf..0000000 --- a/src/ClientApp/src/app/home/home.component.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - -
-

{{ 'map-title' | translate }}

-

-
- - - - diff --git a/src/ClientApp/src/app/home/home.component.scss b/src/ClientApp/src/app/home/home.component.scss deleted file mode 100644 index 4102fb6..0000000 --- a/src/ClientApp/src/app/home/home.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.title { - color: #352245; -} \ No newline at end of file diff --git a/src/ClientApp/src/app/home/home.component.ts b/src/ClientApp/src/app/home/home.component.ts deleted file mode 100644 index e28c13b..0000000 --- a/src/ClientApp/src/app/home/home.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-home', - templateUrl: './home.component.html', - styleUrls: ['./home.component.scss'], -}) -export class HomeComponent { -} diff --git a/src/ClientApp/src/app/map-note/map.note.component.html b/src/ClientApp/src/app/map-note/map.note.component.html deleted file mode 100644 index b01f3e9..0000000 --- a/src/ClientApp/src/app/map-note/map.note.component.html +++ /dev/null @@ -1,5 +0,0 @@ -
-
- {{ 'map_outro' | translate }} -
-
\ No newline at end of file diff --git a/src/ClientApp/src/app/map-note/map.note.component.scss b/src/ClientApp/src/app/map-note/map.note.component.scss deleted file mode 100644 index 5c2a7cf..0000000 --- a/src/ClientApp/src/app/map-note/map.note.component.scss +++ /dev/null @@ -1,7 +0,0 @@ -.box-dark { - background: #352245; -} - -.vot-romania-reminder { - font-size: 20px; -} diff --git a/src/ClientApp/src/app/map-note/map.note.component.ts b/src/ClientApp/src/app/map-note/map.note.component.ts deleted file mode 100644 index 2515c70..0000000 --- a/src/ClientApp/src/app/map-note/map.note.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-map-note', - templateUrl: './map.note.component.html', - styleUrls: ['./map.note.component.scss'], -}) -export class MapNoteComponent { -} diff --git a/src/ClientApp/src/app/polling-station-card-info/polling-station-card-info.component.html b/src/ClientApp/src/app/polling-station-card-info/polling-station-card-info.component.html deleted file mode 100644 index 70654c5..0000000 --- a/src/ClientApp/src/app/polling-station-card-info/polling-station-card-info.component.html +++ /dev/null @@ -1,8 +0,0 @@ -
- -

{{pollingStation.pollingStationNumber}}, {{pollingStation.county}}

-
Adresa: {{pollingStation.address}}
- -
diff --git a/src/ClientApp/src/app/polling-station-card-info/polling-station-card-info.component.scss b/src/ClientApp/src/app/polling-station-card-info/polling-station-card-info.component.scss deleted file mode 100644 index 34eb735..0000000 --- a/src/ClientApp/src/app/polling-station-card-info/polling-station-card-info.component.scss +++ /dev/null @@ -1,75 +0,0 @@ -$color-light: #ffcc00; -$color-dark: #352245; - -p { - font-size: 1rem; -} - -.address { - font-size: 18px; -} - -.box { - padding-left: 30px; - padding-right: 30px; - padding-top: 10px; - padding-bottom: 10px; - - - &.box-dark { - background: $color-dark; - color: white; - font-size: 16px; - - & hr { - border-top-color: #FFFFFF; - } - - & .badge { - background: $color-light; - color: $color-dark; - font-size: 14px; - } - - & .address, .btn.btn-link{ - color: $color-light; - } - } - - &.box-light { - background: $color-light; - color: $color-dark; - - & hr { - border-top-color: $color-dark; - } - - & .badge { - background: $color-dark; - color: white; - } - } -} - -.badge { - border-radius: 0; - font-weight:500; -} - -a.btn.btn-link:not(href) { - text-decoration: underline; -} - -ul { - list-style-type: none; - padding-left: 0; - - & > li { - font-size: large; - - &:before { - content: "-"; - margin-right: 0.5rem; - } - } -} diff --git a/src/ClientApp/src/app/polling-station-card-info/polling-station-card-info.component.ts b/src/ClientApp/src/app/polling-station-card-info/polling-station-card-info.component.ts deleted file mode 100644 index 778b5bb..0000000 --- a/src/ClientApp/src/app/polling-station-card-info/polling-station-card-info.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { PollingStation } from '../services/data.service'; - -@Component({ - selector: 'app-polling-station-card-info', - templateUrl: './polling-station-card-info.component.html', - styleUrls: ['./polling-station-card-info.component.scss'] -}) -export class PollingStationCardInfoComponent { - isCollapsed = true; - @Input() lightTheme: boolean; - @Input() pollingStation: PollingStation; - @Input() distance: number; -} diff --git a/src/ClientApp/src/app/polling-station-search/polling-station-search.component.html b/src/ClientApp/src/app/polling-station-search/polling-station-search.component.html deleted file mode 100644 index c9b202a..0000000 --- a/src/ClientApp/src/app/polling-station-search/polling-station-search.component.html +++ /dev/null @@ -1,37 +0,0 @@ -
-
-
-
- -
- -
- - - {{address.label}} - - -
-
-
- -
- -
-

Conform listei de secții de la alegerile din 2019 (vom aduce informațiile la zi imediat ce vor fi comunicate oficial) cele mai apropiate secții de vot de tine sunt:

-
- -
- - -
-
- -
-
-
\ No newline at end of file diff --git a/src/ClientApp/src/app/polling-station-search/polling-station-search.component.scss b/src/ClientApp/src/app/polling-station-search/polling-station-search.component.scss deleted file mode 100644 index 9b405b3..0000000 --- a/src/ClientApp/src/app/polling-station-search/polling-station-search.component.scss +++ /dev/null @@ -1,115 +0,0 @@ -.search-input { - width: 45%; - min-width: 450px; - margin-bottom: 80px; -} - -.centered-items { - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; -} - -.title-block{ - margin-bottom: 32px; - - .question{ - margin-bottom: 24px; - } -} - -.map { - height: 596px; - width: 100%; - margin-bottom: 80px; -} - -@media screen and (max-width: 575px) { - .search-input { - width: 90%; - min-width: 90%; - } - - .map { - height: 70vh; - } -} - -@media screen and (max-height: 575px) { - .map { - height: 70vh; - } -} - -.ps-card { - width: 472px; - - .ps-title { - font-family: "Titillium Web"; - font-style: normal; - font-weight: 600; - font-size: 18px; - display: flex; - align-items: center; - text-align: center; - } - - .ps-description { - font-family: 'Titillium Web'; - font-style: normal; - font-weight: 500; - font-size: 16px; - display: flex; - align-items: center; - text-align: center; - - .ps-address-label { - background: #FFCC00; - font-family: 'Titillium Web'; - font-style: normal; - font-weight: normal; - font-size: 16px; - } - } - -} - -.text-padding { - padding-bottom: 32px; -} - -.ps-list { - display: grid; - grid-template-columns: 500px 500px; - flex-direction: row; - flex-wrap: wrap; - align-items: flex-start; - flex-flow: row wrap; - justify-content: flex-start; -} - -.ps-item { - margin-bottom: 20px; - margin-left: 20px; - box-sizing: border-box; - max-width: 100%; - height: 160px; - display: block; -} - -@media screen and (max-width: 575px) { - .ps-list { - display: flex; - } - - .ps-item{ - max-width: 100%; - margin-left: 0; - height: auto; - } - - h5 { - text-align: center; - } -} diff --git a/src/ClientApp/src/app/polling-station-search/polling-station-search.component.ts b/src/ClientApp/src/app/polling-station-search/polling-station-search.component.ts deleted file mode 100644 index f1e392d..0000000 --- a/src/ClientApp/src/app/polling-station-search/polling-station-search.component.ts +++ /dev/null @@ -1,172 +0,0 @@ -import { - Component, - OnInit, - ViewChild, - ElementRef, - AfterViewInit, - OnDestroy, - ViewEncapsulation -} from '@angular/core'; -import { FormControl } from '@angular/forms'; -import { Observable, Subscription } from 'rxjs'; -import { switchMap, debounceTime, map, filter } from 'rxjs/operators'; -import { HereAddressService, AddressSuggestion, LocationDetails } from '../services/here-address.service'; -import { ApplicationState } from '../state/reducers'; -import { Store, select } from '@ngrx/store'; -import { getMapPins } from '../state/selectors'; -import { replace } from 'lodash'; -import { PollingStationGroup, PollingStation } from '../services/data.service'; -import { LoadLocations } from '../state/actions'; - -declare var H: any; -export enum PinType { - UserLocationIcon = '#efc007', - PollingStationIcon = '#119DA4' -} -@Component({ - selector: 'app-polling-station-search', - templateUrl: './polling-station-search.component.html', - styleUrls: ['./polling-station-search.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class PollingStationSearchComponent implements OnInit, AfterViewInit, OnDestroy { - private readonly svgIcon: string = ``; - private readonly userIcon = new H.map.Icon(this.getSvgMarker(PinType.UserLocationIcon)); - private readonly pollingStationIcon = new H.map.Icon(this.getSvgMarker(PinType.PollingStationIcon)); - - control = new FormControl(); - filteredAddresses: Observable; - searchText = 'Caută adresa ta pentru a afla la ce secție ești arondat'; - pollingStations: PollingStation[]; - - private platform: any; - private hereMap: any; - private mapUi: any; - private currentlyOpenedInfoBubble: any; - - - @ViewChild('map', { static: true }) - public mapElement: ElementRef; - - private subscription: Subscription; - - constructor(private addressSuggest: HereAddressService, private store: Store) { - this.platform = new H.service.Platform({ - apikey: hereMapsToken - }); - } - - ngOnInit() { - this.filteredAddresses = this.control.valueChanges.pipe( - debounceTime(300), - filter(value => typeof value === 'string'), - switchMap(value => this.addressSuggest.suggest(value)), - map(value => value.suggestions) - ); - - this.initializeMap(); - - this.store.pipe(select(getMapPins)) - .pipe(filter(data => data !== undefined && data.pollingStations !== undefined && data.userAddress !== undefined)) - .subscribe((details: { userAddress: LocationDetails, pollingStations: PollingStationGroup[] }) => { - this.clearMap(); - const { userAddress, pollingStations } = details; - - const position = userAddress.displayPosition; - const userAddressMarker = new H.map.Marker({ lat: position.latitude, lng: position.longitude }, { icon: this.userIcon }); - userAddressMarker.setData('locatia ta'); - const mapMarkers: any[] = []; - mapMarkers.push(userAddressMarker); - this.pollingStations = [].concat(...pollingStations.map(p => p.pollingStations)); - pollingStations.forEach(p => { - const pollingStationMarker = new H.map.Marker({ lat: p.latitude, lng: p.longitude }, { icon: this.pollingStationIcon }); - pollingStationMarker.setData(this.getPollingStationinfoBubble(p)); - mapMarkers.push(pollingStationMarker); - }); - - const group = new H.map.Group(); - group.addEventListener('tap', (evt) => { - // event target is the marker itself, group is a parent event target - // for all objects that it contains - const bubble = new H.ui.InfoBubble(evt.target.getGeometry(), { - // read custom data - content: evt.target.getData() - }); - this.mapUi.removeBubble(this.currentlyOpenedInfoBubble); - // show info bubble - this.mapUi.addBubble(bubble); - this.currentlyOpenedInfoBubble = bubble; - }, false); - - // add markers to the group - group.addObjects(mapMarkers); - this.hereMap.addObject(group); - - // get geo bounding box for the group and set it to the map - this.hereMap.getViewModel().setLookAtData({ - bounds: group.getBoundingBox() - }); - }); - } - - getPollingStationinfoBubble(group: PollingStationGroup): string { - return group.pollingStations.reduce((accumulator, currentValue) => - accumulator + `
-
Sectia de votare ${currentValue.pollingStationNumber}, ${currentValue.locality}
-
-

Adresa:

- ${currentValue.address}
-
` + '' - , ''); - - } - - private initializeMap() { - - const pixelRatio = window.devicePixelRatio || 1; - const defaultLayers = this.platform.createDefaultLayers({ - tileSize: pixelRatio === 1 ? 256 : 512, - ppi: pixelRatio === 1 ? undefined : 320 - }); - - this.hereMap = new H.Map(this.mapElement.nativeElement, - defaultLayers.vector.normal.map, - { - center: { lat: 45.658, lng: 25.6012 }, - zoom: 7, - pixelRatio: pixelRatio - }); - - this.mapUi = H.ui.UI.createDefault(this.hereMap, defaultLayers); - } - - private clearMap(): void { - this.hereMap.removeObjects(this.hereMap.getObjects()); - } - - ngAfterViewInit(): void { - - } - - ngOnDestroy(): void { - if (this.subscription) { - this.subscription.unsubscribe(); - } - } - - getDisplayFn() { - return (val) => this.display(val); - } - - private display(address: AddressSuggestion): string { - return address ? address.label : ''; - } - - onSelectingSuggestion(data: AddressSuggestion): void { - this.store.dispatch(new LoadLocations(data.locationId)); - } - - private getSvgMarker(pinType: PinType): string { - return replace(this.svgIcon, '%%fill%%', pinType); - } -} diff --git a/src/ClientApp/src/app/services/here-address.service.ts b/src/ClientApp/src/app/services/here-address.service.ts index a23e178..b715793 100644 --- a/src/ClientApp/src/app/services/here-address.service.ts +++ b/src/ClientApp/src/app/services/here-address.service.ts @@ -1,6 +1,6 @@ -import { Injectable } from '@angular/core'; -import { HttpClient, HttpParams } from '@angular/common/http'; -import { Observable } from 'rxjs'; +import { Injectable } from "@angular/core"; +import { HttpClient, HttpParams } from "@angular/common/http"; +import { Observable } from "rxjs"; export interface ILocationSearchResponse { suggestions: AddressSuggestion[]; @@ -91,33 +91,37 @@ export interface LocationDetailsResponse { response: LocationDetails; } -@Injectable({ providedIn: 'root' }) +@Injectable({ providedIn: "root" }) export class HereAddressService { + private readonly suggestUrl = + "https://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json"; + private readonly geocoderUrl = + "https://geocoder.ls.hereapi.com/6.2/geocode.json"; - private readonly suggestUrl = 'https://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json'; - private readonly geocoderUrl = 'https://geocoder.ls.hereapi.com/6.2/geocode.json'; - - constructor(private httpClient: HttpClient) { } + constructor(private httpClient: HttpClient) {} suggest(location: string): Observable { let params = new HttpParams(); - params = params.append('query', location); - params = params.append('maxresults', '5'); - params = params.append('apikey', hereMapsToken); + params = params.append("query", location); + params = params.append("maxresults", "5"); + params = params.append("apikey", hereMapsToken); - return this.httpClient.get(this.suggestUrl, { params: params }); + return this.httpClient.get(this.suggestUrl, { + params: params, + }); } getLocationDetails(locationId: string): Observable { let params = new HttpParams(); - params = params.append('locationid', locationId); - params = params.append('jsonattributes', '1'); - params = params.append('gen', '1'); - params = params.append('apikey', hereMapsToken); + params = params.append("locationid", locationId); + params = params.append("jsonattributes", "1"); + params = params.append("gen", "1"); + params = params.append("apikey", hereMapsToken); - return this.httpClient.get(this.geocoderUrl, { params: params }); + return this.httpClient.get(this.geocoderUrl, { + params: params, + }); } - } diff --git a/src/ClientApp/src/app/services/voters-decision-tree.service.ts b/src/ClientApp/src/app/services/voters-decision-tree.service.ts deleted file mode 100644 index 757107d..0000000 --- a/src/ClientApp/src/app/services/voters-decision-tree.service.ts +++ /dev/null @@ -1,182 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Observable, of, BehaviorSubject, combineLatest } from 'rxjs'; -import { catchError, shareReplay, filter, map, mapTo } from 'rxjs/operators'; - -export interface OperatorDecisionTree { - [key: string]: OperatorTreeNode; - initial: Required>; - error?: any; -} - -export interface OperatorTreeNode { - id: string; - label?: string; - options?: string[]; - votersOptionId?: number; - text?: string; -} - -export interface OperatorTreeNodeWithOptions extends OperatorTreeNode { - options: string[]; -} - -export function isInitialDecision(previousBranchIds: string[]): boolean { - return ( - previousBranchIds.includes('initial') && previousBranchIds.length === 1 - ); -} - -export function treeIsErrorFree(tree): boolean { - return !tree.error; -} - -export function nodeHasOptions(node): node is OperatorTreeNodeWithOptions { - return !!node.options; -} - -export interface State { - previousBranchIds: string[]; - currentBranchId: string; -} - - -@Injectable({ - providedIn: 'root' -}) -export class VotersDecisionTreeService { - - constructor() { } - - private get snapShot(): State { - return this.state$.getValue(); - } - - private initialState: State = { - previousBranchIds: ['initial'], - currentBranchId: 'initial' - }; - private state$ = new BehaviorSubject(this.initialState); - private tree$: Observable< - OperatorDecisionTree - > = this.getDecisionTree$().pipe( - catchError(error => of(error)), // This helps if the JSON for some reason fails to get fetched - shareReplay() - ); - - currentSentence$: Observable = combineLatest( - this.tree$, - this.state$ - ).pipe( - filter(([tree]) => treeIsErrorFree(tree)), - map(([tree, { previousBranchIds }]) => { - const value = isInitialDecision(previousBranchIds) - ? ['votersGuide.callToAction'] - : previousBranchIds - .map(entityId => { - return tree[entityId].label; - }) - .filter(val => val); - - return value; - } - ) - ); - - options$: Observable<(OperatorTreeNode)[]> = combineLatest( - this.tree$, - this.state$ - ).pipe( - filter(([tree, state]) => { - return ( - treeIsErrorFree(tree) && - !!tree[state.currentBranchId] && - !!tree[state.currentBranchId].options - ); - }), - map(([tree, state]) => { - // Project is currently using TypeScript 2.9.2 - // With TS 3.1+ this can be done better if we map to [tree, node] and typeguard with a tuple in a filter - // filter((a): a is [OperatorDecisionTree, OperatorTreeNodeWithOptions] => !a[0].error && !!a[1].options) - const node = tree[state.currentBranchId]; - return nodeHasOptions(node) - ? node.options.map(option => tree[option]) - : tree['initial'].options.map(option => tree[option]); - }) - ); - - isBeyondInitialQuestion$: Observable = this.state$.pipe( - map(({ currentBranchId }) => currentBranchId !== 'initial') - ); - - // This helps if the JSON for some reason fails to get fetched - hasError$ = this.tree$.pipe( - filter(tree => !!tree.error), - mapTo(true) - ); - - - getDecisionTree$(): Observable { - const data: OperatorDecisionTree = { - 'initial': { - id: 'initial', - options: [ - '0', - '1' - ] - }, - '0': { - id: '0', - label: 'votersGuide.label0', - options: [ - '00', - ] - }, - '1': { - id: '1', - label: 'votersGuide.label1', - options: [ - '10', - ] - }, - '00': { - id: '00', - text: 'votersGuide.label00' - }, - '10': { - id: '10', - text: 'votersGuide.label10' - } - }; - - return of(data); - } - - selectOption(optionId: string): void { - this.state$.next({ - previousBranchIds: [...this.snapShot.previousBranchIds, optionId], - currentBranchId: optionId - }); - } - - back(): void { - const previousOptionId = this.snapShot.previousBranchIds[ - this.snapShot.previousBranchIds.length - 2 - ]; - - if (previousOptionId) { - this.state$.next({ - previousBranchIds: [ - ...this.snapShot.previousBranchIds.slice( - 0, - this.snapShot.previousBranchIds.length - 1 - ) - ], - currentBranchId: previousOptionId - }); - } - } - - startOver(): void { - this.state$.next(this.initialState); - } -} diff --git a/src/ClientApp/src/app/share-card/share-card.component.html b/src/ClientApp/src/app/share-card/share-card.component.html deleted file mode 100644 index d43f2f2..0000000 --- a/src/ClientApp/src/app/share-card/share-card.component.html +++ /dev/null @@ -1,25 +0,0 @@ -
-
-
-
-

{{ 'social_share.title' | translate }}

-

{{ 'social_share.text' | translate }}

- -
-
-
-
- diff --git a/src/ClientApp/src/app/share-card/share-card.component.scss b/src/ClientApp/src/app/share-card/share-card.component.scss deleted file mode 100644 index e711ed8..0000000 --- a/src/ClientApp/src/app/share-card/share-card.component.scss +++ /dev/null @@ -1,51 +0,0 @@ -.box-dark { - background: #352245; -} - -.share-actions { - - .share-cta { - margin: 0 10px 10px 0; - color: #fff; - text-align: center; - padding: 0; - width: 70px; - font-weight: 700; - display: inline-block; - height: 70px; - line-height: 70px; - - &.fb { - background: #3b5998; - } - - &.tw { - background: #1da1f2; - } - - &.email { - background: #fff; - color: #352245; - } - - &:hover, - &:focus { - background: #fc0; - color: #fff; - text-decoration: none; - } - } -} - - -@media screen and (max-width: 575px) { - .share-actions { - display: flex; - justify-content: space-between; - - .share-cta { - width: 31%; - margin: 0; - } - } -} diff --git a/src/ClientApp/src/app/share-card/share-card.component.ts b/src/ClientApp/src/app/share-card/share-card.component.ts deleted file mode 100644 index 24242f2..0000000 --- a/src/ClientApp/src/app/share-card/share-card.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-share-card', - templateUrl: './share-card.component.html', - styleUrls: ['./share-card.component.scss'] -}) -export class ShareCardComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/ClientApp/src/app/state/effects.ts b/src/ClientApp/src/app/state/effects.ts index 6002de6..ca5b8e6 100644 --- a/src/ClientApp/src/app/state/effects.ts +++ b/src/ClientApp/src/app/state/effects.ts @@ -1,81 +1,88 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; import { - LoadDataDoneAction, - LoadErrorAction, - ActionTypes, - LoadLocationDone, - LoadLocationError, - LoadLocations, - UpdateDataAction, - UpdateDataDoneAction, - UpdateDataErrorAction -} from './actions'; -import { Observable, of } from 'rxjs'; -import { mergeMap, map, catchError, switchMap, tap } from 'rxjs/operators'; -import { Action } from '@ngrx/store'; -import { Actions, Effect, ofType } from '@ngrx/effects'; -import { DataService } from '../services/data.service'; -import { HereAddressService } from '../services/here-address.service'; + LoadDataDoneAction, + LoadErrorAction, + ActionTypes, + LoadLocationDone, + LoadLocationError, + LoadLocations, + UpdateDataAction, + UpdateDataDoneAction, + UpdateDataErrorAction, +} from "./actions"; +import { Observable, of } from "rxjs"; +import { mergeMap, map, catchError, switchMap, tap } from "rxjs/operators"; +import { Action } from "@ngrx/store"; +import { Actions, Effect, ofType } from "@ngrx/effects"; +import { DataService } from "../services/data.service"; +import { HereAddressService } from "../services/here-address.service"; -import { Router } from '@angular/router'; +import { Router } from "@angular/router"; -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: "root" }) export class ApplicationEffects { + constructor( + private dataService: DataService, + private addressService: HereAddressService, + private router: Router, + private actions$: Actions + ) {} - constructor(private dataService: DataService, - private addressService: HereAddressService, - private router: Router, - private actions$: Actions) { - } + @Effect() + loadData$: Observable = this.actions$.pipe( + ofType(ActionTypes.LOAD_DATA, ActionTypes.UPDATE_DATA_DONE), + mergeMap(() => + this.dataService.getData().pipe( + map((data) => new LoadDataDoneAction(data)), + catchError((err) => of(new LoadErrorAction(err))) + ) + ) + ); - @Effect() - loadData$: Observable = this.actions$.pipe( - ofType(ActionTypes.LOAD_DATA, ActionTypes.UPDATE_DATA_DONE), - mergeMap(() => - this.dataService.getData().pipe( - map(data => (new LoadDataDoneAction(data))), - catchError(err => of(new LoadErrorAction(err))) - ) - ) - ); + @Effect() + updateData$: Observable = this.actions$.pipe( + ofType(ActionTypes.UPDATE_DATA), + mergeMap((action: UpdateDataAction) => + this.dataService.updateData(action.payload.data).pipe( + map(() => new UpdateDataDoneAction()), + catchError((err) => of(new UpdateDataErrorAction(err))) + ) + ) + ); - @Effect() - updateData$: Observable = this.actions$.pipe( - ofType(ActionTypes.UPDATE_DATA), - mergeMap((action: UpdateDataAction) => - this.dataService.updateData(action.payload.data).pipe( - map(() => (new UpdateDataDoneAction())), - catchError(err => of(new UpdateDataErrorAction(err)) - ) - ) - ) - ); + @Effect({ dispatch: false }) + updateDataSuccessful$: Observable = this.actions$.pipe( + ofType(ActionTypes.UPDATE_DATA_DONE), + tap(() => { + this.router.navigate(["admin"]); + }) + ); - @Effect({dispatch: false}) - updateDataSuccessful$: Observable = this.actions$.pipe( - ofType(ActionTypes.UPDATE_DATA_DONE), - tap(() => { - this.router.navigate(['admin']); - }) - ); + @Effect() + getUserTypeUserPermissions$: Observable = this.actions$.pipe( + ofType(ActionTypes.LOAD_LOCATIONS), - @Effect() - getUserTypeUserPermissions$: Observable = this.actions$.pipe( - ofType(ActionTypes.LOAD_LOCATIONS), - - switchMap((action) => this.addressService.getLocationDetails(action.locationId)), - switchMap((userLocation) => { - const {displayPosition} = userLocation.response.view[0].result[0].location; - return this.dataService.getPollingStations(displayPosition.latitude, displayPosition.longitude).pipe(map(result => { - return { - userLocation: userLocation.response.view[0].result[0].location, - pollingStations: result - }; - })); - }), - map((res) => { - return new LoadLocationDone(res.userLocation, res.pollingStations); - }), - catchError(error => of(new LoadLocationError(error))) - ); + switchMap((action) => + this.addressService.getLocationDetails(action.locationId) + ), + switchMap((userLocation) => { + const { + displayPosition, + } = userLocation.response.view[0].result[0].location; + return this.dataService + .getPollingStations(displayPosition.latitude, displayPosition.longitude) + .pipe( + map((result) => { + return { + userLocation: userLocation.response.view[0].result[0].location, + pollingStations: result, + }; + }) + ); + }), + map((res) => { + return new LoadLocationDone(res.userLocation, res.pollingStations); + }), + catchError((error) => of(new LoadLocationError(error))) + ); } diff --git a/src/ClientApp/src/app/vot-romania/vot.romania.component.html b/src/ClientApp/src/app/vot-romania/vot.romania.component.html deleted file mode 100644 index 04ba232..0000000 --- a/src/ClientApp/src/app/vot-romania/vot.romania.component.html +++ /dev/null @@ -1,9 +0,0 @@ -
-
- {{ 'vot_romania' | translate }} -
- -
\ No newline at end of file diff --git a/src/ClientApp/src/app/vot-romania/vot.romania.component.scss b/src/ClientApp/src/app/vot-romania/vot.romania.component.scss deleted file mode 100644 index 1157793..0000000 --- a/src/ClientApp/src/app/vot-romania/vot.romania.component.scss +++ /dev/null @@ -1,11 +0,0 @@ -.box-light { - background: #FFCC00; -} - -.vot-romania-reminder { - font-size: 20px; -} - -.cta { - background: #352245; -} diff --git a/src/ClientApp/src/app/vot-romania/vot.romania.component.ts b/src/ClientApp/src/app/vot-romania/vot.romania.component.ts deleted file mode 100644 index 0123836..0000000 --- a/src/ClientApp/src/app/vot-romania/vot.romania.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-vot-romania', - templateUrl: './vot.romania.component.html', - styleUrls: ['./vot.romania.component.scss'], -}) -export class VotRomaniaComponent { -} diff --git a/src/ClientApp/src/app/voters-guide/voters-guide.component.html b/src/ClientApp/src/app/voters-guide/voters-guide.component.html deleted file mode 100644 index bd155d1..0000000 --- a/src/ClientApp/src/app/voters-guide/voters-guide.component.html +++ /dev/null @@ -1,42 +0,0 @@ - -
-

- {{ "guide_title" | translate }} -

- -
-

{{ "guide_into" | translate }}

-
- -
- -
- - -
- {{option.label | translate }} -
- -
-
- - -
-

-

-

-
-
-
-
-
- - - - - - -
-
\ No newline at end of file diff --git a/src/ClientApp/src/app/voters-guide/voters-guide.component.scss b/src/ClientApp/src/app/voters-guide/voters-guide.component.scss deleted file mode 100644 index 045ddbc..0000000 --- a/src/ClientApp/src/app/voters-guide/voters-guide.component.scss +++ /dev/null @@ -1,117 +0,0 @@ -.wrapper { - align-items: center; - padding-top: 2rem; - - .description { - font-style: normal; - margin-top: 80px; - margin-bottom: 80px; - } - - button { - font-size: 20px; - } - - .options-list { - display: flex; - flex-wrap: wrap; - - .option { - text-align: center; - position: relative; - color: #352245; - width: 255px; - height: 124px; - margin: 10px; - font-weight: 600; - font-size: 20px; - line-height: 24px; - padding: 8px; - display: flex; - align-items: center; - justify-content: center; - border: 2px solid #352245; - overflow: hidden; - - .check-icon-container { - width: 45px; - height: 45px; - background-color: #352245; - position: absolute; - top: 0; - right: 0; - transform: translateX(50%) translateY(-50%) rotate(45deg); - transition: all 0.2s ease-in-out; - opacity: 0; - } - - .check-icon { - opacity: 0; - background-image: url("../../assets/check-on.svg"); - background-repeat: no-repeat; - background-size: cover; - position: absolute; - top: 0; - right: 0; - transition: all 0.2s ease-in-out; - width: 25px; - height: 25px; - transform: translateX(10%) translateY(-10%); - } - - &:hover { - border: 2px solid #ffcc00; - - .check-icon-container { - opacity: 1; - } - - .check-icon { - opacity: 1; - } - } - - &:hover.is-selected { - border: 2px solid #352245; - } - } - - .option.is-selected { - background-color: #ffcc00; - border: 2px solid #352245; - - .check-icon-container { - opacity: 1; - } - - .check-icon { - opacity: 1; - } - } - } - - .option-title { - font-size: 20px; - font-style: normal; - font-weight: bold; - line-height: 40px; - color: #352245; - margin-bottom: 40px; - } - - .option-description { - font-style: normal; - font-weight: normal; - font-size: 20px; - line-height: 24px; - color: #000000; - } - - .answer { - font-size: 20px; - } - - .box-dark { - background: #352245; - } -} diff --git a/src/ClientApp/src/app/voters-guide/voters-guide.component.ts b/src/ClientApp/src/app/voters-guide/voters-guide.component.ts deleted file mode 100644 index 6952104..0000000 --- a/src/ClientApp/src/app/voters-guide/voters-guide.component.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { Component, OnInit, OnDestroy, ElementRef, ViewChild } from '@angular/core'; -import { ApplicationState } from '../state/reducers'; -import { Store, select } from '@ngrx/store'; -import { Subscription, Observable } from 'rxjs'; -import { getVotingGuide } from '../state/selectors'; -import { map } from 'rxjs/operators'; -import { trigger, state, style, transition, animate } from '@angular/animations'; -import { VotersDecisionTreeService, OperatorTreeNode } from '../services/voters-decision-tree.service'; - -export interface Tile { - title: string; - description: string; -} - -export interface VotingGuideViewModel { - description: string; - options: Tile[]; -} - -@Component({ - selector: 'app-voters-guide', - templateUrl: './voters-guide.component.html', - styleUrls: ['./voters-guide.component.scss'], - animations: [ - trigger('flyIn', [ - state('in', style({ transform: 'translateX(0)' })), - transition(':enter', [ - style({ transform: 'translateX(-100%)' }), - animate(250) - ]) - ]) - ] -}) -export class VotersGuideComponent implements OnInit, OnDestroy { - @ViewChild('optionTitle', { static: true }) optionTitle: ElementRef; - - description: string; - title: string; - - data: VotingGuideViewModel; - subscription: Subscription; - currentSentence$: Observable = this.votersDecisionTreeService.currentSentence$; - options$: Observable = this.votersDecisionTreeService.options$; - isBeyondInitialQuestion$: Observable = this.votersDecisionTreeService.isBeyondInitialQuestion$; - hasError$: Observable = this.votersDecisionTreeService.hasError$; - - constructor(private store: Store, - private votersDecisionTreeService: VotersDecisionTreeService) { - } - - ngOnInit(): void { - this.subscription = this.store - .pipe(select(getVotingGuide), - map(guide => { - if (guide === undefined) { - return undefined; - } - - return { - description: guide.description, - options: guide.options.map(o => ({ ...o, isSelected: false })) - }; - })) - .subscribe(x => { - this.data = x; - }); - } - - ngOnDestroy(): void { - this.subscription.unsubscribe(); - this.startOver(); - - } - - selectOption(optionId: string): void { - this.votersDecisionTreeService.selectOption(optionId); - } - - back(): void { - this.votersDecisionTreeService.back(); - } - - startOver(): void { - this.votersDecisionTreeService.startOver(); - } -} diff --git a/src/ClientApp/src/karma.conf.js b/src/ClientApp/src/karma.conf.js deleted file mode 100644 index 4a9730b..0000000 --- a/src/ClientApp/src/karma.conf.js +++ /dev/null @@ -1,31 +0,0 @@ -// Karma configuration file, see link for more information -// https://karma-runner.github.io/1.0/config/configuration-file.html - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') - ], - client: { - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, '../coverage'), - reports: ['html', 'lcovonly'], - fixWebpackSourcePaths: true - }, - reporters: ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['Chrome'], - singleRun: false - }); -}; diff --git a/src/ClientApp/src/test.ts b/src/ClientApp/src/test.ts deleted file mode 100644 index 1631789..0000000 --- a/src/ClientApp/src/test.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/dist/zone-testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -declare const require: any; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); diff --git a/src/ClientApp/src/tsconfig.spec.json b/src/ClientApp/src/tsconfig.spec.json deleted file mode 100644 index de77336..0000000 --- a/src/ClientApp/src/tsconfig.spec.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/spec", - "types": [ - "jasmine", - "node" - ] - }, - "files": [ - "test.ts", - "polyfills.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] -}