Commit d63e7b44 authored by Sebastian's avatar Sebastian

modal component #/playground

parent 698ce863
......@@ -19,7 +19,7 @@ import { HelpComponent } from './portal/help/help.component';
import { ErrorComponent } from './error';
import { AutosuggestComponent } from './widget/autosuggest';
import { VersionInfoComponent } from './home/version-info/version-info.component';
import { ModalComponent } from './widgets/modals/modal/modal.component';
const routes: Routes = [
{ path: 'autosuggest', component: AutosuggestComponent },
{ path: 'home', component: HomeComponent },
......@@ -41,6 +41,7 @@ const routes: Routes = [
{ path: 'bliDimensions', component: BliComponent},
{ path: 'categories', component: CategoryComponent},
{ path: 'createEntry', component: CreateEntryComponent },
{ path: 'playground', component: ModalComponent },
{ path: '', component: HomeComponent }, //startpage
{ path: '**', redirectTo: 'error'},
......
<app-menubar></app-menubar>
<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="large" color="#fff" type="ball-spin-clockwise"></ngx-spinner>
<div class="main">
<router-outlet></router-outlet>
<app-openlayer></app-openlayer>
</div>
<div class="main">
<router-outlet></router-outlet>
<app-openlayer></app-openlayer>
</div>
<app-footer-light *ngIf="footer=='light'" ></app-footer-light>
<app-footer *ngIf="footer!='light'" ></app-footer>
<notifier-container></notifier-container>
\ No newline at end of file
import { Component, OnInit} from '@angular/core';
import { NgxSpinnerService } from 'ngx-spinner';
import { NgxSpinnerService } from 'ngx-spinner';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
......
......@@ -44,9 +44,9 @@ import { BliEditorComponent } from './admin/bli-editor/bli-editor.component';
import { AutosuggestComponent } from './widget/autosuggest/autosuggest.component';
import { VersionInfoComponent } from './home/version-info/version-info.component';
import { HelpComponent } from './portal/help/help.component';
import { ModalsComponent } from './modals/modals.component';
import localeDe from '@angular/common/locales/de';
import { ModalComponent } from './widgets/modals/modal/modal.component';
enableProdMode();
@NgModule( {
......@@ -85,7 +85,7 @@ enableProdMode();
AutosuggestComponent,
VersionInfoComponent,
HelpComponent,
ModalsComponent
ModalComponent
//MatAutocompleteModule,
],
imports: [
......
......@@ -18,7 +18,12 @@ export class AuthComponent implements OnInit {
private message: string;
private sending: boolean;
private loginForm: FormGroup;
constructor(private logger: LogService, private authService: AuthService,private formBuilder: FormBuilder, private router: Router) {
constructor(
private logger: LogService,
private authService: AuthService,
private formBuilder: FormBuilder,
private router: Router,
) {
this.logger.debug('AuthComponent instantiated.');
this.loginForm = this.formBuilder.group({
username: ['', Validators.required],
......
......@@ -222,7 +222,7 @@
<div class="elementwrap">
<div class="elementinfo">
<div class="form-group">
<div (click)="infoCollapsed = !infoCollapsed"
<div (click)="infoCollapsed= !infoCollapsed"
[attr.aria-expanded]="!infoCollapsed" aria-controls="collapseInfo"
class="collapseInfo">
<i class="fa fa-undo fa-lg" aria-hidden="true">&nbsp;</i>Allgemeine
......
......@@ -44,6 +44,7 @@ export class SearchComponent implements OnInit {
currentElement : OsmNode;
useFilter : boolean=true;
showAll:boolean;
infoCollapsed: boolean = true;
dimensionsFilterArray : Array<BliDimension>;
filterPipe = new NodeFilterPipe();
constructor(
......
import { TestBed } from '@angular/core/testing';
import { ModalManagerService } from './modal-manager.service';
describe('ModalManagerService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: ModalManagerService = TestBed.get(ModalManagerService);
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ModalManagerService {
constructor() { }
}
.left-aligned-widget{
margin-left:0;
position:absolute;
left:0;
float:left;
}
\ No newline at end of file
<div class="widget-wrap left-aligned-widget">
<button class="btn btn-lg btn-outline-primary" (click)="openRegistrationModal()">Launch AuthComponent</button>
<button class="btn btn-lg btn-outline-primary" (click)="openCreateEntryComponent()">createEntryComponent</button>
</div>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ModalComponent } from './modal.component';
describe('ModalComponent', () => {
let component: ModalComponent;
let fixture: ComponentFixture<ModalComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ModalComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { AuthComponent } from '../../../auth/auth.component';
import { CreateEntryComponent } from '../../../portal/create-entry/create-entry.component';
@Component({
selector: 'app-modal',
templateUrl: './modal.component.html',
styleUrls: ['./modal.component.css']
})
export class ModalComponent implements OnInit {
constructor(private modalService: NgbModal) { }
ngOnInit() {
console.log("init / modalComponent");
}
openRegistrationModal(){
const modalRef = this.modalService.open(AuthComponent);
}
openCreateEntryComponent(){
const modalRef = this.modalService.open(CreateEntryComponent);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment