parent
2e913e26d0
commit
a62e00c6ad
@ -1,52 +0,0 @@
|
||||
<nav class="navbar" role="navigation" aria-label="main navigation">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item" role="button" (click)="toggleSidebarOpening()"> Dev menu </a>
|
||||
|
||||
<a
|
||||
role="button"
|
||||
class="navbar-burger burger"
|
||||
aria-label="menu"
|
||||
aria-expanded="false"
|
||||
data-target="navbarBasicExample"
|
||||
>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="navbarBasicExample" class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<div class="navbar-item has-dropdown is-hoverable">
|
||||
<a class="navbar-link"> Modules </a>
|
||||
<div class="navbar-dropdown">
|
||||
<a class="navbar-item" routerLink="oldstuff" routerLinkActive="is-active">
|
||||
Old stuff
|
||||
</a>
|
||||
<a class="navbar-item" routerLink="administration" routerLinkActive="is-active">
|
||||
Administration
|
||||
</a>
|
||||
<a class="navbar-item" routerLink="consultation" routerLinkActive="is-active">
|
||||
Consultation
|
||||
</a>
|
||||
<a class="navbar-item" routerLink="participation" routerLinkActive="is-active">
|
||||
Participation
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="navbar-item has-dropdown is-hoverable">
|
||||
<a class="navbar-link"> Tous les sondages </a>
|
||||
<div class="navbar-dropdown">
|
||||
<a
|
||||
class="navbar-item"
|
||||
*ngFor="let slug of slugsAvailables"
|
||||
routerLink="{{ '/consultation/poll/' + slug }}"
|
||||
routerLinkActive="is-active"
|
||||
>
|
||||
« {{ slug }} »
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DevNavbarComponent } from './dev-navbar.component';
|
||||
|
||||
describe('DevNavbarComponent', () => {
|
||||
let component: DevNavbarComponent;
|
||||
let fixture: ComponentFixture<DevNavbarComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [DevNavbarComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DevNavbarComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,35 +0,0 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { User } from '../../models/user.model';
|
||||
import { ApiService } from '../../services/api.service';
|
||||
import { UserService } from '../../services/user.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dev-navbar',
|
||||
templateUrl: './dev-navbar.component.html',
|
||||
styleUrls: ['./dev-navbar.component.scss'],
|
||||
})
|
||||
export class DevNavbarComponent implements OnInit {
|
||||
@Input() isSidebarOpened: boolean;
|
||||
@Output() toggleSidebarEE = new EventEmitter<boolean>();
|
||||
|
||||
public _user: Observable<User> = this.userService.user;
|
||||
|
||||
public slugsAvailables: string[] = [];
|
||||
|
||||
constructor(private apiService: ApiService, private userService: UserService) {}
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.getSlugs();
|
||||
}
|
||||
|
||||
public async getSlugs(): Promise<void> {
|
||||
this.slugsAvailables = await this.apiService.getAllPollsSlugs();
|
||||
}
|
||||
|
||||
public toggleSidebarOpening(): void {
|
||||
this.isSidebarOpened = !this.isSidebarOpened;
|
||||
this.toggleSidebarEE.emit(this.isSidebarOpened);
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
export enum MessageSeverity {
|
||||
SUCCESS = 'success',
|
||||
INFO = 'info',
|
||||
WARN = 'warn',
|
||||
ERROR = 'error',
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
export enum Theme {
|
||||
LIGHT = 'LIGHT',
|
||||
DARK = 'DARK',
|
||||
RED = 'RED',
|
||||
CONTRAST = 'CONTRAST',
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
export enum WorkflowStep {
|
||||
DESCRIPTION = 'DESCRIPTION',
|
||||
CHOICES = 'CHOICES',
|
||||
CONFIGURATION = 'CONFIGURATION',
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WorkflowService } from './workflow.service';
|
||||
|
||||
describe('WorkflowService', () => {
|
||||
let service: WorkflowService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(WorkflowService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,30 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
|
||||
import { WorkflowStep } from '../enums/workflow-step.enum';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class WorkflowService {
|
||||
private steps = [WorkflowStep.DESCRIPTION, WorkflowStep.CHOICES, WorkflowStep.CONFIGURATION];
|
||||
|
||||
private _currentStep: BehaviorSubject<WorkflowStep> = new BehaviorSubject<WorkflowStep>(WorkflowStep[0]);
|
||||
public readonly currentStep: Observable<WorkflowStep> = this._currentStep.asObservable();
|
||||
|
||||
constructor() {}
|
||||
|
||||
public loadNextStep(): void {
|
||||
this._currentStep.next(WorkflowStep[this.getNewIndex(1)]);
|
||||
}
|
||||
|
||||
public loadPriorStep(): void {
|
||||
this._currentStep.next(WorkflowStep[this.getNewIndex(-1)]);
|
||||
}
|
||||
|
||||
private getNewIndex(way: number): number {
|
||||
const currentIndex: number = Object.keys(WorkflowStep).indexOf(this._currentStep.getValue());
|
||||
const newIndex: number = currentIndex + way;
|
||||
return 0 <= newIndex && newIndex <= Object.keys(WorkflowStep).length ? newIndex : currentIndex;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
|
||||
import { UserPollsComponent } from './user-polls/user-polls.component';
|
||||
|
||||
const routes: Routes = [{ path: 'polls', component: UserPollsComponent }];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class UserProfileRoutingModule {}
|
@ -0,0 +1,13 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { SharedModule } from '../../shared/shared.module';
|
||||
import { UserPollsComponent } from './user-polls/user-polls.component';
|
||||
import { UserProfileRoutingModule } from './user-profile-routing.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [UserPollsComponent],
|
||||
imports: [CommonModule, UserProfileRoutingModule, SharedModule, TranslateModule.forChild({ extend: true })],
|
||||
})
|
||||
export class UserProfileModule {}
|
Loading…
Reference in new issue