[ADF-4496] Share dialog enhancements (#4705)

* raise snackbars on unshare errors

* remove time from datepicker

* update tests

* Update en.json

* code updates as per review

* update docs

* bind datetimepicker type attribute

* set datetimepicker type by configuration or default

* tests

* e2e test

* update docs

* e2e set sharedLinkDateTimePickerType config
This commit is contained in:
Denys Vuika
2019-06-06 16:32:37 +01:00
committed by Eugenio Romano
parent c3b1300d86
commit 99f4b07878
24 changed files with 381 additions and 121 deletions

View File

@@ -17,7 +17,7 @@
import { Injectable } from '@angular/core';
import { NodePaging, SharedLinkEntry } from '@alfresco/js-api';
import { Observable, from, of } from 'rxjs';
import { Observable, from, of, Subject } from 'rxjs';
import { AlfrescoApiService } from './alfresco-api.service';
import { UserPreferencesService } from './user-preferences.service';
import { catchError } from 'rxjs/operators';
@@ -27,6 +27,8 @@ import { catchError } from 'rxjs/operators';
})
export class SharedLinksApiService {
error = new Subject<{ statusCode: number, message: string }>();
constructor(private apiService: AlfrescoApiService,
private preferences: UserPreferencesService) {
}
@@ -73,11 +75,11 @@ export class SharedLinksApiService {
* @param sharedId ID of the link to delete
* @returns Null response notifying when the operation is complete
*/
deleteSharedLink(sharedId: string): Observable<SharedLinkEntry> {
deleteSharedLink(sharedId: string): Observable<any | Error> {
const promise = this.sharedLinksApi.deleteSharedLink(sharedId);
return from(promise).pipe(
catchError((err) => of(err))
catchError((err: Error) => of(err))
);
}
}