mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-1108] Task header - Show the parent name as a clickable value (#2098)
* Add a MapItem component inside the CardVied Add a way to define a property clickable * Fix unit test * Add basic documentation Unify css class name * Fix class name * remove unused class
This commit is contained in:
committed by
Eugenio Romano
parent
1214c2ebab
commit
33fc2373ae
@@ -29,6 +29,7 @@ export interface CardViewItemProperties {
|
||||
key: any;
|
||||
default?: string;
|
||||
editable?: boolean;
|
||||
clickable?: boolean;
|
||||
}
|
||||
|
||||
export abstract class CardViewBaseItemModel {
|
||||
@@ -37,6 +38,7 @@ export abstract class CardViewBaseItemModel {
|
||||
key: any;
|
||||
default: string;
|
||||
editable: boolean;
|
||||
clickable: boolean;
|
||||
|
||||
constructor(obj: CardViewItemProperties) {
|
||||
this.label = obj.label || '';
|
||||
@@ -44,5 +46,6 @@ export abstract class CardViewBaseItemModel {
|
||||
this.key = obj.key;
|
||||
this.default = obj.default;
|
||||
this.editable = obj.editable || false;
|
||||
this.clickable = obj.clickable || false;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,44 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* This object represent the basic structure of a card view.
|
||||
*
|
||||
*
|
||||
* @returns {CardViewMapItemModel} .
|
||||
*/
|
||||
|
||||
import { CardViewItem } from '../interface/card-view-item.interface';
|
||||
import { CardViewBaseItemModel, CardViewItemProperties } from './card-view-baseitem.model';
|
||||
|
||||
export class CardViewMapItemModel extends CardViewBaseItemModel implements CardViewItem {
|
||||
type: string = 'map';
|
||||
value: Map<string, string>;
|
||||
|
||||
constructor(obj: CardViewItemProperties) {
|
||||
super(obj);
|
||||
}
|
||||
|
||||
get displayValue() {
|
||||
if (this.value && this.value.size > 0) {
|
||||
return this.value.values().next().value;
|
||||
} else {
|
||||
return this.default;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user