Added changes from Release Notes Drop 5
This commit is contained in:
parent
333f0a6d64
commit
c9e956c556
|
@ -9,6 +9,7 @@
|
|||
"externals": {
|
||||
"@microsoft/sp-client-base": "node_modules/@microsoft/sp-client-base/dist/sp-client-base.js",
|
||||
"@microsoft/sp-client-preview": "node_modules/@microsoft/sp-client-preview/dist/sp-client-preview.js",
|
||||
"@microsoft/sp-webpart-base": "node_modules/@microsoft/sp-webpart-base/dist/sp-webpart-base.js",
|
||||
"@microsoft/sp-lodash-subset": "node_modules/@microsoft/sp-lodash-subset/dist/sp-lodash-subset.js",
|
||||
"office-ui-fabric-react": "node_modules/office-ui-fabric-react/dist/office-ui-fabric-react.js",
|
||||
"react": "node_modules/react/dist/react.min.js",
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"dependencies": {
|
||||
"@microsoft/sp-client-base": "~0.4.0",
|
||||
"@microsoft/sp-client-preview": "~0.5.0",
|
||||
"@microsoft/sp-webpart-base": "^0.1.0",
|
||||
"ng-office-ui-fabric": "^0.12.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
IPropertyPaneSettings,
|
||||
IWebPartContext,
|
||||
PropertyPaneTextField
|
||||
} from '@microsoft/sp-client-preview';
|
||||
} from '@microsoft/sp-webpart-base';
|
||||
import ModuleLoader from '@microsoft/sp-module-loader';
|
||||
import * as angular from 'angular';
|
||||
import './app/FileUploadModule';
|
||||
|
@ -31,14 +31,14 @@ export default class AngularFileUploadWebPart extends BaseClientSideWebPart<IAng
|
|||
</div>
|
||||
</div>
|
||||
<div class="ms-Grid-row ${styles.whiteBackground} ${styles.row}">
|
||||
<div class="ms-Grid-col ms-u-sm5 ms-u-md7 ms-u-lg7 ms-fontColor-black"><input type="file" data-custom-file-change="vm.file" /></div>
|
||||
<div class="ms-Grid-col ms-u-sm5 ms-u-md7 ms-u-lg7 ms-fontColor-black"><input type="file" value="vm.file.fileName" data-custom-file-change="vm.file" /></div>
|
||||
<div class="ms-Grid-col ms-u-sm2 ms-u-md2 ms-u-lg2"><uif-spinner data-ng-if="vm.isUploading"></uif-spinner></div>
|
||||
<div class="ms-Grid-col ms-u-sm5 ms-u-md3 ms-u-lg3"><uif-button uif-type="primary" data-ng-click="vm.upload()">Upload</uif-button></div>
|
||||
</div>
|
||||
|
||||
<div class="ms-Grid-row">
|
||||
<div class="ms-Grid-col ms-u-sm12 ms-u-md12 ms-u-lg12">
|
||||
<h1 class="ms-fontSize-su ms-fontColor-white ${styles.textAlignCenter}">${this.properties.libraryTitle}: Files uploaded by You</h1>
|
||||
<h1 class="ms-fontSize-su ms-fontColor-white ${styles.textAlignCenter}">{{vm.libraryTitle}}: Files uploaded by You</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -4,16 +4,16 @@ export class CustomFileChange implements ng.IDirective {
|
|||
|
||||
}
|
||||
|
||||
restrict = "A";
|
||||
link = (scope: ng.IScope, element: any, attrs: any) => {
|
||||
let model = this.$parse(attrs.customFileChange);
|
||||
let modelSetter = model.assign;
|
||||
public restrict = "A";
|
||||
public link = (scope: ng.IScope, element: any, attrs: any) => {
|
||||
const model = this.$parse(attrs.customFileChange);
|
||||
const modelSetter = model.assign;
|
||||
element.bind("change", (): void => {
|
||||
scope.$apply((): void => {
|
||||
let reader = new FileReader();
|
||||
const reader = new FileReader();
|
||||
|
||||
reader.onload = (event: any): void => {
|
||||
let fileModel: IFile = {
|
||||
const fileModel: IFile = {
|
||||
fileName: element[0].files[0].name,
|
||||
fileAsBuffer: event.target.result
|
||||
};
|
||||
|
@ -28,7 +28,7 @@ export class CustomFileChange implements ng.IDirective {
|
|||
});
|
||||
};
|
||||
|
||||
static factory(): ng.IDirectiveFactory {
|
||||
public static factory(): ng.IDirectiveFactory {
|
||||
const directive = ($parse: ng.IParseService) => new CustomFileChange($parse);
|
||||
directive.$inject = ['$parse'];
|
||||
return directive;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export class IsoToDateString {
|
||||
static filter() {
|
||||
public static filter() {
|
||||
return (value: string): string => {
|
||||
return (<any>String).format("{0:yyyy}-{0:MM}-{0:dd}", new Date(value));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -48,9 +48,9 @@ export class BaseService {
|
|||
"content-Type": "application/json;odata=verbose"
|
||||
},
|
||||
data: JSON.stringify(requestBody)
|
||||
})
|
||||
});
|
||||
}).then((response: ng.IHttpPromiseCallbackArg<any>): void => {
|
||||
deferred.resolve(response.data)
|
||||
deferred.resolve(response.data);
|
||||
}, (error: any): void => {
|
||||
const iError: IError = {
|
||||
code: error.data.error.code,
|
||||
|
@ -78,7 +78,7 @@ export class BaseService {
|
|||
'X-HTTP-Method': 'MERGE'
|
||||
},
|
||||
data: JSON.stringify(requestBody)
|
||||
})
|
||||
});
|
||||
}).then((response: {}): void => {
|
||||
deferred.resolve();
|
||||
}, (error: any): void => {
|
||||
|
@ -106,7 +106,7 @@ export class BaseService {
|
|||
'IF-MATCH': eTag,
|
||||
'X-HTTP-Method': 'DELETE'
|
||||
}
|
||||
})
|
||||
});
|
||||
}).then((response: {}): void => {
|
||||
deferred.resolve();
|
||||
}, (error: any): void => {
|
||||
|
@ -135,9 +135,9 @@ export class BaseService {
|
|||
"content-Type": undefined
|
||||
},
|
||||
data: ArrayBuffer
|
||||
})
|
||||
});
|
||||
}).then((response: ng.IHttpPromiseCallbackArg<any>): void => {
|
||||
deferred.resolve(response.data)
|
||||
deferred.resolve(response.data);
|
||||
}, (error: any): void => {
|
||||
const iError: IError = {
|
||||
code: error.data.error.code,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export class IFileItem {
|
||||
export interface IFileItem {
|
||||
Id: number;
|
||||
FileLeafRef: string;
|
||||
Modified: Date;
|
||||
|
|
Loading…
Reference in New Issue