Skip to content

Commit

Permalink
Merge pull request #11681 from abpframework/feat/11679
Browse files Browse the repository at this point in the history
remove text-center class from boolean prop type.
  • Loading branch information
mahmut-gundogdu authored Mar 4, 2022
2 parents 03e1796 + 1ca40e9 commit 02f4bd7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
(click)="
prop.action && prop.action({ getInjected: getInjected, record: row, index: i })
"
[ngClass]="entityPropTypeClasses[prop.type]"
[class.pointer]="prop.action"
></div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ import { EntityActionList } from '../../models/entity-actions';
import { EntityProp, EntityPropList } from '../../models/entity-props';
import { PropData } from '../../models/props';
import { ExtensionsService } from '../../services/extensions.service';
import { EXTENSIONS_IDENTIFIER, PROP_DATA_STREAM } from '../../tokens/extensions.token';
import {
ENTITY_PROP_TYPE_CLASSES,
EntityPropTypeClass,
EXTENSIONS_IDENTIFIER,
PROP_DATA_STREAM,
} from '../../tokens/extensions.token';

const DEFAULT_ACTIONS_COLUMN_WIDTH = 150;

Expand Down Expand Up @@ -62,6 +67,8 @@ export class ExtensibleTableComponent<R = any> implements OnChanges {

hasAtLeastOnePermittedAction: boolean;

entityPropTypeClasses: EntityPropTypeClass;

readonly columnWidths: number[];

readonly propList: EntityPropList<R>;
Expand All @@ -75,6 +82,7 @@ export class ExtensibleTableComponent<R = any> implements OnChanges {
private config: ConfigStateService,
private injector: Injector,
) {
this.entityPropTypeClasses = injector.get(ENTITY_PROP_TYPE_CLASSES);
this.getInjected = injector.get.bind(injector);
const extensions = injector.get(ExtensionsService);
const name = injector.get(EXTENSIONS_IDENTIFIER);
Expand Down Expand Up @@ -104,8 +112,8 @@ export class ExtensibleTableComponent<R = any> implements OnChanges {

private getIcon(value: boolean) {
return value
? '<div class="text-center text-success"><i class="fa fa-check"></i></div>'
: '<div class="text-center text-danger"><i class="fa fa-times"></i></div>';
? '<div class="text-success"><i class="fa fa-check"></i></div>'
: '<div class="text-danger"><i class="fa fa-times"></i></div>';
}

private getEnum(rowValue: any, list: Array<ABP.Option<any>>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { InjectionToken } from '@angular/core';
import { ActionCallback, ReadonlyActionData as ActionData } from '../models/actions';
import { ExtensionsService } from '../services/extensions.service';
import { Observable } from 'rxjs';
import { ePropType } from '../enums/props.enum';

export const EXTENSIONS_IDENTIFIER = new InjectionToken<string>('EXTENSIONS_IDENTIFIER');
export type ActionKeys = Extract<'entityActions' | 'toolbarActions', keyof ExtensionsService>;
Expand All @@ -13,3 +14,13 @@ export const EXTENSIONS_ACTION_CALLBACK = new InjectionToken<ActionCallback<unkn
'EXTENSIONS_ACTION_DATA',
);
export const PROP_DATA_STREAM = new InjectionToken<Observable<any>>('PROP_DATA_STREAM');
type EntityPropTypeClassMap = {
[key in ePropType]: string;
};
export type EntityPropTypeClass = Partial<EntityPropTypeClassMap>;
export const ENTITY_PROP_TYPE_CLASSES = new InjectionToken<EntityPropTypeClass>(
'ENTITY_PROP_TYPE_CLASSES',
{
factory: () => ({} as EntityPropTypeClass),
},
);

0 comments on commit 02f4bd7

Please sign in to comment.