[ADF-4264] Fixed the breadcrumb when changing to custom site in node selector (#5589)

* unit test for veryfing if changing to a custom site the current breadcrumb folder is the title of the site.

* fixed the problem when changing to a custom site the breadcrumb current folder title is not changing. fixed the issue when navigating inside a node after changing to a custom site the path to the root in the breadcrumb was not the correct path.

* updated the styling for the data rows to match the styling of the breadcrumb

* if there is an error the loader should stop not only if there is a message. updated to fix the node-selector site problem when adding a non existing site, the loader would previously keep spinning even though in console was thrown an error but the clients never had an UI update about the issue.
This commit is contained in:
Urse Daniel
2020-04-03 12:55:51 +03:00
committed by GitHub
parent 03a93e45d9
commit 6d406d8a7d
4 changed files with 14 additions and 4 deletions

View File

@@ -439,6 +439,12 @@ describe('ContentNodeSelectorComponent', () => {
expect(component.chosenNode).toBeNull(); expect(component.chosenNode).toBeNull();
})); }));
it('should update the breadcrumb when changing to a custom site', fakeAsync(() => {
component.siteChanged(<SiteEntry> { entry: { guid: '-mysites-', title: 'My Sites' } });
expect(component.breadcrumbFolderTitle).toBe('My Sites');
}));
it('should call the search api on changing the site selectBox value', fakeAsync(() => { it('should call the search api on changing the site selectBox value', fakeAsync(() => {
typeToSearchBox('vegeta'); typeToSearchBox('vegeta');

View File

@@ -394,6 +394,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
onFolderChange(): void { onFolderChange(): void {
this.showingSearchResults = false; this.showingSearchResults = false;
this.infiniteScroll = false; this.infiniteScroll = false;
this.breadcrumbFolderTitle = null;
this.clearSearch(); this.clearSearch();
} }
@@ -459,6 +460,10 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
setTitleIfCustomSite(site: SiteEntry) { setTitleIfCustomSite(site: SiteEntry) {
if (this.customResourcesService.isCustomSource(site.entry.guid)) { if (this.customResourcesService.isCustomSource(site.entry.guid)) {
this.breadcrumbFolderTitle = site.entry.title; this.breadcrumbFolderTitle = site.entry.title;
if (this.documentList.folderNode.path.elements) {
this.breadcrumbFolderNode.name = site.entry.title;
this.documentList.folderNode.path.elements = null;
}
} else { } else {
this.breadcrumbFolderTitle = null; this.breadcrumbFolderTitle = null;
} }

View File

@@ -843,14 +843,13 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
if (err.message) { if (err.message) {
try { try {
if (JSON.parse(err.message).error.statusCode === 403) { if (JSON.parse(err.message).error.statusCode === 403) {
this.setLoadingState(false);
this.noPermission = true; this.noPermission = true;
} }
} catch (error) { } catch (error) {
} }
} }
this.setLoadingState(false);
this.error.emit(err); this.error.emit(err);
} }
} }

View File

@@ -267,8 +267,8 @@
.adf-datatable-row { .adf-datatable-row {
display: flex; display: flex;
align-items: center; align-items: center;
padding-left: 20px; padding-left: 15px;
padding-right: 20px; padding-right: 15px;
.adf-datatable-checkbox { .adf-datatable-checkbox {
max-width: $data-table-thumbnail-width; max-width: $data-table-thumbnail-width;