Skip to content
Snippets Groups Projects
Verified Commit b9d143dc authored by Damien's avatar Damien
Browse files

FEAT #7730 Front

parent bd031fbc
No related branches found
No related tags found
No related merge requests found
......@@ -16,14 +16,14 @@
</mat-sidenav>
<mat-sidenav-content>
<div>
Votre version : {{versions.currentVersion}}
<mat-form-field>
<mat-select id="entity_type" name="minorVersions" title="{{lang.availableMinorVersions}}" placeholder="{{lang.entityType}}"
maxlength="32" required>
<mat-option *ngFor="let minorVersion of versionsList.currentMinorVersions" [value]="minorVersion.name">
{{minorVersion.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-select id="entity_type" name="minorVersions" title="{{lang.availableMinorVersions}}" placeholder="{{lang.entityType}}" maxlength="32" required>
<mat-option *ngFor="let minorVersion of versions.currentMinorVersions" [value]="minorVersion.name">
{{minorVersion.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-sidenav-content>
</mat-sidenav-container>
......
......@@ -49,20 +49,11 @@ export class ActionsAdministrationComponent implements OnInit {
this.mobileQuery.removeListener(this._mobileQueryListener);
}
updateBreadcrumb(applicationName: string) {
if ($j('#ariane')[0]) {
$j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.actions;
}
}
ngOnInit(): void {
this.coreUrl = angularGlobals.coreUrl;
this.loading = true;
this.updateBreadcrumb(angularGlobals.applicationName);
$j('#inner_content').remove();
this.http.get(this.coreUrl + 'rest/actions')
.subscribe((data) => {
this.actions = data['actions'];
......
......@@ -41,12 +41,6 @@ export class ParametersAdministrationComponent implements OnInit {
this.mobileQuery.removeListener(this._mobileQueryListener);
}
updateBreadcrumb(applicationName: string) {
if ($j('#ariane')[0]) {
$j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.parameters;
}
}
applyFilter(filterValue: string) {
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // MatTableDataSource defaults to lowercase matches
......@@ -54,7 +48,6 @@ export class ParametersAdministrationComponent implements OnInit {
}
ngOnInit(): void {
this.updateBreadcrumb(angularGlobals.applicationName);
this.coreUrl = angularGlobals.coreUrl;
this.loading = true;
......
......@@ -38,14 +38,7 @@ export class ReportsAdministrationComponent implements OnInit {
this.mobileQuery.removeListener(this._mobileQueryListener);
}
updateBreadcrumb(applicationName: string) {
if ($j('#ariane')[0]) {
$j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > " + this.lang.reports;
}
}
ngOnInit(): void {
this.updateBreadcrumb(angularGlobals.applicationName);
this.coreUrl = angularGlobals.coreUrl;
this.loading = true;
......
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { MediaMatcher } from '@angular/cdk/layout';
import { HttpClient } from '@angular/common/http';
import { LANG } from '../translate.component';
import { NotificationService } from '../notification.service';
import { MatPaginator, MatTableDataSource, MatSort } from '@angular/material';
declare function $j(selector: any): any;
......@@ -11,27 +9,21 @@ declare var angularGlobals: any;
@Component({
templateUrl: "../../../../Views/versions-update-administration.component.html",
providers: [NotificationService]
templateUrl: "../../../../Views/versions-update-administration.component.html"
})
export class VersionsUpdateAdministrationComponent implements OnInit {
mobileQuery: MediaQueryList;
private _mobileQueryListener: () => void;
coreUrl: string;
lang: any = LANG;
versionsList: any = {}
availableMajorVersions: any = [];
currentMinorVersions: any = [];
currentVersion: any ;
loading: boolean = false;
displayedColumns = ['id', 'description', 'value', 'actions'];
dataSource: any;
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
mobileQuery : MediaQueryList;
private _mobileQueryListener : () => void;
coreUrl : string;
lang : any = LANG;
loading : boolean = false;
constructor(changeDetectorRef: ChangeDetectorRef, media: MediaMatcher, public http: HttpClient, private notify: NotificationService) {
versions : any = {};
constructor(changeDetectorRef: ChangeDetectorRef, media: MediaMatcher, public http: HttpClient) {
$j("link[href='merged_css.php']").remove();
this.mobileQuery = media.matchMedia('(max-width: 768px)');
this._mobileQueryListener = () => changeDetectorRef.detectChanges();
......@@ -42,58 +34,16 @@ export class VersionsUpdateAdministrationComponent implements OnInit {
this.mobileQuery.removeListener(this._mobileQueryListener);
}
updateBreadcrumb(applicationName: string) {
if ($j('#ariane')[0]) {
$j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.updateVersionControl;
}
}
applyFilter(filterValue: string) {
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // MatTableDataSource defaults to lowercase matches
this.dataSource.filter = filterValue;
}
ngOnInit(): void {
this.updateBreadcrumb(angularGlobals.applicationName);
this.coreUrl = angularGlobals.coreUrl;
this.loading = true;
this.http.get(this.coreUrl + 'rest/versionsUpdate')
.subscribe((data: any) => {
console.log(data);
this.versionsList = data;
console.log(this.versionsList);
// this.availableMajorVersions = data.availableMajorVersions;
// this.currentMinorVersions = data.currentMinorVersions;
// this.currentVersion = data.currentVersion;
/*this.parameters = data.parameters;
setTimeout(() => {
this.dataSource = new MatTableDataSource(this.parameters);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}, 0);*/
this.versions = data;
this.loading = false;
});
}
/*deleteParameter(paramId: string) {
let r = confirm(this.lang.deleteMsg);
if (r) {
this.http.delete(this.coreUrl + 'rest/parameters/' + paramId)
.subscribe((data: any) => {
this.parameters = data.parameters;
this.dataSource = new MatTableDataSource(this.parameters);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.notify.success(this.lang.parameterDeleted);
}, (err) => {
this.notify.error(err.error.errors);
});
}
}*/
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment