Skip to content

Commit

Permalink
refactor(service): rename GridExtraService to GridService
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed May 26, 2018
1 parent daf98c1 commit d81b37b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
12 changes: 6 additions & 6 deletions aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
FilterService,
GraphqlService,
GridEventService,
GridExtraService,
GridService,
GridStateService,
GroupingAndColspanService,
ResizerService,
Expand All @@ -67,7 +67,7 @@ const eventPrefix = 'sg';
FilterService,
GraphqlService,
GridEventService,
GridExtraService,
GridService,
GridStateService,
GroupingAndColspanService,
I18N,
Expand Down Expand Up @@ -107,7 +107,7 @@ export class AureliaSlickgridCustomElement {
private filterService: FilterService,
private graphqlService: GraphqlService,
private gridEventService: GridEventService,
private gridExtraService: GridExtraService,
private gridService: GridService,
private gridStateService: GridStateService,
private groupingAndColspanService: GroupingAndColspanService,
private i18n: I18N,
Expand Down Expand Up @@ -172,8 +172,8 @@ export class AureliaSlickgridCustomElement {
this.groupingAndColspanService.init(this.grid, this.dataview);
}

// attach grid extra service
this.gridExtraService.init(this.grid, this.dataview);
// initialize grid service
this.gridService.init(this.grid, this.dataview);

// when user enables translation, we need to translate Headers on first pass & subsequently in the attachDifferentHooks
if (this.gridOptions.enableTranslate) {
Expand All @@ -200,7 +200,7 @@ export class AureliaSlickgridCustomElement {
filterService: this.filterService,
gridEventService: this.gridEventService,
gridStateService: this.gridStateService,
gridService: this.gridExtraService,
gridService: this.gridService,
groupingService: this.groupingAndColspanService,
pluginService: this.controlAndPluginService,
resizerService: this.resizer,
Expand Down
37 changes: 21 additions & 16 deletions aurelia-slickgrid/src/aurelia-slickgrid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@ import { SlickgridConfig } from './slickgrid-config';
import { Filters, PLUGIN_NAME as FILTER_PLUGIN_NAME } from './filters/index';
const SERVICE_NAME = 'AURELIA__SLICKGRID_SERVICES';

// expose all public classes
// aggregators, editors, formatters, services...
export * from './models/index';
export * from './formatters/index';
export * from './grouping-formatters/index';
export * from './sorters/index';

export * from './aggregators/index';
export * from './editors/index';
export * from './filter-conditions/index';
export * from './filters/index';

export { GridExtraUtils, GraphqlService, GridOdataService } from './services/index';

// import all Services separately
import {
CollectionService,
Expand All @@ -27,7 +13,7 @@ import {
FilterService,
GraphqlService,
GridEventService,
GridExtraService,
GridService,
GridExtraUtils,
GridStateService,
GridOdataService,
Expand All @@ -37,6 +23,25 @@ import {
SortService,
} from './services/index';

// expose all public classes
// aggregators, editors, formatters, services...
export * from './models/index';
export * from './formatters/index';
export * from './grouping-formatters/index';
export * from './sorters/index';

export * from './aggregators/index';
export * from './editors/index';
export * from './filter-conditions/index';
export * from './filters/index';

// export some of the Services
export {
GridExtraUtils,
GraphqlService,
GridOdataService
} from './services/index';

export function configure(aurelia: any, callback: any) {
aurelia.globalResources(PLATFORM.moduleName('./aurelia-slickgrid'));
aurelia.globalResources(PLATFORM.moduleName('./slick-pagination'));
Expand All @@ -55,7 +60,7 @@ export function configure(aurelia: any, callback: any) {
aurelia.container.registerTransient(SERVICE_NAME, FilterService);
aurelia.container.registerTransient(SERVICE_NAME, GraphqlService);
aurelia.container.registerTransient(SERVICE_NAME, GridEventService);
aurelia.container.registerTransient(SERVICE_NAME, GridExtraService);
aurelia.container.registerTransient(SERVICE_NAME, GridService);
aurelia.container.registerTransient(SERVICE_NAME, GridStateService);
aurelia.container.registerTransient(SERVICE_NAME, GridOdataService);
aurelia.container.registerTransient(SERVICE_NAME, GroupingAndColspanService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as $ from 'jquery';
// using external non-typed js libraries
declare var Slick: any;

export class GridExtraService {
export class GridService {
private _grid: any;
private _dataView: any;

Expand Down

0 comments on commit d81b37b

Please sign in to comment.