Skip to content

Commit

Permalink
update: remove unused dependency and apply model utility
Browse files Browse the repository at this point in the history
  • Loading branch information
sumeyyeKurtulus committed Jul 18, 2024
1 parent 4700fbb commit 635aeb4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Type } from '@angular/core';
import { O } from 'ts-toolbelt';
import {
Action,
ActionContributorCallback,
Expand All @@ -9,6 +8,7 @@ import {
ActionsFactory,
} from './actions';
import { FormPropTooltip } from './form-props';
import { FilteredWithOptions, PartialWithOptions } from '../utils/model.utils';

export class EntityActionList<R = any> extends ActionList<R, EntityAction<R>> {}

Expand Down Expand Up @@ -48,10 +48,8 @@ export class EntityAction<R = any> extends Action<R> {
}

type OptionalKeys = 'permission' | 'visible' | 'icon';
type PartialEntityActionOptions<R = any> = O.Partial<O.Pick<EntityAction<R>, OptionalKeys>>;
type FilteredEntityActionOptions<R = any> = O.Omit<EntityAction<R>, OptionalKeys>;
export type EntityActionOptions<R = any> = PartialEntityActionOptions<R> &
FilteredEntityActionOptions<R>;
export type EntityActionOptions<R = any> = PartialWithOptions<EntityAction<R>, OptionalKeys> &
FilteredWithOptions<EntityAction<R>, OptionalKeys>;

export type EntityActionDefaults<R = any> = Record<string, EntityAction<R>[]>;
export type EntityActionContributorCallback<R = any> = ActionContributorCallback<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ABP, escapeHtmlChars } from '@abp/ng.core';
import { InjectFlags, InjectOptions, InjectionToken, Type } from '@angular/core';
import { Observable, of } from 'rxjs';
import { O } from 'ts-toolbelt';
import { ActionCallback } from './actions';
import {
Prop,
Expand All @@ -13,6 +12,7 @@ import {
PropsFactory,
} from './props';
import { FormPropTooltip } from './form-props';
import { FilteredWithOptions, PartialWithOptions } from '../utils/model.utils';

export class EntityPropList<R = any> extends PropList<R, EntityProp<R>> {}

Expand Down Expand Up @@ -83,10 +83,8 @@ type OptionalKeys =
| 'action'
| 'component'
| 'enumList';

type PartialEntityPropOptions<R = any> = O.Partial<O.Pick<EntityProp<R>, OptionalKeys>>;
type FilteredEntityPropOptions<R = any> = O.Omit<EntityProp<R>, OptionalKeys>;
export type EntityPropOptions<R = any> = PartialEntityPropOptions<R> & FilteredEntityPropOptions<R>;
export type EntityPropOptions<R = any> = PartialWithOptions<EntityProp<R>, OptionalKeys> &
FilteredWithOptions<EntityProp<R>, OptionalKeys>;

export type EntityPropDefaults<R = any> = Record<string, EntityProp<R>[]>;
export type EntityPropContributorCallback<R = any> = PropContributorCallback<EntityPropList<R>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ABP } from '@abp/ng.core';
import { Injector, Type } from '@angular/core';
import { AsyncValidatorFn, ValidatorFn } from '@angular/forms';
import { Observable } from 'rxjs';
import { O } from 'ts-toolbelt';
import {
Prop,
PropCallback,
Expand All @@ -15,6 +14,7 @@ import {
Props,
PropsFactory,
} from './props';
import { FilteredWithOptions, PartialWithOptions } from '../utils/model.utils';

export class FormPropList<R = any> extends PropList<R, FormProp<R>> {}

Expand Down Expand Up @@ -147,9 +147,8 @@ type OptionalKeys =
| 'displayTextResolver'
| 'formText'
| 'tooltip';
type PartialFormPropOptions<R = any> = O.Partial<O.Pick<FormProp<R>, OptionalKeys>>;
type FilteredFormPropOptions<R = any> = O.Omit<FormProp<R>, OptionalKeys>;
export type FormPropOptions<R = any> = PartialFormPropOptions<R> & FilteredFormPropOptions<R>;
export type FormPropOptions<R = any> = PartialWithOptions<FormProp<R>, OptionalKeys> &
FilteredWithOptions<FormProp<R>, OptionalKeys>;

export type CreateFormPropDefaults<R = any> = Record<string, FormProp<R>[]>;
export type CreateFormPropContributorCallback<R = any> = PropContributorCallback<FormPropList<R>>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Injector, Type } from '@angular/core';
import { O } from 'ts-toolbelt';
import {
Action,
ActionContributorCallback,
Expand All @@ -10,6 +9,7 @@ import {
ActionsFactory,
ReadonlyActionData,
} from './actions';
import { FilteredWithOptions, PartialWithOptions } from '../utils/model.utils';

export class ToolbarActionList<R = any> extends ActionList<R, ToolbarActionDefault<R>> {}

Expand Down Expand Up @@ -62,18 +62,18 @@ export class ToolbarComponent<R = any> extends Action<R> {
}

type OptionalActionKeys = 'permission' | 'visible' | 'icon' | 'btnClass';
type PartialToolbarActionOptions<R = any> = O.Partial<O.Pick<ToolbarAction<R>, OptionalActionKeys>>;
type FilteredToolbarActionOptions<R = any> = O.Omit<ToolbarAction<R>, OptionalActionKeys>;
export type ToolbarActionOptions<R = any> = PartialToolbarActionOptions<R> &
FilteredToolbarActionOptions<R>;
export type ToolbarActionOptions<R = any> = PartialWithOptions<
ToolbarAction<R>,
OptionalActionKeys
> &
FilteredWithOptions<ToolbarAction<R>, OptionalActionKeys>;

type OptionalComponentKeys = 'permission' | 'visible' | 'action';
type PartialToolbarComponentOptions<R = any> = O.Partial<
O.Pick<ToolbarComponent<R>, OptionalComponentKeys>
>;
type FilteredToolbarComponentOptions<R = any> = O.Omit<ToolbarComponent<R>, OptionalComponentKeys>;
export type ToolbarComponentOptions<R = any> = PartialToolbarComponentOptions<R> &
FilteredToolbarComponentOptions<R>;
export type ToolbarComponentOptions<R = any> = PartialWithOptions<
ToolbarComponent<R>,
OptionalComponentKeys
> &
FilteredWithOptions<ToolbarComponent<R>, OptionalComponentKeys>;

export type ToolbarActionDefault<R = any> = ToolbarAction<R> | ToolbarComponent<R>;

Expand Down

0 comments on commit 635aeb4

Please sign in to comment.