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">
<input class="mdl-textfield__input" type="text" id="userSearchText" [value]=""
[formControl]="searchUser"/>
<input class="mdl-textfield__input" type="text" id="userSearchText" [value]="" [formControl]="searchUser"/>
<label class="mdl-textfield__label" for="userSearchText">Search user</label>
</div>
<ul class='mdl-list'>
<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">
<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>
</button>
</li>

View File

@@ -32,10 +32,10 @@ declare let componentHandler: any;
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()
iconImageUrl: string;
iconImageUrl: string = this.baseComponentPath + 'assets/images/user.jpg';
@Input()
results: Observable<User[]>;

View File

@@ -8,7 +8,7 @@
<ul class='mdl-list'>
<li class="mdl-list__item" *ngFor="let user of people">
<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>
<a *ngIf="!readOnly" class="mdl-chip__action"><i id="remove-{{user.id}}" (click)="removeInvolvedUser(user)" class="material-icons people__icon">cancel</i></a>
</span>

View File

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

View File

@@ -31,6 +31,8 @@ import { TaskQueryRequestRepresentationModel } from '../models/filter.model';
})
export class ActivitiTaskDetails implements OnInit, OnChanges {
private baseComponentPath: string = module.id.replace('components/activiti-task-details.component', '');
@ViewChild('activiticomments')
activiticomments: any;
@@ -77,7 +79,7 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
showFormRefreshButton: boolean = true;
@Input()
peopleIconImageUrl: string;
peopleIconImageUrl: string = this.baseComponentPath + 'assets/images/user.jpg';
@Output()
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__drag-drop">Drag and Drop</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>
</template>
</no-content-template>

View File

@@ -52,10 +52,10 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
static DOUBLE_CLICK_NAVIGATION: string = 'dblclick';
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()
fallbackThumbnail: string = this.baseComponentPath + '/assets/images/ft_ic_miscellaneous.svg';
fallbackThumbnail: string = this.baseComponentPath + 'assets/images/ft_ic_miscellaneous.svg';
@Input()
navigate: boolean = true;
@@ -87,6 +87,9 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
@Input()
pageSize: number = DocumentListComponent.DEFAULT_PAGE_SIZE;
@Input()
emptyFolderImageUrl: string = this.baseComponentPath + 'assets/images/empty_doc_lib.svg';
skipCount: number = 0;
pagination: Pagination;

View File

@@ -26,7 +26,7 @@ describe('ShareDataTableAdapter', () => {
let documentListService: DocumentListServiceMock;
beforeEach(() => {
basePath = '/root';
basePath = '/root/';
documentListService = new DocumentListServiceMock();
});
@@ -219,7 +219,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' };
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', () => {
@@ -232,7 +232,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' };
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', () => {
@@ -245,7 +245,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' };
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', () => {
@@ -257,7 +257,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' };
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', () => {
@@ -281,7 +281,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' };
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', () => {
@@ -311,7 +311,7 @@ describe('ShareDataTableAdapter', () => {
let col = <DataColumn> { type: 'image', key: '$thumbnail' };
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', () => {
@@ -351,10 +351,10 @@ describe('ShareDataTableAdapter', () => {
let row = new ShareDataRow(file);
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);
expect(value).toBe(`/root/assets/images/${fileName}`);
expect(value).toBe(`${basePath}assets/images/${fileName}`);
expect(documentListService.getMimeTypeIcon).toHaveBeenCalled();
});

View File

@@ -223,7 +223,7 @@ export class ShareDataTableAdapter implements DataTableAdapter {
}
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"
[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">
<form [formGroup]="form" (submit)="onSubmit(form.value, $event)">
<div class="mdl-card__title alfresco-logo">
<!--HEADER TEMPLATE-->
<template *ngIf="headerTemplate"
ngFor [ngForOf]="[data]"
[ngForTemplate]="headerTemplate">
</template>
<img *ngIf="!headerTemplate" class="center"
[src]="logoImageUrl || baseComponentPath + '/../assets/images/alfresco-logo.svg'"
alt="{{'LOGIN.LOGO' | translate }}">
<img *ngIf="!headerTemplate" class="center" [src]="logoImageUrl" alt="{{'LOGIN.LOGO' | translate }}">
</div>
<div class="mdl-card__supporting-text">

View File

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

View File

@@ -68,7 +68,7 @@ export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges {
@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,
private translateService: AlfrescoTranslationService,
@@ -130,12 +130,12 @@ export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges {
return this.resolveIconPath(icon);
}
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 {
return `${this.baseComponentPath}/assets/images/${icon}`;
return `${this.baseComponentPath}assets/images/${icon}`;
}
/**

View File

@@ -16,7 +16,7 @@
<template>
<div class="empty_template">
<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>
</template>
<template>

View File

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