Skip to content

Commit

Permalink
refactor(code): typo in some places remove any framework related stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding-SE committed Apr 24, 2020
1 parent d002dfa commit 5904c67
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ which is why they are better handled in a monorepo structure.
The GitHub [demo page](https://ghiscoding.github.io/slickgrid-universal) uses the Material Design theme but you could also use Bootstrap theme which is demoed in other frameworks.
- [Web-Demo-Vanilla-Bundle](https://ghiscoding.github.io/slickgrid-universal) with Material Design theme
- [Angular-Slickgrid](https://ghiscoding.github.io/Angular-Slickgrid/)
- [Aurelia-Slickgrid](https://ghiscoding.github.io/aurelia-slickgrid/)
- [Slickgrid-Universal](https://ghiscoding.github.io/aurelia-slickgrid/)

### Why create this monorepo?
You might be wondering why was this monorepo created?
1. it removes a lot of duplicate code that existed in both
[Angular-Slickgrid](https://github.com/ghiscoding/Angular-Slickgrid) and [Aurelia-Slickgrid](https://github.com/ghiscoding/aurelia-slickgrid)
[Angular-Slickgrid](https://github.com/ghiscoding/Angular-Slickgrid) and [Slickgrid-Universal](https://github.com/ghiscoding/aurelia-slickgrid)
(over 80% were the same code and that is not very DRY).
2. decouple some Services that should not be required at all time (OData, GraphQL, Export to File, Export to Excel, ...)
3. framework agnostic, it could be implemented in many more frameworks in the future

### Frameworks using this monorepo
This is a Work in Progress, the goal is to eventually to rewrite
[Angular-Slickgrid](https://github.com/ghiscoding/Angular-Slickgrid)
and [Aurelia-Slickgrid](https://github.com/ghiscoding/aurelia-slickgrid) to use this monorepo which will simplify debugging/fixing common code.
and [Slickgrid-Universal](https://github.com/ghiscoding/aurelia-slickgrid) to use this monorepo which will simplify debugging/fixing common code.

Note however that this project also has a Vanilla Implementation (not associated with any framework)
and that what is used to the test the UI portion. The Vanilla bundle is also used in our SalesForce (with Lightning Web Component) hence the creation of this monorepo.
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/services/gridState.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class GridStateService {
this.subscribeToAllGridChanges(grid);
}

/** Dispose of all the SlickGrid & Aurelia subscriptions */
/** Dispose of all the SlickGrid & PubSub subscriptions */
dispose() {
this._currentColumns = [];
this._columns = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/excel-export/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Excel Export Service
#### @slickgrid-universal/file-export
#### @slickgrid-universal/excel-export

Simple Export to Excel Service that allows to exporting as ".xls" or ".xlsx".

Expand Down
4 changes: 2 additions & 2 deletions packages/excel-export/src/excelExport.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe('ExcelExportService', () => {
service.init(null, null);
await service.exportToExcel(mockExportExcelOptions);
} catch (e) {
expect(e.toString()).toContain('[Aurelia-Slickgrid] it seems that the SlickGrid & DataView objects are not initialized did you forget to enable the grid option flag "enableExcelExport"?');
expect(e.toString()).toContain('[Slickgrid-Universal] it seems that the SlickGrid & DataView objects are not initialized did you forget to enable the grid option flag "enableExcelExport"?');
}
});

Expand Down Expand Up @@ -1277,7 +1277,7 @@ describe('ExcelExportService', () => {
const gridOptionsMock = { enableTranslate: true, enableGridMenu: true, gridMenu: { hideForceFitButton: false, hideSyncResizeButton: true, columnTitleKey: 'TITLE' } } as GridOption;
jest.spyOn(gridStub, 'getOptions').mockReturnValue(gridOptionsMock);

expect(() => service.init(gridStub, dataViewStub)).toThrowError('[Aurelia-Slickgrid] requires "I18N" to be installed and configured when the grid option "enableTranslate" is enabled.');
expect(() => service.init(gridStub, dataViewStub)).toThrowError('[Slickgrid-Universal] requires "I18N" to be installed and configured when the grid option "enableTranslate" is enabled.');
});
});
});
4 changes: 2 additions & 2 deletions packages/excel-export/src/excelExport.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class ExcelExportService {
this._locales = this._gridOptions && this._gridOptions.locales || Constants.locales;

if (this._gridOptions.enableTranslate && (!this.translaterService || !this.translaterService.translate)) {
throw new Error('[Aurelia-Slickgrid] requires "I18N" to be installed and configured when the grid option "enableTranslate" is enabled.');
throw new Error('[Slickgrid-Universal] requires "I18N" to be installed and configured when the grid option "enableTranslate" is enabled.');
}
}

Expand All @@ -86,7 +86,7 @@ export class ExcelExportService {
*/
exportToExcel(options: ExcelExportOption): Promise<boolean> {
if (!this._grid || !this._dataView) {
throw new Error('[Aurelia-Slickgrid] it seems that the SlickGrid & DataView objects are not initialized did you forget to enable the grid option flag "enableExcelExport"?');
throw new Error('[Slickgrid-Universal] it seems that the SlickGrid & DataView objects are not initialized did you forget to enable the grid option flag "enableExcelExport"?');
}

return new Promise((resolve, reject) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/file-export/src/fileExport.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('ExportService', () => {
service.init(null, null);
service.exportToFile(mockExportTxtOptions);
} catch (e) {
expect(e.toString()).toContain('[Aurelia-Slickgrid] it seems that the SlickGrid & DataView objects are not initialized did you forget to enable the grid option flag "enableExport"?');
expect(e.toString()).toContain('[Slickgrid-Universal] it seems that the SlickGrid & DataView objects are not initialized did you forget to enable the grid option flag "enableExport"?');
done();
}
});
Expand Down Expand Up @@ -972,7 +972,7 @@ describe('ExportService', () => {
const gridOptionsMock = { enableTranslate: true, enableGridMenu: true, gridMenu: { hideForceFitButton: false, hideSyncResizeButton: true, columnTitleKey: 'TITLE' } } as GridOption;
jest.spyOn(gridStub, 'getOptions').mockReturnValue(gridOptionsMock);

expect(() => service.init(gridStub, dataViewStub)).toThrowError('[Aurelia-Slickgrid] requires "I18N" to be installed and configured');
expect(() => service.init(gridStub, dataViewStub)).toThrowError('[Slickgrid-Universal] requires "I18N" to be installed and configured');
});
});
});
4 changes: 2 additions & 2 deletions packages/file-export/src/fileExport.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class FileExportService {
this._locales = this._gridOptions && this._gridOptions.locales || Constants.locales;

if (this._gridOptions.enableTranslate && (!this.translaterService || !this.translaterService.translate)) {
throw new Error('[Aurelia-Slickgrid] requires "I18N" to be installed and configured when the grid option "enableTranslate" is enabled.');
throw new Error('[Slickgrid-Universal] requires "I18N" to be installed and configured when the grid option "enableTranslate" is enabled.');
}
}

Expand All @@ -72,7 +72,7 @@ export class FileExportService {
*/
exportToFile(options: ExportOption): Promise<boolean> {
if (!this._grid || !this._dataView) {
throw new Error('[Aurelia-Slickgrid] it seems that the SlickGrid & DataView objects are not initialized did you forget to enable the grid option flag "enableExport"?');
throw new Error('[Slickgrid-Universal] it seems that the SlickGrid & DataView objects are not initialized did you forget to enable the grid option flag "enableExport"?');
}

return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 5904c67

Please sign in to comment.