mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
distinguish duplicate site names (#71)
This commit is contained in:
committed by
Denys Vuika
parent
f9f98bd09c
commit
f9ecc83152
@@ -101,10 +101,12 @@ describe('Libraries Routed Component', () => {
|
||||
it('sets title with id when duplicate nodes title exists in list', () => {
|
||||
node.title = 'title';
|
||||
|
||||
component.documentList.node = {
|
||||
component.documentList.data = {
|
||||
page: {
|
||||
list: {
|
||||
entries: [<any>{ entry: { id: 'some-id', title: 'title' } }]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const title = component.makeLibraryTitle(node);
|
||||
@@ -115,10 +117,12 @@ describe('Libraries Routed Component', () => {
|
||||
it('sets title when no duplicate nodes title exists in list', () => {
|
||||
node.title = 'title';
|
||||
|
||||
component.paging = {
|
||||
component.documentList.data = {
|
||||
page: {
|
||||
list: {
|
||||
entries: [<any>{ entry: { id: 'some-id', title: 'title-some-id' } }]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const title = component.makeLibraryTitle(node);
|
||||
|
@@ -45,9 +45,11 @@ export class LibrariesComponent extends PageComponent {
|
||||
|
||||
makeLibraryTitle(library: any): string {
|
||||
const { title, id } = library;
|
||||
const { entries } = this.documentList.data.page.list;
|
||||
let isDuplicate = false;
|
||||
if (this.documentList.node) {
|
||||
isDuplicate = this.documentList.node.list.entries
|
||||
|
||||
if (entries) {
|
||||
isDuplicate = entries
|
||||
.some(({ entry }: any) => {
|
||||
return (entry.id !== id && entry.title === title);
|
||||
});
|
||||
|
Reference in New Issue
Block a user