fix image paths for components (#1696)

* fix Login image paths

* fix TaskList image paths

* fix DocumentList image paths

* fix Search image paths
This commit is contained in:
Denys Vuika
2017-03-13 10:42:18 +00:00
committed by Mario Romano
parent cf85840350
commit 5b5916bfb1
14 changed files with 40 additions and 46 deletions

View File

@@ -1,12 +1,11 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="userSearchText" [value]="" <input class="mdl-textfield__input" type="text" id="userSearchText" [value]="" [formControl]="searchUser"/>
[formControl]="searchUser"/>
<label class="mdl-textfield__label" for="userSearchText">Search user</label> <label class="mdl-textfield__label" for="userSearchText">Search user</label>
</div> </div>
<ul class='mdl-list'> <ul class='mdl-list'>
<li class="mdl-list__item fix-element-user-list" *ngFor="let user of userList"> <li class="mdl-list__item fix-element-user-list" *ngFor="let user of userList">
<button (click)="onRowClick(user)" id="user-{{user.id}}" class="mdl-chip mdl-chip--contact mdl-chip-search-people"> <button (click)="onRowClick(user)" id="user-{{user.id}}" class="mdl-chip mdl-chip--contact mdl-chip-search-people">
<img class="mdl-chip__contact" [src]="iconImageUrl || baseComponentPath + '/../assets/images/user.jpg'" /> <img class="mdl-chip__contact" [src]="iconImageUrl" />
<span class="mdl-chip__text mdl-chip-search-people__text">{{getDisplayUser(user)}}</span> <span class="mdl-chip__text mdl-chip-search-people__text">{{getDisplayUser(user)}}</span>
</button> </button>
</li> </li>

View File

@@ -32,10 +32,10 @@ declare let componentHandler: any;
export class ActivitiPeopleSearch implements OnInit, AfterViewInit { export class ActivitiPeopleSearch implements OnInit, AfterViewInit {
baseComponentPath = module.id.replace('/activiti-people-search.component.js', ''); private baseComponentPath: string = module.id.replace('components/activiti-people-search.component.js', '');
@Input() @Input()
iconImageUrl: string; iconImageUrl: string = this.baseComponentPath + 'assets/images/user.jpg';
@Input() @Input()
results: Observable<User[]>; results: Observable<User[]>;

View File

@@ -8,7 +8,7 @@
<ul class='mdl-list'> <ul class='mdl-list'>
<li class="mdl-list__item" *ngFor="let user of people"> <li class="mdl-list__item" *ngFor="let user of people">
<span class="mdl-chip mdl-chip--contact mdl-chip--deletable"> <span class="mdl-chip mdl-chip--contact mdl-chip--deletable">
<img class="mdl-chip__contact" [src]="iconImageUrl || baseComponentPath + '/../assets/images/user.jpg'" /> <img class="mdl-chip__contact" [src]="iconImageUrl" />
<span id="user-{{user.id}}" class="mdl-chip__text">{{getDisplayUser(user)}}</span> <span id="user-{{user.id}}" class="mdl-chip__text">{{getDisplayUser(user)}}</span>
<a *ngIf="!readOnly" class="mdl-chip__action"><i id="remove-{{user.id}}" (click)="removeInvolvedUser(user)" class="material-icons people__icon">cancel</i></a> <a *ngIf="!readOnly" class="mdl-chip__action"><i id="remove-{{user.id}}" (click)="removeInvolvedUser(user)" class="material-icons people__icon">cancel</i></a>
</span> </span>

View File

@@ -31,10 +31,10 @@ declare let dialogPolyfill: any;
}) })
export class ActivitiPeople { export class ActivitiPeople {
baseComponentPath = module.id.replace('/activiti-people.component.js', ''); private baseComponentPath: string = module.id.replace('components/activiti-people.component.js', '');
@Input() @Input()
iconImageUrl: string; iconImageUrl: string = this.baseComponentPath + 'assets/images/user.jpg';
@Input() @Input()
people: User [] = []; people: User [] = [];

View File

@@ -31,6 +31,8 @@ import { TaskQueryRequestRepresentationModel } from '../models/filter.model';
}) })
export class ActivitiTaskDetails implements OnInit, OnChanges { export class ActivitiTaskDetails implements OnInit, OnChanges {
private baseComponentPath: string = module.id.replace('components/activiti-task-details.component', '');
@ViewChild('activiticomments') @ViewChild('activiticomments')
activiticomments: any; activiticomments: any;
@@ -77,7 +79,7 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
showFormRefreshButton: boolean = true; showFormRefreshButton: boolean = true;
@Input() @Input()
peopleIconImageUrl: string; peopleIconImageUrl: string = this.baseComponentPath + 'assets/images/user.jpg';
@Output() @Output()
formSaved: EventEmitter<FormModel> = new EventEmitter<FormModel>(); formSaved: EventEmitter<FormModel> = new EventEmitter<FormModel>();

View File

@@ -23,7 +23,7 @@
<div class="document-list__this-space-is-empty">This folder is empty</div> <div class="document-list__this-space-is-empty">This folder is empty</div>
<div class="document-list__drag-drop">Drag and Drop</div> <div class="document-list__drag-drop">Drag and Drop</div>
<div class="document-list__any-files-here-to-add">any files here to add</div> <div class="document-list__any-files-here-to-add">any files here to add</div>
<img [src]="baseComponentPath + '/assets/images/empty_doc_lib.svg'" class="document-list__empty_doc_lib"> <img [src]="emptyFolderImageUrl" class="document-list__empty_doc_lib">
</div> </div>
</template> </template>
</no-content-template> </no-content-template>

View File

@@ -52,10 +52,10 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
static DOUBLE_CLICK_NAVIGATION: string = 'dblclick'; static DOUBLE_CLICK_NAVIGATION: string = 'dblclick';
static DEFAULT_PAGE_SIZE: number = 20; static DEFAULT_PAGE_SIZE: number = 20;
baseComponentPath = module.id.replace('/components/document-list.component.js', ''); baseComponentPath = module.id.replace('components/document-list.component.js', '');
@Input() @Input()
fallbackThumbnail: string = this.baseComponentPath + '/assets/images/ft_ic_miscellaneous.svg'; fallbackThumbnail: string = this.baseComponentPath + 'assets/images/ft_ic_miscellaneous.svg';
@Input() @Input()
navigate: boolean = true; navigate: boolean = true;
@@ -87,6 +87,9 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
@Input() @Input()
pageSize: number = DocumentListComponent.DEFAULT_PAGE_SIZE; pageSize: number = DocumentListComponent.DEFAULT_PAGE_SIZE;
@Input()
emptyFolderImageUrl: string = this.baseComponentPath + 'assets/images/empty_doc_lib.svg';
skipCount: number = 0; skipCount: number = 0;
pagination: Pagination; pagination: Pagination;

View File

@@ -26,7 +26,7 @@ describe('ShareDataTableAdapter', () => {
let documentListService: DocumentListServiceMock; let documentListService: DocumentListServiceMock;
beforeEach(() => { beforeEach(() => {
basePath = '/root'; basePath = '/root/';
documentListService = new DocumentListServiceMock(); documentListService = new DocumentListServiceMock();
}); });
@@ -219,7 +219,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' }; let col = <DataColumn> { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col); let value = adapter.getValue(row, col);
expect(value).toBe(`${basePath}/assets/images/ft_ic_miscellaneous.svg`); expect(value).toBe(`${basePath}assets/images/ft_ic_miscellaneous.svg`);
}); });
it('should generate fallback icon for a file thumbnail with missing mime type', () => { it('should generate fallback icon for a file thumbnail with missing mime type', () => {
@@ -232,7 +232,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' }; let col = <DataColumn> { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col); let value = adapter.getValue(row, col);
expect(value).toBe(`${basePath}/assets/images/ft_ic_miscellaneous.svg`); expect(value).toBe(`${basePath}assets/images/ft_ic_miscellaneous.svg`);
}); });
it('should generate fallback icon for a file with no content entry', () => { it('should generate fallback icon for a file with no content entry', () => {
@@ -245,7 +245,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' }; let col = <DataColumn> { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col); let value = adapter.getValue(row, col);
expect(value).toBe(`${basePath}/assets/images/ft_ic_miscellaneous.svg`); expect(value).toBe(`${basePath}assets/images/ft_ic_miscellaneous.svg`);
}); });
it('should generate fallback icon when document service fails to find one', () => { it('should generate fallback icon when document service fails to find one', () => {
@@ -257,7 +257,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' }; let col = <DataColumn> { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col); let value = adapter.getValue(row, col);
expect(value).toBe(`${basePath}/assets/images/ft_ic_miscellaneous.svg`); expect(value).toBe(`${basePath}assets/images/ft_ic_miscellaneous.svg`);
}); });
it('should return image value unmodified', () => { it('should return image value unmodified', () => {
@@ -281,7 +281,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' }; let col = <DataColumn> { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col); let value = adapter.getValue(row, col);
expect(value).toBe(`${basePath}/assets/images/ft_ic_folder.svg`); expect(value).toBe(`${basePath}assets/images/ft_ic_folder.svg`);
}); });
it('should resolve file thumbnail', () => { it('should resolve file thumbnail', () => {
@@ -311,7 +311,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' }; let col = <DataColumn> { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col); let value = adapter.getValue(row, col);
expect(value).toBe(`${basePath}/assets/images/ft_ic_miscellaneous.svg`); expect(value).toBe(`${basePath}assets/images/ft_ic_miscellaneous.svg`);
}); });
it('should require document service to resolve thumbnail', () => { it('should require document service to resolve thumbnail', () => {
@@ -351,10 +351,10 @@ describe('ShareDataTableAdapter', () => {
let row = new ShareDataRow(file); let row = new ShareDataRow(file);
let col = <DataColumn> {type: 'image', key: '$thumbnail'}; let col = <DataColumn> {type: 'image', key: '$thumbnail'};
let adapter = new ShareDataTableAdapter(documentListService, '/root', null); let adapter = new ShareDataTableAdapter(documentListService, basePath, null);
let value = adapter.getValue(row, col); let value = adapter.getValue(row, col);
expect(value).toBe(`/root/assets/images/${fileName}`); expect(value).toBe(`${basePath}assets/images/${fileName}`);
expect(documentListService.getMimeTypeIcon).toHaveBeenCalled(); expect(documentListService.getMimeTypeIcon).toHaveBeenCalled();
}); });

View File

@@ -223,7 +223,7 @@ export class ShareDataTableAdapter implements DataTableAdapter {
} }
getImagePath(id: string): any { getImagePath(id: string): any {
return `${this.basePath}/assets/images/${id}`; return `${this.basePath}assets/images/${id}`;
} }
} }

View File

@@ -1,18 +1,14 @@
<div class="content-grid mdl-grid content-layout login-content" <div class="content-grid mdl-grid content-layout login-content"
[style.background-image]="'url(' + (backgroundImageUrl || baseComponentPath + '/../assets/images/background.svg') + ')'"> [style.background-image]="'url(' + backgroundImageUrl + ')'">
<div class="login-card-wide mdl-card mdl-shadow--4dp"> <div class="login-card-wide mdl-card mdl-shadow--4dp">
<form [formGroup]="form" (submit)="onSubmit(form.value, $event)"> <form [formGroup]="form" (submit)="onSubmit(form.value, $event)">
<div class="mdl-card__title alfresco-logo"> <div class="mdl-card__title alfresco-logo">
<!--HEADER TEMPLATE--> <!--HEADER TEMPLATE-->
<template *ngIf="headerTemplate" <template *ngIf="headerTemplate"
ngFor [ngForOf]="[data]" ngFor [ngForOf]="[data]"
[ngForTemplate]="headerTemplate"> [ngForTemplate]="headerTemplate">
</template> </template>
<img *ngIf="!headerTemplate" class="center" [src]="logoImageUrl" alt="{{'LOGIN.LOGO' | translate }}">
<img *ngIf="!headerTemplate" class="center"
[src]="logoImageUrl || baseComponentPath + '/../assets/images/alfresco-logo.svg'"
alt="{{'LOGIN.LOGO' | translate }}">
</div> </div>
<div class="mdl-card__supporting-text"> <div class="mdl-card__supporting-text">

View File

@@ -31,7 +31,7 @@ declare let componentHandler: any;
}) })
export class AlfrescoLoginComponent implements OnInit { export class AlfrescoLoginComponent implements OnInit {
baseComponentPath = module.id.replace('/alfresco-login.component.js', ''); private baseComponentPath: string = module.id.replace('components/alfresco-login.component.js', '');
isPasswordShow: boolean = false; isPasswordShow: boolean = false;
@@ -42,10 +42,10 @@ export class AlfrescoLoginComponent implements OnInit {
registerLink: string = ''; registerLink: string = '';
@Input() @Input()
logoImageUrl: string; logoImageUrl: string = this.baseComponentPath + 'assets/images/alfresco-logo.svg';
@Input() @Input()
backgroundImageUrl: string; backgroundImageUrl: string = this.baseComponentPath + 'assets/images/background.svg';
@Input() @Input()
providers: string; providers: string;
@@ -69,13 +69,9 @@ export class AlfrescoLoginComponent implements OnInit {
error: boolean = false; error: boolean = false;
errorMsg: string; errorMsg: string;
success: boolean = false; success: boolean = false;
formError: { [id: string]: string }; formError: { [id: string]: string };
minLength: number = 2; minLength: number = 2;
footerTemplate: TemplateRef<any>; footerTemplate: TemplateRef<any>;
headerTemplate: TemplateRef<any>; headerTemplate: TemplateRef<any>;
private _message: { [id: string]: { [id: string]: string } }; private _message: { [id: string]: { [id: string]: string } };

View File

@@ -68,7 +68,7 @@ export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges {
@ViewChild('resultsTableBody', {}) resultsTableBody: ElementRef; @ViewChild('resultsTableBody', {}) resultsTableBody: ElementRef;
baseComponentPath: string = module.id.replace('/components/alfresco-search-autocomplete.component.js', ''); baseComponentPath: string = module.id.replace('components/alfresco-search-autocomplete.component.js', '');
constructor(private searchService: AlfrescoSearchService, constructor(private searchService: AlfrescoSearchService,
private translateService: AlfrescoTranslationService, private translateService: AlfrescoTranslationService,
@@ -130,12 +130,12 @@ export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges {
return this.resolveIconPath(icon); return this.resolveIconPath(icon);
} }
if (node.entry.isFolder) { if (node.entry.isFolder) {
return `${this.baseComponentPath}/assets/images/ft_ic_folder.svg`; return `${this.baseComponentPath}assets/images/ft_ic_folder.svg`;
} }
} }
resolveIconPath(icon: string): string { resolveIconPath(icon: string): string {
return `${this.baseComponentPath}/assets/images/${icon}`; return `${this.baseComponentPath}assets/images/${icon}`;
} }
/** /**

View File

@@ -16,7 +16,7 @@
<template> <template>
<div class="empty_template"> <div class="empty_template">
<div class="no-result-message">{{ 'SEARCH.RESULTS.NONE' | translate:{searchTerm: searchTerm} }}</div> <div class="no-result-message">{{ 'SEARCH.RESULTS.NONE' | translate:{searchTerm: searchTerm} }}</div>
<img [src]="baseComponentPath + '/assets/images/empty_doc_lib.svg'" class="no-result__empty_doc_lib"> <img [src]="emptyFolderImageUrl" class="no-result__empty_doc_lib">
</div> </div>
</template> </template>
<template> <template>

View File

@@ -32,6 +32,8 @@ export class AlfrescoSearchComponent implements OnChanges, OnInit {
static SINGLE_CLICK_NAVIGATION: string = 'click'; static SINGLE_CLICK_NAVIGATION: string = 'click';
static DOUBLE_CLICK_NAVIGATION: string = 'dblclick'; static DOUBLE_CLICK_NAVIGATION: string = 'dblclick';
private baseComponentPath: string = module.id.replace('components/alfresco-search.component.js', '');
@Input() @Input()
searchTerm: string = ''; searchTerm: string = '';
@@ -50,6 +52,9 @@ export class AlfrescoSearchComponent implements OnChanges, OnInit {
@Input() @Input()
navigationMode: string = AlfrescoSearchComponent.DOUBLE_CLICK_NAVIGATION; // click|dblclick navigationMode: string = AlfrescoSearchComponent.DOUBLE_CLICK_NAVIGATION; // click|dblclick
@Input()
emptyFolderImageUrl: string = this.baseComponentPath + 'assets/images/empty_doc_lib.svg';
@Output() @Output()
resultsLoad = new EventEmitter(); resultsLoad = new EventEmitter();
@@ -57,19 +62,12 @@ export class AlfrescoSearchComponent implements OnChanges, OnInit {
preview: EventEmitter<any> = new EventEmitter<any>(); preview: EventEmitter<any> = new EventEmitter<any>();
results: any = null; results: any = null;
pagination: Pagination; pagination: Pagination;
errorMessage; errorMessage;
queryParamName = 'q'; queryParamName = 'q';
skipCount: number = 0; skipCount: number = 0;
nodeResults: NodePaging; nodeResults: NodePaging;
baseComponentPath: string = module.id.replace('/components/alfresco-search.component.js', '');
constructor(private searchService: AlfrescoSearchService, constructor(private searchService: AlfrescoSearchService,
private translateService: AlfrescoTranslationService, private translateService: AlfrescoTranslationService,
@Optional() private route: ActivatedRoute) { @Optional() private route: ActivatedRoute) {