mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-2200] Upload dialog title should match selected site. (#5648)
* [AAE-2200] content-node-selector-panel pass starting site and emit event onSiteChange * [AAE-2200] content-node-selector handle siteChange event * [AAE-2200] content-node-selector has good default title * [AAE-2200] attach-file-widget-dialog handle siteChange event * [AAE-2200] Minor fixes on attach-file-widget-dialog * [AAE-2200] site-dropdown reload site list unfil it find its default site * [AAE-2200] Fix title translation for attach-file-widget-dialog * fix missing property description * Unit test fix * [AAE-2200] Fix title unit tests * [AAE-2200] Fix sites-dropdown infinite loading * [AAE-2200] Add content-node-selector-panel siteChange event unit tests * [AAE-2200] Refactor sites-dropdown unit tests * [AAE-2200] Refactor the 'allSitesLoaded' check * [AAE-2200] Add sites-dorpdown default value unit tests * [AAE-2200] Move getSiteFromNodePath method to sites service * [create preview] * [create preview] * [AAE-2200] Better hasMoreItems check in sites-dropdown (fix unit test) Co-authored-by: Eugenio Romano <eugenio.romano@alfresco.com> Co-authored-by: Cano <david.cano.nieto@gmail.com> Co-authored-by: Eugenio Romano <eromano@users.noreply.github.com>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
import { LogService } from '../../services/log.service';
|
||||
import { SitesService } from '../../services/sites.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlfrescoApiCompatibility, MinimalNode, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
@@ -33,7 +34,8 @@ export class ActivitiContentService {
|
||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private logService: LogService) {
|
||||
private logService: LogService,
|
||||
private sitesService: SitesService) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,7 +96,7 @@ export class ActivitiContentService {
|
||||
|
||||
applyAlfrescoNode(node: MinimalNode, siteId: string, accountId: string) {
|
||||
const apiService: AlfrescoApiCompatibility = this.apiService.getInstance();
|
||||
const currentSideId = siteId ? siteId : this.getSiteNameFromNodePath(node);
|
||||
const currentSideId = siteId ? siteId : this.sitesService.getSiteNameFromNodePath(node);
|
||||
const params: RelatedContentRepresentation = {
|
||||
source: accountId,
|
||||
mimeType: node.content.mimeType,
|
||||
@@ -109,18 +111,6 @@ export class ActivitiContentService {
|
||||
);
|
||||
}
|
||||
|
||||
private getSiteNameFromNodePath(node: MinimalNode): string {
|
||||
let siteName = '';
|
||||
if (node.path) {
|
||||
const foundNode = node.path
|
||||
.elements.find((pathNode: MinimalNode) =>
|
||||
pathNode.nodeType === 'st:site' &&
|
||||
pathNode.name !== 'Sites');
|
||||
siteName = foundNode ? foundNode.name : '';
|
||||
}
|
||||
return siteName.toLocaleLowerCase();
|
||||
}
|
||||
|
||||
toJson(res: any) {
|
||||
if (res) {
|
||||
return res || {};
|
||||
|
Reference in New Issue
Block a user