mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
hop
This commit is contained in:
parent
b4f496b08d
commit
6db96397ea
@ -1,12 +1,12 @@
|
|||||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import {Title} from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
import {Subscription} from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import {environment} from '../environments/environment';
|
import { environment } from '../environments/environment';
|
||||||
import {Theme} from './core/enums/theme.enum';
|
import { Theme } from './core/enums/theme.enum';
|
||||||
import {LanguageService} from './core/services/language.service';
|
import { LanguageService } from './core/services/language.service';
|
||||||
import {ThemeService} from './core/services/theme.service';
|
import { ThemeService } from './core/services/theme.service';
|
||||||
import {MockingService} from './core/services/mocking.service';
|
import { MockingService } from './core/services/mocking.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
@ -23,16 +23,15 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||||||
constructor(
|
constructor(
|
||||||
private titleService: Title,
|
private titleService: Title,
|
||||||
private themeService: ThemeService,
|
private themeService: ThemeService,
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService
|
||||||
private mockingService: MockingService
|
) // private mockingService: MockingService
|
||||||
) {
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (!environment.production) {
|
if (!environment.production) {
|
||||||
this.appTitle += ' [DEV]';
|
this.appTitle += ' [DEV]';
|
||||||
// TODO: to be removed
|
// TODO: to be removed
|
||||||
this.mockingService.init();
|
// this.mockingService.init();
|
||||||
}
|
}
|
||||||
this.titleService.setTitle(this.appTitle);
|
this.titleService.setTitle(this.appTitle);
|
||||||
this.languageService.configureAndInitTranslations();
|
this.languageService.configureAndInitTranslations();
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<div id="navbarBasicExample" class="navbar-menu">
|
<div id="navbarBasicExample" class="navbar-menu">
|
||||||
<div class="navbar-start">
|
<div class="navbar-start">
|
||||||
<a class="navbar-item" routerLink="/administration" routerLinkActive="is-active">
|
<a class="navbar-item" routerLink="administration" routerLinkActive="is-active">
|
||||||
{{ 'config.title' | translate }}
|
{{ 'config.title' | translate }}
|
||||||
</a>
|
</a>
|
||||||
<a class="navbar-item" routerLink="user/polls" routerLinkActive="is-active">
|
<a class="navbar-item" routerLink="user/polls" routerLinkActive="is-active">
|
||||||
|
@ -47,9 +47,12 @@ export class PollService implements Resolve<Poll> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async loadPollBySlug(slug: string): Promise<void> {
|
public async loadPollBySlug(slug: string): Promise<void> {
|
||||||
const poll: Poll | undefined = await this.apiService.getPollBySlug(slug);
|
console.log('slug', slug);
|
||||||
console.log({ loadPollBySlugResponse: poll });
|
if (slug) {
|
||||||
this.updateCurrentPoll(poll);
|
const poll: Poll | undefined = await this.apiService.getPollBySlug(slug);
|
||||||
|
console.log({ loadPollBySlugResponse: poll });
|
||||||
|
this.updateCurrentPoll(poll);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateCurrentPoll(poll: Poll): void {
|
public updateCurrentPoll(poll: Poll): void {
|
||||||
|
@ -2,8 +2,12 @@ import { NgModule } from '@angular/core';
|
|||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
|
||||||
import { AdministrationComponent } from './administration.component';
|
import { AdministrationComponent } from './administration.component';
|
||||||
|
import { NamingComponent } from './naming/naming.component';
|
||||||
|
|
||||||
const routes: Routes = [{ path: '', component: AdministrationComponent }];
|
const routes: Routes = [
|
||||||
|
{ path: '', component: AdministrationComponent },
|
||||||
|
{ path: 'naming', component: NamingComponent },
|
||||||
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<!-- <app-stepper [poll]="poll"></app-stepper>-->
|
<app-stepper [poll]="poll"></app-stepper>
|
||||||
|
<h1>Administration de sondage</h1>
|
||||||
|
<h1 class="title is-1"><i class="fa fa-calendar" aria-hidden="true"></i> {{ 'dates.title' | translate }}</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,6 +14,7 @@ import { SettingsComponent } from '../../shared/components/settings/settings.com
|
|||||||
})
|
})
|
||||||
export class AdministrationComponent implements OnInit, OnDestroy {
|
export class AdministrationComponent implements OnInit, OnDestroy {
|
||||||
public poll: Poll;
|
public poll: Poll;
|
||||||
|
public form: Object;
|
||||||
private routeSubscription: Subscription;
|
private routeSubscription: Subscription;
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private userService: UserService, private modalService: ModalService) {}
|
constructor(private route: ActivatedRoute, private userService: UserService, private modalService: ModalService) {}
|
||||||
@ -23,6 +24,7 @@ export class AdministrationComponent implements OnInit, OnDestroy {
|
|||||||
this.modalService.openModal(SettingsComponent);
|
this.modalService.openModal(SettingsComponent);
|
||||||
}
|
}
|
||||||
this.routeSubscription = this.route.data.subscribe((data: { poll: Poll }) => {
|
this.routeSubscription = this.route.data.subscribe((data: { poll: Poll }) => {
|
||||||
|
console.log('data', data);
|
||||||
if (data.poll) {
|
if (data.poll) {
|
||||||
this.poll = data.poll;
|
this.poll = data.poll;
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,10 @@ import { SharedModule } from '../../shared/shared.module';
|
|||||||
import { AdministrationRoutingModule } from './administration-routing.module';
|
import { AdministrationRoutingModule } from './administration-routing.module';
|
||||||
import { AdministrationComponent } from './administration.component';
|
import { AdministrationComponent } from './administration.component';
|
||||||
import { StepperComponent } from './stepper/stepper.component';
|
import { StepperComponent } from './stepper/stepper.component';
|
||||||
|
import { NamingComponent } from './naming/naming.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [AdministrationComponent, StepperComponent],
|
declarations: [AdministrationComponent, StepperComponent, NamingComponent],
|
||||||
imports: [
|
imports: [
|
||||||
AdministrationRoutingModule,
|
AdministrationRoutingModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
<p>naming works!</p>
|
@ -0,0 +1,24 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { NamingComponent } from './naming.component';
|
||||||
|
|
||||||
|
describe('NamingComponent', () => {
|
||||||
|
let component: NamingComponent;
|
||||||
|
let fixture: ComponentFixture<NamingComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [NamingComponent],
|
||||||
|
}).compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(NamingComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
12
src/app/features/administration/naming/naming.component.ts
Normal file
12
src/app/features/administration/naming/naming.component.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-naming',
|
||||||
|
templateUrl: './naming.component.html',
|
||||||
|
styleUrls: ['./naming.component.scss'],
|
||||||
|
})
|
||||||
|
export class NamingComponent implements OnInit {
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
|
ngOnInit(): void {}
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
<form [formGroup]="pollFormGroup">
|
<form [formGroup]="pollFormGroup">
|
||||||
<ng-template matStepLabel>Informations du sondage</ng-template>
|
<ng-template matStepLabel>Informations du sondage</ng-template>
|
||||||
<mat-form-field appearance="outline">
|
<mat-form-field appearance="outline">
|
||||||
<mat-label>Question posée, sujet, etc.</mat-label>
|
<mat-label>Titre</mat-label>
|
||||||
<input #question matInput placeholder="Question posée, sujet" formControlName="question" required />
|
<input #question matInput placeholder="Question posée, sujet" formControlName="question" required />
|
||||||
<button
|
<button
|
||||||
mat-button
|
mat-button
|
||||||
@ -16,21 +16,7 @@
|
|||||||
<i class="fa fa-close"></i>
|
<i class="fa fa-close"></i>
|
||||||
</button>
|
</button>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field appearance="outline" class="is-flex">
|
|
||||||
<mat-label>Url pour les participants</mat-label>
|
|
||||||
<span matPrefix>{{ urlPrefix }}</span>
|
|
||||||
<input #slug matInput placeholder="Url" formControlName="slug" required />
|
|
||||||
<button
|
|
||||||
mat-button
|
|
||||||
*ngIf="slug.value"
|
|
||||||
matSuffix
|
|
||||||
mat-icon-button
|
|
||||||
aria-label="Clear"
|
|
||||||
(click)="slug.value = ''"
|
|
||||||
>
|
|
||||||
<i class="fa fa-close"></i>
|
|
||||||
</button>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field appearance="outline" class="is-flex">
|
<mat-form-field appearance="outline" class="is-flex">
|
||||||
<mat-label>Description</mat-label>
|
<mat-label>Description</mat-label>
|
||||||
<textarea
|
<textarea
|
||||||
@ -51,7 +37,21 @@
|
|||||||
<i class="fa fa-close"></i>
|
<i class="fa fa-close"></i>
|
||||||
</button>
|
</button>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline" class="is-flex">
|
||||||
|
<mat-label>Url pour les participants</mat-label>
|
||||||
|
<span matPrefix>{{ urlPrefix }}</span>
|
||||||
|
<input #slug matInput placeholder="Url" formControlName="slug" required />
|
||||||
|
<button
|
||||||
|
mat-button
|
||||||
|
*ngIf="slug.value"
|
||||||
|
matSuffix
|
||||||
|
mat-icon-button
|
||||||
|
aria-label="Clear"
|
||||||
|
(click)="slug.value = ''"
|
||||||
|
>
|
||||||
|
<i class="fa fa-close"></i>
|
||||||
|
</button>
|
||||||
|
</mat-form-field>
|
||||||
<div>
|
<div>
|
||||||
<button mat-button matStepperNext>Next</button>
|
<button mat-button matStepperNext>Next</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,7 +10,7 @@ const backendApiUrlsInDev = {
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
appTitle: 'FramaDate',
|
appTitle: 'FramaDate',
|
||||||
appLogo: '/assets/img/icon_voter_yes.png',
|
appLogo: 'assets/img/logo.png',
|
||||||
api: {
|
api: {
|
||||||
baseHref: backendApiUrlsInDev.local,
|
baseHref: backendApiUrlsInDev.local,
|
||||||
endpoints: {
|
endpoints: {
|
||||||
|
Loading…
Reference in New Issue
Block a user