#33 draft gulp

This commit is contained in:
Mario Romano
2016-04-19 11:57:05 +01:00
parent c90fac92a8
commit 88bd8ea345
91 changed files with 52110 additions and 96 deletions

View File

@@ -1,7 +1,7 @@
import {Component} from "angular2/core";
import {Router, ROUTER_DIRECTIVES} from "angular2/router";
import {FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators} from "angular2/common";
import {Authentication} from "../services/authentication";
import {Component} from 'angular2/core';
import {Router, ROUTER_DIRECTIVES} from 'angular2/router';
import {FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators} from 'angular2/common';
import {Authentication} from '../services/authentication';
@Component({
selector: 'login',
@@ -10,31 +10,32 @@ import {Authentication} from "../services/authentication";
styleUrls: ['app/style/login.component.css'],
})
export class Login {
form: ControlGroup;
error: boolean = false;
form:ControlGroup;
error:boolean = false;
isErrorStyle(field:ControlGroup ) {
if(field.valid){
isErrorStyle(field:ControlGroup) {
if (field.valid) {
return false;
} else {
return true;
}
}
constructor(fb: FormBuilder, public auth: Authentication, public router: Router) {
constructor(fb:FormBuilder, public auth:Authentication, public router:Router) {
this.form = fb.group({
username: ['', Validators.compose([Validators.required, Validators.minLength(4)])],
password: ['', Validators.required]
username: ['', Validators.compose([Validators.required, Validators.minLength(4)])],
password: ['', Validators.required]
});
}
onSubmit(value: any, event) {
onSubmit(value:any, event) {
event.preventDefault();
this.auth.login('POST', value.username, value.password)
.subscribe(
//(token: any) => this.router.navigate(['../Home']),
(token: any) => this.router.navigate(['Home']),
() => { this.error = true; }
(token:any) => this.router.navigate(['Home']),
() => {
this.error = true;
}
);
}
}

View File

@@ -1,4 +1,4 @@
import {Component, NgZone} from "angular2/core";
import {Component, NgZone} from 'angular2/core';
import {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';
@Component({
@@ -44,8 +44,8 @@ import {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';
directives: [UPLOAD_DIRECTIVES]
})
export class Page1View {
uploadFile: any;
options: Object = {
uploadFile:any;
options:Object = {
url: 'http://192.168.99.100:8080/alfresco/service/api/upload',
withCredentials: true,
authToken: btoa('admin:admin'),
@@ -57,27 +57,26 @@ export class Page1View {
}
};
zone: NgZone;
dropProgress: number = 0;
dropResp: any[] = [];
zone:NgZone;
dropProgress:number = 0;
dropResp:any[] = [];
constructor() {
this.zone = new NgZone({ enableLongStackTrace: false });
this.zone = new NgZone({enableLongStackTrace: false});
}
handleUpload(data): void {
handleUpload(data):void {
if (data && data.response) {
data = JSON.parse(data.response);
this.uploadFile = data;
}
}
handleDropUpload(data): void {
handleDropUpload(data):void {
let index = this.dropResp.findIndex(x => x.id === data.id);
if (index === -1) {
this.dropResp.push(data);
}
else {
} else {
this.zone.run(() => {
this.dropResp[index] = data;
});

View File

@@ -1,4 +1,4 @@
import {Component} from "angular2/core";
import {Component} from 'angular2/core';
import {HelloWorld} from 'ng2-alfresco/components';
@Component({