Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #887: Create route '/settings' to display all project configurations #888

Merged
merged 1 commit into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ const routes: Routes = [
{
path: 'wall',
loadChildren: './media-wall/media-wall.module#MediaWallModule'
},
{
path: 'settings',
loadChildren: './settings/settings.module#SettingsModule'
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,16 @@ <h5 class="display-media">UK</h5>
<!-- Hook up a message if needed like google does "About xxxxx results (y.yy seconds)" -->
</div>
</div>
<a mat-menu-item class="media-wall-route views-search"
*ngIf="viewButtonChecked"
type="button"
[routerLink]="['/wall']"
[queryParams]="{ query : (query$ | async).queryString }"
target="_blank">
<h5 class="display-media">Display as Media Wall</h5>
</a>
<a mat-menu-item class="media-wall-route views-search"
*ngIf="viewButtonChecked"
type="button"
[routerLink]="['/wall']"
[queryParams]="{ query : (query$ | async).queryString }"
target="_blank">
<h5 class="display-media">Display as Media Wall</h5>
</a>
<a routerLink="/settings" target="_blank" class="tab">
Settings
</a>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ div.wrapper{
display: flex;
flex-direction: row;
align-items: baseline;
margin-left: 177px;
margin-left: 131px;
button {
outline: none;
}
Expand All @@ -65,13 +65,29 @@ div.wrapper{
color: #222;
}
}
a.tab {
cursor: pointer;
min-width: 50px;
text-decoration: none;
background: transparent;
border: none;
padding: 12px;
margin-right: 15px;
font-family: Arial, sans-serif;
color: #777;
text-align: center;
font-size: 0.9em;
&:hover {
color: #222;
}
}
a.views-search {
position: absolute;
box-shadow: 0px 2px 2px 0px grey;
margin: 0px;
top: 38px;
z-index: 52;
left: 689px;
left: 642px;
color: rgba(0,0,0,.87);
}
button.toggleButton {
Expand Down
15 changes: 15 additions & 0 deletions src/app/settings/settings-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { SettingsComponent } from './settings.component';
const routes: Routes = [
{
path: '',
component: SettingsComponent
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
providers: []
})
export class LoklakSettingsRoutingModule { }
17 changes: 17 additions & 0 deletions src/app/settings/settings.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="outer-wrapper">
<div class="wrapper">
<!-- Source Url Config -->
<h1><u>URL Configuration</u></h1>
<div class="url-container" *ngFor="let key of urlObject">
<h2>{{key[0]}}</h2>
<div *ngFor="let value of key[1]">
<h4>{{value | lowercase}}</h4>
</div>
</div>
<!-- News Config -->
<h1><u>News Configuration</u></h1>
<div class="url-container" *ngFor="let key of newsConfigOrgs">
<h4 class="news">{{key}}</h4>
</div>
</div>
</div>
48 changes: 48 additions & 0 deletions src/app/settings/settings.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@import '~src/styles/main';

div.outer-wrapper {
min-height: 100vh;
width: 100%;
// background-color: #f9f2f4;
position: relative;
@include --center-flex();

div.wrapper {
position: relative;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
width: 584px;
box-shadow: 0px 2px 5px 2px #D10046;
margin: 15px;
background-color: #f9f2f4;
@include --center-flex-vertical();

width: 584px;
margin: 15px;
h1 {
font-weight: 300;
text-align: center;
font-size: 2.5em;
margin: 15px 0px 0px 0px;
font-family: 'Roboto', sans-serif;
}
h2 {
text-align: center;
color: #d10042;
}
h5 {
text-align: center;
}
.url-container {
width: 100%;
h4 {
text-align: center;
}
.news {
color: #d10042;
}
}
}
}
24 changes: 24 additions & 0 deletions src/app/settings/settings.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SettingsComponent } from './settings.component';

describe('SettingsComponent', () => {
let component: SettingsComponent;
let fixture: ComponentFixture<SettingsComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SettingsComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(SettingsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
32 changes: 32 additions & 0 deletions src/app/settings/settings.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Component, OnInit } from '@angular/core';
import { defaultUrlConfig } from '../shared/url-config';
import { newsOrgs } from '../shared/news-org';

@Component({
selector: 'app-settings',
templateUrl: './settings.component.html',
styleUrls: ['./settings.component.scss']
})
export class SettingsComponent implements OnInit {
public urlObject = [];
public newsConfigOrgs = newsOrgs;
ngOnInit() {
let i = 0;
for (const key in defaultUrlConfig) {
if (key) {
const data = [];
const value = defaultUrlConfig[key];
const data2 = [];
for (const key2 in value) {
if (key2) {
const value2 = value[key2];
data2.push(key2, value2);
}
}
data.push(key, data2);
this.urlObject.push(data);
i++;
}
}
}
}
21 changes: 21 additions & 0 deletions src/app/settings/settings.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LoklakSettingsRoutingModule } from './settings-routing.module';
import { SettingsComponent } from './settings.component';

@NgModule({
imports: [
/**
* The `CommonModule` contributes many of the common directives that
* applications need including `ngIf` and `ngFor`.
* BrowserModule imports CommonModule and re-exports it.
* The net effect is that an importer of `BrowserModule` gets `CommonModule` directives automatically.
*/
CommonModule,
LoklakSettingsRoutingModule
],
declarations: [
SettingsComponent
]
})
export class SettingsModule { }