[DEV] may reworks: simplify, create common-part, many small clean
This commit is contained in:
parent
8e27d80c33
commit
d8086452c3
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Router } from '@angular/router';
|
||||
import { UserService, SessionService } from './service';
|
||||
|
||||
@Component({
|
||||
|
@ -28,8 +28,9 @@ import { AppComponent } from './app.component';
|
||||
import { ErrorComponent } from './error/error';
|
||||
import { HomeScene, ErrorViewerScene, HelpScene, SsoScene, TypeScene, UniverseScene, SeriesScene, SeasonScene, VideoScene, SettingsScene,
|
||||
VideoEditScene, SeasonEditScene, SeriesEditScene, UploadScene } from './scene';
|
||||
import { PopInService, HttpWrapperService, SessionService, CookiesService, StorageService, UserService, SSOService, BddService, TypeService,
|
||||
import { PopInService, HttpWrapperService, SessionService, UserService, SSOService, BddService, TypeService,
|
||||
DataService, UniverseService, SeriesService, SeasonService, VideoService, ArianeService } from './service';
|
||||
import { CookiesService, StorageService } from 'common/service';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
|
@ -4,8 +4,8 @@
|
||||
* @license PROPRIETARY (see license file)
|
||||
*/
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { ModelResponseHttp } from '../../service/http-wrapper';
|
||||
import { DataService } from '../../service/data';
|
||||
//import { ModelResponseHttp } from '@app/service/http-wrapper';
|
||||
import { DataService } from 'app/service/data';
|
||||
|
||||
@Component({
|
||||
selector: 'data-image',
|
||||
|
@ -1,10 +1,10 @@
|
||||
|
||||
<div class="imgContainer-small">
|
||||
<div *ngIf="cover">
|
||||
<div *ngIf="covers">
|
||||
<!--<data-image id="{{cover}}"></data-image>-->
|
||||
<img src="{{cover}}"/>
|
||||
<img src="{{covers[0]}}"/>
|
||||
</div>
|
||||
<div *ngIf="!cover" class="noImage">
|
||||
<div *ngIf="!covers" class="noImage">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -5,7 +5,9 @@
|
||||
*/
|
||||
import {Component, OnInit, Input } from '@angular/core';
|
||||
|
||||
import { SeasonService, DataService } from '../../service';
|
||||
import { SeasonService, DataService } from 'app/service';
|
||||
import { NodeData } from 'common/model';
|
||||
import { isNullOrUndefined } from 'common/utils';
|
||||
|
||||
@Component({
|
||||
selector: 'app-element-season',
|
||||
@ -14,14 +16,12 @@ import { SeasonService, DataService } from '../../service';
|
||||
})
|
||||
export class ElementSeasonComponent implements OnInit {
|
||||
// input parameters
|
||||
@Input() idSeason:number = -1;
|
||||
@Input() element:NodeData;
|
||||
|
||||
error:string = '';
|
||||
numberSeason:number = -1;
|
||||
count:number = 0;
|
||||
cover:string = '';
|
||||
covers:Array<string> = [];
|
||||
description:string = '';
|
||||
numberSeason: number;
|
||||
count: number;
|
||||
covers: string[];
|
||||
description: string;
|
||||
|
||||
constructor(
|
||||
private seasonService: SeasonService,
|
||||
@ -29,30 +29,16 @@ export class ElementSeasonComponent implements OnInit {
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
if (isNullOrUndefined(this.element)) {
|
||||
this.numberSeason = undefined;
|
||||
this.covers = undefined;
|
||||
this.description = undefined;
|
||||
}
|
||||
this.numberSeason = this.element.id;
|
||||
this.description = this.element.description;
|
||||
this.covers = this.dataService.getCoverListThumbnailUrl(this.element.covers);
|
||||
let self = this;
|
||||
console.log(`get season properties id: ${ this.idSeason}`);
|
||||
this.seasonService.get(this.idSeason)
|
||||
.then((response) => {
|
||||
self.error = '';
|
||||
self.numberSeason = response.name;
|
||||
self.description = response.description;
|
||||
if(response.covers === undefined || response.covers === null || response.covers.length === 0) {
|
||||
self.cover = null;
|
||||
// self.covers = [];
|
||||
} else {
|
||||
self.cover = self.dataService.getCoverThumbnailUrl(response.covers[0]);
|
||||
for(let iii = 0; iii < response.covers.length; iii++) {
|
||||
self.covers.push(self.dataService.getCoverThumbnailUrl(response.covers[iii]));
|
||||
}
|
||||
}
|
||||
}).catch((response) => {
|
||||
self.error = 'Can not get the data';
|
||||
self.numberSeason = -1;
|
||||
self.cover = null;
|
||||
self.covers = [];
|
||||
self.description = '';
|
||||
});
|
||||
this.seasonService.countVideo(this.idSeason)
|
||||
this.seasonService.countVideo(this.element.id)
|
||||
.then((response) => {
|
||||
self.count = response;
|
||||
}).catch((response) => {
|
||||
|
@ -5,11 +5,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="imgContainer-small">
|
||||
<div *ngIf="cover">
|
||||
<div *ngIf="covers">
|
||||
<!--<data-image id="{{cover}}"></data-image>-->
|
||||
<img src="{{cover}}"/>
|
||||
<img src="{{covers[0]}}"/>
|
||||
</div>
|
||||
<div *ngIf="!cover" class="noImage">
|
||||
<div *ngIf="!covers" class="noImage">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4,8 +4,10 @@
|
||||
* @license PROPRIETARY (see license file)
|
||||
*/
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { NodeData } from 'common/model';
|
||||
import { isNullOrUndefined } from 'common/utils';
|
||||
|
||||
import { SeriesService, DataService } from '../../service';
|
||||
import { SeriesService, DataService } from 'app/service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-element-series',
|
||||
@ -14,17 +16,13 @@ import { SeriesService, DataService } from '../../service';
|
||||
})
|
||||
export class ElementSeriesComponent implements OnInit {
|
||||
// input parameters
|
||||
@Input() idSeries:number = -1;
|
||||
@Input() idType:number = -1;
|
||||
@Input() element:NodeData;
|
||||
|
||||
error:string = '';
|
||||
name:string = 'plouf';
|
||||
description:string = '';
|
||||
countvideo:number = null;
|
||||
imageSource:string = null;
|
||||
|
||||
cover:string = '';
|
||||
covers:Array<string> = [];
|
||||
covers:string[];
|
||||
|
||||
constructor(
|
||||
private seriesService: SeriesService,
|
||||
@ -32,29 +30,17 @@ export class ElementSeriesComponent implements OnInit {
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.name = `ll ${ this.idType }+${ this.idSeries}`;
|
||||
if (isNullOrUndefined(this.element)) {
|
||||
this.name = '!!ERROR!!';
|
||||
this.description = undefined;
|
||||
return;
|
||||
}
|
||||
let self = this;
|
||||
console.log(`get parameter id: ${ this.idType}`);
|
||||
this.seriesService.get(this.idSeries)
|
||||
.then((response) => {
|
||||
self.error = '';
|
||||
self.name = response.name;
|
||||
if(response.covers === undefined || response.covers === null || response.covers.length === 0) {
|
||||
self.cover = null;
|
||||
// self.covers = [];
|
||||
} else {
|
||||
self.cover = self.dataService.getCoverThumbnailUrl(response.covers[0]);
|
||||
for(let iii = 0; iii < response.covers.length; iii++) {
|
||||
self.covers.push(self.dataService.getCoverThumbnailUrl(response.covers[iii]));
|
||||
}
|
||||
}
|
||||
}).catch((response) => {
|
||||
self.error = 'Can not get the data';
|
||||
self.name = '';
|
||||
self.cover = null;
|
||||
self.covers = [];
|
||||
});
|
||||
this.seriesService.countVideo(this.idSeries)
|
||||
self.name = this.element.name;
|
||||
self.description = this.element.description;
|
||||
self.covers = self.dataService.getCoverListThumbnailUrl(this.element.covers);
|
||||
|
||||
this.seriesService.countVideo(this.element.id)
|
||||
.then((response) => {
|
||||
self.countvideo = response;
|
||||
}).catch((response) => {
|
||||
|
@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<div class="imgContainer-small">
|
||||
<div *ngIf="covers">
|
||||
<img src="{{covers[0]}}" alt="type image" class="miniature-small"/>
|
||||
<img src="{{covers[0]}}" class="miniature-small"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="title-small">
|
||||
|
@ -4,10 +4,10 @@
|
||||
* @license PROPRIETARY (see license file)
|
||||
*/
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { isArrayOf, isNumberFinite } from '../../utils';
|
||||
import { isArrayOf, isNullOrUndefined, isNumberFinite } from 'common/utils';
|
||||
import { NodeData } from 'common/model';
|
||||
|
||||
import { TypeService, DataService } from '../../service';
|
||||
import { NodeData } from '../../model';
|
||||
import { TypeService, DataService } from 'app/service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-element-type',
|
||||
@ -19,11 +19,9 @@ export class ElementTypeComponent implements OnInit {
|
||||
@Input() element:NodeData;
|
||||
|
||||
public name: string = 'rr';
|
||||
public description: string = 'sdqdfqsd';
|
||||
public description: string;
|
||||
|
||||
public imageSource:string; // TODO: remove this ...
|
||||
public countvideo:number;
|
||||
public countserie:number;
|
||||
|
||||
public covers: string[];
|
||||
|
||||
@ -33,22 +31,23 @@ export class ElementTypeComponent implements OnInit {
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
if (isNullOrUndefined(this.element)) {
|
||||
this.name = 'Not a media';
|
||||
this.description = undefined;
|
||||
this.countvideo = undefined;
|
||||
this.covers = undefined;
|
||||
return;
|
||||
}
|
||||
let self = this;
|
||||
console.log(" ??? Get element ! " + JSON.stringify(this.element));
|
||||
self.name = this.element.name;
|
||||
self.description = this.element.description;
|
||||
if(!isArrayOf(this.element.covers, isNumberFinite) || this.element.covers.length === 0) {
|
||||
self.covers = undefined;
|
||||
} else {
|
||||
self.covers = [];
|
||||
for(let iii = 0; iii < this.element.covers.length; iii++) {
|
||||
self.covers.push(self.dataService.getCoverThumbnailUrl(this.element.covers[iii]));
|
||||
}
|
||||
}
|
||||
self.covers = self.dataService.getCoverListThumbnailUrl(this.element.covers);
|
||||
|
||||
this.typeService.countVideo(this.element.id)
|
||||
.then((response: number) => {
|
||||
self.countvideo = response;
|
||||
}).catch((response) => {
|
||||
}).catch(() => {
|
||||
self.countvideo = 0;
|
||||
});
|
||||
}
|
||||
|
@ -1,16 +1,19 @@
|
||||
<div>
|
||||
<div class="videoImgContainer">
|
||||
<div *ngIf="cover">
|
||||
<div *ngIf="covers">
|
||||
<!--<data-image id="{{cover}}"></data-image>-->
|
||||
<img src="{{cover}}"/>
|
||||
<img src="{{covers[0]}}"/>
|
||||
</div>
|
||||
<div *ngIf="!cover" class="noImage">
|
||||
<div *ngIf="!covers" class="noImage">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="title-small">
|
||||
<div class="title-small" *ngIf="data">
|
||||
{{episodeDisplay}} {{name}}
|
||||
</div>
|
||||
<div class="title-small" *ngIf="!data">
|
||||
Error meda: {{element?.id}}
|
||||
</div>
|
||||
<!--
|
||||
<div class="description-small" *ngIf="description">
|
||||
{{description}}
|
||||
|
@ -4,8 +4,11 @@
|
||||
* @license PROPRIETARY (see license file)
|
||||
*/
|
||||
import { Injectable, Component, OnInit, Input } from '@angular/core';
|
||||
import { isMedia, Media } from 'app/model';
|
||||
|
||||
import { VideoService, DataService, HttpWrapperService } from '../../service';
|
||||
import { VideoService, DataService, HttpWrapperService } from 'app/service';
|
||||
import { NodeData } from 'common/model';
|
||||
import { isNullOrUndefined } from 'common/utils';
|
||||
|
||||
@Component({
|
||||
selector: 'app-element-video',
|
||||
@ -16,92 +19,38 @@ import { VideoService, DataService, HttpWrapperService } from '../../service';
|
||||
@Injectable()
|
||||
export class ElementVideoComponent implements OnInit {
|
||||
// input parameters
|
||||
@Input() idVideo:number = -1;
|
||||
@Input() displayVideo:boolean = false;
|
||||
|
||||
error:string = '';
|
||||
@Input() element:NodeData;
|
||||
data:Media;
|
||||
|
||||
name:string = '';
|
||||
description:string = '';
|
||||
episode:number = undefined;
|
||||
seriesId:number = undefined;
|
||||
seasonId:number = undefined;
|
||||
dataId:number = -1;
|
||||
time:number = undefined;
|
||||
typeId:number = undefined;
|
||||
generatedName:string = '';
|
||||
videoSource:string = '';
|
||||
videoEnable:boolean = false;
|
||||
imageSource:string = null;
|
||||
episodeDisplay:string = '';
|
||||
|
||||
cover:string = '';
|
||||
covers:string[] = [];
|
||||
covers:string[];
|
||||
|
||||
constructor(
|
||||
private videoService: VideoService,
|
||||
private dataService: DataService,
|
||||
private httpService: HttpWrapperService) {
|
||||
private dataService: DataService) {
|
||||
|
||||
}
|
||||
OnDestroy() {
|
||||
this.videoSource = '';
|
||||
this.videoEnable = false;
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.name = `ll ${ this.idVideo}`;
|
||||
let self = this;
|
||||
// console.log("get video id: " + this.idVideo);
|
||||
this.videoService.get(this.idVideo)
|
||||
.then((response) => {
|
||||
// console.log("get response of video : " + JSON.stringify(response, null, 2));
|
||||
self.error = '';
|
||||
self.name = response.name;
|
||||
self.description = response.description;
|
||||
self.episode = response.episode;
|
||||
if(response.episode === undefined || response.episode === null || response.episode === '') {
|
||||
self.episodeDisplay = '';
|
||||
if (!isMedia(this.element)) {
|
||||
this.data = undefined;
|
||||
this.name = 'Not a media';
|
||||
this.description = undefined;
|
||||
return;
|
||||
}
|
||||
this.data = this.element;
|
||||
this.name = this.element.name;
|
||||
this.description = this.element.description;
|
||||
if(isNullOrUndefined(this.element.episode)) {
|
||||
this.episodeDisplay = '';
|
||||
} else {
|
||||
self.episodeDisplay = `${response.episode } - `;
|
||||
this.episodeDisplay = `${this.element.episode } - `;
|
||||
}
|
||||
self.seriesId = response.seriesId;
|
||||
self.seasonId = response.seasonId;
|
||||
self.dataId = response.dataId;
|
||||
self.time = response.time;
|
||||
self.generatedName = response.generatedName;
|
||||
if(self.dataId !== -1) {
|
||||
self.videoSource = self.httpService.createRESTCall(`data/${ self.dataId}`);
|
||||
self.videoEnable = true;
|
||||
} else {
|
||||
self.videoSource = '';
|
||||
self.videoEnable = false;
|
||||
}
|
||||
if(response.covers === undefined || response.covers === null || response.covers.length === 0) {
|
||||
self.cover = null;
|
||||
// self.covers = [];
|
||||
} else {
|
||||
self.cover = self.dataService.getCoverThumbnailUrl(response.covers[0]);
|
||||
for(let iii = 0; iii < response.covers.length; iii++) {
|
||||
self.covers.push(self.dataService.getCoverThumbnailUrl(response.covers[iii]));
|
||||
}
|
||||
}
|
||||
// console.log("101010 " + self.videoEnable + " " + self.videoSource);
|
||||
// console.log("set transformed : " + JSON.stringify(self, null, 2));
|
||||
}).catch((response) => {
|
||||
self.error = 'Can not get the data';
|
||||
self.name = '';
|
||||
self.description = '';
|
||||
self.episode = undefined;
|
||||
self.episodeDisplay = '';
|
||||
self.seriesId = undefined;
|
||||
self.seasonId = undefined;
|
||||
self.dataId = -1;
|
||||
self.time = undefined;
|
||||
self.generatedName = '';
|
||||
self.videoSource = '';
|
||||
self.videoEnable = false;
|
||||
self.cover = null;
|
||||
self.covers = [];
|
||||
});
|
||||
this.covers = this.dataService.getCoverListThumbnailUrl(this.element.covers);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
import { Component, Input, Output, OnInit, OnDestroy, EventEmitter } from '@angular/core';
|
||||
|
||||
import { PopInService } from '../../service';
|
||||
import { PopInService } from 'app/service';
|
||||
|
||||
@Component({
|
||||
// moduleId: module.id.toString(),
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { UserService, SessionService, SSOService, ArianeService } from '../../service';
|
||||
import { UserService, SessionService, SSOService, ArianeService } from 'app/service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-top-menu',
|
||||
|
@ -1,8 +1,5 @@
|
||||
import { Media, isMedia } from "./media";
|
||||
import { NodeData, isNodeData } from "./node";
|
||||
|
||||
|
||||
export {
|
||||
NodeData, isNodeData,
|
||||
Media, isMedia,
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { isObject, isNumberFinite, isString, isOptionalOf, isOptionalArrayOf } from "../utils";
|
||||
import { isNodeData, NodeData } from "./node";
|
||||
import { isNumberFinite, isString, isOptionalOf } from "common/utils";
|
||||
import { isNodeData, NodeData } from "common/model/node";
|
||||
|
||||
|
||||
export interface Media extends NodeData {
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { PopInService } from '../../service/popin';
|
||||
import { PopInService } from 'app/service/popin';
|
||||
|
||||
@Component({
|
||||
selector: 'create-type',
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
|
||||
import { PopInService } from '../../service';
|
||||
import { PopInService } from 'app/service';
|
||||
|
||||
@Component({
|
||||
selector: 'delete-confirm',
|
||||
|
@ -7,7 +7,7 @@
|
||||
import { Component, OnInit, Input, SimpleChanges } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { PopInService } from '../../service';
|
||||
import { PopInService } from 'app/service';
|
||||
|
||||
@Component({
|
||||
selector: 'upload-progress',
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
import { ArianeService } from 'app/service/ariane';
|
||||
|
||||
@Component({
|
||||
selector: 'app-error-viewer',
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
import { ArianeService } from 'app/service/ariane';
|
||||
|
||||
@Component({
|
||||
selector: 'app-help',
|
||||
|
@ -7,8 +7,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { TypeService } from '../../service/type';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
import { TypeService } from 'app/service/type';
|
||||
import { ArianeService } from 'app/service/ariane';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
|
@ -7,9 +7,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { SeasonService , ArianeService, DataService, PopInService} from '../../service';
|
||||
import { SeasonService , ArianeService, DataService, PopInService} from 'app/service';
|
||||
|
||||
import { UploadProgress } from '../../popin/upload-progress/upload-progress';
|
||||
import { UploadProgress } from 'app/popin/upload-progress/upload-progress';
|
||||
|
||||
export interface ElementList {
|
||||
value: number;
|
||||
|
@ -22,7 +22,7 @@
|
||||
<div class="title" *ngIf="videos.length > 1">Videos:</div>
|
||||
<div class="title" *ngIf="videos.length == 1">Video:</div>
|
||||
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data.id)" (auxclick)="onSelectVideo($event, data.id)">
|
||||
<app-element-video [idVideo]="data.id"></app-element-video>
|
||||
<app-element-video [element]="data"></app-element-video>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { SeasonService, DataService, SeriesService, ArianeService } from '../../service';
|
||||
import { SeasonService, DataService, SeriesService, ArianeService } from 'app/service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-season',
|
||||
|
@ -7,8 +7,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { SeriesService, DataService, TypeService, ArianeService, PopInService } from '../../service';
|
||||
import { UploadProgress } from '../../popin/upload-progress/upload-progress';
|
||||
import { SeriesService, DataService, TypeService, ArianeService, PopInService } from 'app/service';
|
||||
import { UploadProgress } from 'app/popin/upload-progress/upload-progress';
|
||||
|
||||
export class ElementList {
|
||||
constructor(
|
||||
|
@ -19,7 +19,7 @@
|
||||
<div class="title" *ngIf="seasons.length > 1">Seasons:</div>
|
||||
<div class="title" *ngIf="seasons.length == 1">Season:</div>
|
||||
<div *ngFor="let data of seasons" class="item-list" (click)="onSelectSeason($event, data.id)" (auxclick)="onSelectSeason($event, data.id)">
|
||||
<app-element-season [idSeason]="data.id"></app-element-season>
|
||||
<app-element-season [element]="data"></app-element-season>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fill-content colomn_mutiple" *ngIf="videos.length != 0">
|
||||
@ -27,7 +27,7 @@
|
||||
<div class="title" *ngIf="videos.length > 1">Videos:</div>
|
||||
<div class="title" *ngIf="videos.length == 1">Video:</div>
|
||||
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data.id)" (auxclick)="onSelectVideo($event, data.id)">
|
||||
<app-element-video [idVideo]="data.id"></app-element-video>
|
||||
<app-element-video [element]="data"></app-element-video>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
@ -7,8 +7,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { SeriesService, DataService, ArianeService } from '../../service';
|
||||
import { NodeData } from '../../model';
|
||||
import { SeriesService, DataService, ArianeService } from 'app/service';
|
||||
import { NodeData } from 'common/model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-series',
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ArianeService, DataService } from '../../service';
|
||||
import { ArianeService, DataService } from 'app/service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { SSOService, UserService } from '../../service';
|
||||
import { SSOService, UserService } from 'app/service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-sso',
|
||||
|
@ -16,14 +16,14 @@
|
||||
</div>
|
||||
<div class="fill-content colomn_mutiple">
|
||||
<div class="clear"></div>
|
||||
<div *ngFor="let data of seriess" class="item" (click)="onSelectSeries($event, data.id)" (auxclick)="onSelectSeries($event, data.id)">
|
||||
<app-element-series [idType]="typeId" [idSeries]="data.id"></app-element-series>
|
||||
<div *ngFor="let data of series" class="item" (click)="onSelectSeries($event, data.id)" (auxclick)="onSelectSeries($event, data.id)">
|
||||
<app-element-series [element]="data"></app-element-series>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fill-content colomn_mutiple">
|
||||
<div class="clear"></div>
|
||||
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data.id)" (auxclick)="onSelectVideo($event, data.id)">
|
||||
<app-element-video [idVideo]="data.id"></app-element-video>
|
||||
<app-element-video [element]="data"></app-element-video>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { TypeService, DataService, ArianeService } from '../../service';
|
||||
import { TypeService, DataService, ArianeService } from 'app/service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-type',
|
||||
@ -22,7 +22,7 @@ export class TypeScene implements OnInit {
|
||||
cover:string = null;
|
||||
covers:string[] = [];
|
||||
seriessError = '';
|
||||
seriess = [];
|
||||
series = [];
|
||||
videosError = '';
|
||||
videos = [];
|
||||
constructor(
|
||||
@ -70,11 +70,11 @@ export class TypeScene implements OnInit {
|
||||
.then((response) => {
|
||||
console.log(` ==> get answer sub-series: ${JSON.stringify(response)}`);
|
||||
self.seriessError = '';
|
||||
self.seriess = response;
|
||||
self.series = response;
|
||||
}).catch((response) => {
|
||||
console.log(` ==> get answer sub-series (ERROR): ${JSON.stringify(response)}`);
|
||||
self.seriessError = 'Wrong e-mail/login or password';
|
||||
self.seriess = [];
|
||||
self.series = [];
|
||||
});
|
||||
this.typeService.getSubVideo(this.typeId)
|
||||
.then((response) => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class="generic-page">
|
||||
<div class="fill-all colomn_mutiple">
|
||||
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data)" (auxclick)="onSelectVideo($event, data)">
|
||||
<app-element-video [idVideo]="data"></app-element-video>
|
||||
<app-element-video [element]="data"></app-element-video>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
@ -7,8 +7,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { ArianeService } from 'app/service/ariane';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-universe',
|
||||
|
@ -7,14 +7,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { PopInService } from '../../service/popin';
|
||||
import { TypeService } from '../../service/type';
|
||||
import { UniverseService } from '../../service/universe';
|
||||
import { SeriesService } from '../../service/series';
|
||||
import { VideoService } from '../../service/video';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
import { UploadProgress } from '../../popin/upload-progress/upload-progress';
|
||||
import { SeasonService } from '../../service/season';
|
||||
import { PopInService, TypeService, UniverseService, SeriesService, VideoService, ArianeService, SeasonService } from 'app/service';
|
||||
import { UploadProgress } from 'app/popin/upload-progress/upload-progress';
|
||||
|
||||
export class ElementList {
|
||||
constructor(
|
||||
|
@ -8,9 +8,9 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
|
||||
import { PopInService, DataService, TypeService, UniverseService, SeriesService, VideoService, ArianeService } from '../../service';
|
||||
import { UploadProgress } from '../../popin/upload-progress/upload-progress';
|
||||
import { NodeData } from '../../model';
|
||||
import { PopInService, DataService, TypeService, UniverseService, SeriesService, VideoService, ArianeService } from 'app/service';
|
||||
import { UploadProgress } from 'app/popin/upload-progress/upload-progress';
|
||||
import { NodeData } from 'common/model';
|
||||
|
||||
export interface ElementList {
|
||||
value?: number;
|
||||
|
@ -19,10 +19,10 @@
|
||||
</div>
|
||||
<div class="cover-full">
|
||||
<div class="cover">
|
||||
<div class="cover-image" *ngIf="cover !== null">
|
||||
<img src="{{cover}}"/>
|
||||
<div class="cover-image" *ngIf="covers">
|
||||
<img src="{{covers[0]}}"/>
|
||||
</div>
|
||||
<div class="cover-no-image" *ngIf="cover == null"></div>
|
||||
<div class="cover-no-image" *ngIf="covers"></div>
|
||||
<div class="cover-button">
|
||||
<button (click)="onRequirePlay()">
|
||||
<i class="material-icons big-button">play_circle_outline</i>
|
||||
@ -108,6 +108,9 @@
|
||||
<button class="bigForward" (click)="onForward()"><i *ngIf="!isPlaying" class="material-icons">fast_forward</i></button>
|
||||
</div>
|
||||
|
||||
<div class="title-inline" *ngIf="!isFullScreen || !isPlaying">
|
||||
{{generatedName}}
|
||||
</div>
|
||||
<div class="video-button" *ngIf="!isFullScreen || !isPlaying">
|
||||
<button (click)="onRequireStop()">
|
||||
<i class="material-icons big-button">highlight_off</i>
|
||||
|
@ -127,6 +127,15 @@
|
||||
color: #F00000;
|
||||
};
|
||||
};
|
||||
.title-inline {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
left:20px;
|
||||
margin: 0 auto;
|
||||
font-size: 25px;
|
||||
color: #888;
|
||||
//text-align: center;
|
||||
};
|
||||
|
||||
|
||||
video {
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { HttpWrapperService, DataService, VideoService, SeriesService, SeasonService, ArianeService } from '../../service';
|
||||
import { isNullOrUndefined } from '../..//utils';
|
||||
import { HttpWrapperService, DataService, VideoService, SeriesService, SeasonService, ArianeService } from 'app/service';
|
||||
import { isNullOrUndefined } from 'common/utils';
|
||||
|
||||
@Component({
|
||||
selector: 'app-video',
|
||||
@ -57,8 +57,7 @@ export class VideoScene implements OnInit {
|
||||
typeId:number = undefined;
|
||||
generatedName:string = '';
|
||||
videoSource:string = '';
|
||||
cover:string = null;
|
||||
covers:Array<string> = [];
|
||||
covers: string[];
|
||||
|
||||
playVideo:boolean = false;
|
||||
displayVolumeMenu:boolean = false;
|
||||
@ -215,14 +214,8 @@ export class VideoScene implements OnInit {
|
||||
} else {
|
||||
self.videoSource = '';
|
||||
}
|
||||
if(response.covers === undefined || response.covers === null || response.covers.length === 0) {
|
||||
self.cover = null;
|
||||
} else {
|
||||
self.cover = self.dataService.getCoverUrl(response.covers[0]);
|
||||
for(let iii = 0; iii < response.covers.length; iii++) {
|
||||
self.covers.push(self.dataService.getCoverUrl(response.covers[iii]));
|
||||
}
|
||||
}
|
||||
self.covers = self.dataService.getCoverListUrl(response.covers);
|
||||
|
||||
self.generateName();
|
||||
if(self.seriesId !== undefined && self.seriesId !== null) {
|
||||
self.seriesService.get(self.seriesId)
|
||||
@ -283,7 +276,7 @@ export class VideoScene implements OnInit {
|
||||
self.time = undefined;
|
||||
self.generatedName = '';
|
||||
self.videoSource = '';
|
||||
self.cover = null;
|
||||
self.covers = undefined;
|
||||
self.seriesName = undefined;
|
||||
self.seasonName = undefined;
|
||||
self.mediaIsNotFound = true;
|
||||
|
@ -6,14 +6,14 @@
|
||||
|
||||
import { Injectable, Output, EventEmitter } from '@angular/core';
|
||||
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { TypeService } from './type';
|
||||
import { UniverseService } from './universe';
|
||||
import { SeriesService } from './series';
|
||||
import { SeasonService } from './season';
|
||||
import { VideoService } from './video';
|
||||
import { environment } from '../../environments/environment';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
export class InputOrders {
|
||||
public typeId: number = null;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { DataInterface } from '../utils/dataInterface';
|
||||
import { DataInterface } from 'common/utils/dataInterface';
|
||||
|
||||
|
||||
@Injectable()
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { isArrayOf, isNumberFinite } from 'common/utils';
|
||||
|
||||
import { HTTPMimeType, HTTPRequestModel, HttpWrapperService, ModelResponseHttp } from './http-wrapper';
|
||||
|
||||
@ -51,18 +52,57 @@ export class DataService {
|
||||
contentType: HTTPMimeType.JSON,
|
||||
});
|
||||
}
|
||||
|
||||
getCoverUrl(coverId: number):any {
|
||||
/**
|
||||
* Retreive the Cover URL of a specific data id
|
||||
* @param coverId Id of te cover
|
||||
* @returns the url of the cover
|
||||
*/
|
||||
getCoverUrl(coverId: number): string {
|
||||
return this.http.createRESTCall2({
|
||||
api: `data/${coverId}`,
|
||||
addURLToken: true,
|
||||
});
|
||||
}
|
||||
getCoverThumbnailUrl(coverId: number):any {
|
||||
/**
|
||||
* Retreive the list Cover URL of a specific data id
|
||||
* @param coverId Id of te cover
|
||||
* @returns the url of the cover
|
||||
*/
|
||||
getCoverListUrl(coverIds?: number[]): string[] | undefined {
|
||||
if(!isArrayOf(coverIds, isNumberFinite) || coverIds.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
let covers = [] as string[];
|
||||
for(let iii = 0; iii < coverIds.length; iii++) {
|
||||
covers.push(this.getCoverUrl(coverIds[iii]));
|
||||
}
|
||||
return covers;
|
||||
}
|
||||
/**
|
||||
* Retreive the thumbnail cover URL of a specific data id
|
||||
* @param coverId Id of te cover
|
||||
* @returns the url of the cover
|
||||
*/
|
||||
getCoverThumbnailUrl(coverId: number): string {
|
||||
return this.http.createRESTCall2({
|
||||
api: `data/thumbnail/${coverId}`,
|
||||
addURLToken: true,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Retreive the list thumbnail cover URL of a specific data id
|
||||
* @param coverId Id of te cover
|
||||
* @returns the url of the cover
|
||||
*/
|
||||
getCoverListThumbnailUrl(coverIds?: number[]): string[] | undefined {
|
||||
if(!isArrayOf(coverIds, isNumberFinite) || coverIds.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
let covers = [] as string[];
|
||||
for(let iii = 0; iii < coverIds.length; iii++) {
|
||||
covers.push(this.getCoverThumbnailUrl(coverIds[iii]));
|
||||
}
|
||||
return covers;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
|
||||
|
||||
import { environment } from '../../environments/environment';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
import { SessionService } from './session';
|
||||
import { isNullOrUndefined } from '../utils';
|
||||
import { isNullOrUndefined } from 'common/utils';
|
||||
|
||||
export enum HTTPRequestModel {
|
||||
POST = "POST",
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { ArianeService } from "./ariane";
|
||||
import { BddService } from "./bdd";
|
||||
import { CookiesService } from "./cookies";
|
||||
import { DataService } from "./data";
|
||||
import { HttpWrapperService, ModelResponseHttp, HTTPRequest, HTTPMimeType, HTTPRequestModel } from "./http-wrapper";
|
||||
import { StorageService } from "./local-storage";
|
||||
import { PopInService } from "./popin";
|
||||
import { SeasonService } from "./season";
|
||||
import { SeriesService } from "./series";
|
||||
@ -17,13 +15,11 @@ import { VideoService } from "./video";
|
||||
|
||||
|
||||
export {
|
||||
CookiesService,
|
||||
HttpWrapperService,
|
||||
ModelResponseHttp,
|
||||
HTTPRequest,
|
||||
HTTPMimeType,
|
||||
HTTPRequestModel,
|
||||
StorageService,
|
||||
PopInService,
|
||||
SessionService,
|
||||
UserService,
|
||||
|
@ -7,9 +7,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { DataInterface } from '../utils';
|
||||
import { DataInterface } from 'common/utils';
|
||||
import { BddService } from './bdd';
|
||||
import { TypeCheck } from '../utils/dataInterface';
|
||||
import { TypeCheck } from 'common/utils/dataInterface';
|
||||
|
||||
@Injectable()
|
||||
export class SeasonService {
|
||||
|
@ -7,10 +7,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { DataInterface, TypeCheck } from '../utils/dataInterface';
|
||||
import { DataInterface, TypeCheck } from 'common/utils/dataInterface';
|
||||
import { BddService } from './bdd';
|
||||
import { isNodeData, NodeData } from '../model';
|
||||
import { isArrayOf, isNullOrUndefined } from '../utils';
|
||||
import { isNodeData, NodeData } from 'common/model';
|
||||
import { isArrayOf, isNullOrUndefined } from 'common/utils';
|
||||
|
||||
|
||||
@Injectable()
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from '../../environments/environment';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
@Injectable()
|
||||
export class SSOService {
|
||||
|
@ -8,9 +8,9 @@ import { Injectable } from '@angular/core';
|
||||
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { BddService } from './bdd';
|
||||
import { DataInterface, isNullOrUndefined } from '../utils';
|
||||
import { NodeData } from '../model';
|
||||
import { TypeCheck } from '../utils/dataInterface';
|
||||
import { DataInterface, isNullOrUndefined } from 'common/utils';
|
||||
import { NodeData } from 'common/model';
|
||||
import { TypeCheck } from 'common/utils/dataInterface';
|
||||
|
||||
export interface MessageLogIn {
|
||||
id: number;
|
||||
|
@ -5,10 +5,10 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from '../../environments/environment';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
import { HTTPMimeType, HTTPRequestModel, HttpWrapperService, ModelResponseHttp } from './http-wrapper';
|
||||
import { StorageService } from './local-storage';
|
||||
import { StorageService } from 'common/service/local-storage';
|
||||
import { SessionService } from './session';
|
||||
import { SSOService } from './sso';
|
||||
|
||||
|
@ -8,15 +8,12 @@ import { Injectable } from '@angular/core';
|
||||
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { BddService } from './bdd';
|
||||
import { DataInterface } from '../utils/dataInterface';
|
||||
import { DataInterface } from 'common/utils/dataInterface';
|
||||
|
||||
@Injectable()
|
||||
export class VideoService {
|
||||
// 0: Not hide password; 1 hide password;
|
||||
private identificationVersion: number = 1;
|
||||
private serviceName:string = 'video';
|
||||
|
||||
|
||||
constructor(private http: HttpWrapperService,
|
||||
private bdd: BddService) {
|
||||
console.log('Start VideoService');
|
||||
|
6
front/src/common/model/index.ts
Normal file
6
front/src/common/model/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { NodeData, isNodeData } from "./node";
|
||||
|
||||
|
||||
export {
|
||||
NodeData, isNodeData,
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
import { isArrayOf, isNumberFinite, isObject, isOptionalOf, isOptionalArrayOf, isString } from "../utils";
|
||||
import { isArrayOf, isNumberFinite, isObject, isOptionalOf, isOptionalArrayOf, isString } from "common/utils";
|
||||
|
||||
|
||||
|
9
front/src/common/service/index.ts
Normal file
9
front/src/common/service/index.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { CookiesService } from "./cookies";
|
||||
import { StorageService } from "./local-storage";
|
||||
|
||||
export {
|
||||
CookiesService,
|
||||
StorageService,
|
||||
};
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from '../../environments/environment';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
@Injectable()
|
||||
export class StorageService {
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { NodeData } from "../model";
|
||||
import { isArray, isNullOrUndefined, isUndefined } from "./validator";
|
||||
import { isArray, isNullOrUndefined } from "./validator";
|
||||
|
||||
export enum TypeCheck {
|
||||
EQUAL = '==',
|
@ -16,7 +16,7 @@ const environment_local = {
|
||||
ssoSignUp: 'http://192.168.1.156/karso/signup/karideo-dev/',
|
||||
ssoSignOut: 'http://192.168.1.156/karso/signout/karideo-dev/',
|
||||
frontBaseUrl: '',
|
||||
apiMode: 'REWRITE'
|
||||
//apiMode: 'REWRITE'
|
||||
};
|
||||
|
||||
const environment_hybrid = {
|
||||
|
@ -18,6 +18,10 @@
|
||||
"dom"
|
||||
],
|
||||
"module": "es2020",
|
||||
"baseUrl": "./"
|
||||
"baseUrl": "./src",
|
||||
"paths": {
|
||||
"@app/*": ["./src/app/*"],
|
||||
"@common/*": ["./src/common/*"]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user