Skip to content

Commit

Permalink
fix(grid-crm): fix imports for stackblit
Browse files Browse the repository at this point in the history
  • Loading branch information
Svetloslav15 committed Dec 7, 2022
1 parent 255ee24 commit 0fc4205
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# samples assets
/src/assets/samples
/projects/app-lob/src/assets/samples
/projects/app-crm/src/assets/samples

# IDEs and editors
/.idea
Expand Down
17 changes: 11 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ const getSampleNameFromFileName = (fileName, sampleBaseDir) => fileName.replace(
var assetsRegex = new RegExp(/([\.]{0,2}\/)*assets\//g);

const processApp = (projectPath, dest, directoriesToExclude) => {
console.log('process start')
if (!fs.existsSync(submodule)) {
return console.error("No submodule found");
}
Expand Down Expand Up @@ -186,16 +185,12 @@ const processApp = (projectPath, dest, directoriesToExclude) => {

// Configure sample application file structure
const fileName = file.path.substring(file.base.length + 1).replace(".json", "");
console.log(fileName)
let sampleBaseDir = fileName.indexOf("--") !== -1 ? fileName.substring(0, fileName.indexOf("--")) : "";
console.log(sampleBaseDir)
if (sampleBaseDir && !fs.existsSync(submoduleAppDest + sampleBaseDir)) {
fs.mkdirSync(submoduleAppDest + sampleBaseDir);
}
const sampleName = sampleBaseDir ? getSampleNameFromFileName(fileName, sampleBaseDir) : fileName;
console.log(sampleName)
const sampleAppPath = submoduleAppDest + sampleBaseDir + "/" + sampleName;
console.log(sampleAppPath)

if (!fs.existsSync(sampleAppPath)) {
fs.mkdirSync(sampleAppPath);
Expand Down Expand Up @@ -234,9 +229,11 @@ const processApp = (projectPath, dest, directoriesToExclude) => {

const processDemosWithScss = () => processApp("src", "angular-demos", "data");
const processDemosLobWithScss = () => processApp("projects/app-lob/src", "angular-demos-lob", "services");
const processDemosCrmWithScss = () => processApp("projects/app-crm/src", "angular-demos-grid-crm");

let repositoryfyAngularDemos;
let repositoryfyAngularDemosLob;
let repositoryfyAngularDemosCrm;

const cleanupAngularDemos = (cb) => {
fsExtra.removeSync(submodule + "/angular-demos");
Expand All @@ -249,5 +246,13 @@ const cleanupAngularDemosLob = (cb) => {
fsExtra.mkdirSync(submodule + "/angular-demos-lob");
cb();
}

const cleanupAngularDemosCrm = (cb) => {
fsExtra.removeSync(submodule + "/angular-demos-grid-crm");
fsExtra.mkdirSync(submodule + "/angular-demos-grid-crm");
cb();
}

exports.repositoryfyAngularDemos = repositoryfyAngularDemos = gulp.series(cleanupAngularDemos, processDemosWithScss);
exports.repositoryfyAngularDemosLob = repositoryfyAngularDemosLob = gulp.series(cleanupAngularDemosLob, processDemosLobWithScss);
exports.repositoryfyAngularDemosLob = repositoryfyAngularDemosLob = gulp.series(cleanupAngularDemosLob, processDemosLobWithScss);
exports.repositoryfyAngularDemosCrm = repositoryfyAngularDemosCrm = gulp.series(cleanupAngularDemosCrm, processDemosCrmWithScss);
9 changes: 5 additions & 4 deletions live-editing/configs/GridCRMConfigGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,21 @@ export class GridCRMConfigGenerator implements IConfigGenerator {
'/src/app/directives/prevent-scroll.directive.ts',
'/projects/app-crm/src/_app-layout.scss',
'/projects/app-crm/src/_variables.scss',
'/projects/app-crm/src/app/grid-crm/data.ts'
'/projects/app-crm/src/app/grid-crm/data.ts',
'/projects/app-crm/src/assets/images/propeller-logo.svg'
],
additionalDependencies: [],
appModuleConfig: new AppModuleConfig({
imports: [
'RouterModule', 'HammerModule', 'IgxAutocompleteModule', 'IgxRippleModule',
'IgxGridModule', 'IgxIconModule', 'IgxLayoutModule',
'IgxAvatarModule', 'IgxInputGroupModule', 'IgxButtonModule',
'IgxPreventDocumentScrollModule', 'GridsCrmModule'
'IgxPreventDocumentScrollModule', 'GridCRMComponent'
],
ngDeclarations: [],
ngDeclarations: ['GridCRMComponent'],
ngImports: ['IgxPreventDocumentScrollModule', 'IgxRippleModule',
'IgxGridModule', 'IgxIconModule', 'IgxLayoutModule',
'IgxAvatarModule', 'IgxInputGroupModule', 'IgxButtonModule', 'GridsCrmModule']
'IgxAvatarModule', 'IgxInputGroupModule', 'IgxButtonModule']
})
}));

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"repositoryfyAngularDemos:prod": "gulp repositoryfyAngularDemos --configuration production",
"repositoryfyAngularDemosLob": "gulp repositoryfyAngularDemosLob",
"repositoryfyAngularDemosLob:prod": "gulp repositoryfyAngularDemosLob --configuration production",
"repositoryfyAngularDemosCrm": "gulp repositoryfyAngularDemosCrm",
"repositoryfyAngularDemosCrm:prod": "gulp repositoryfyAngularDemosCrm --configuration production",
"build:stats": "ng build --stats-json",
"analyze": "webpack-bundle-analyzer dist/app/stats.json"
},
Expand Down
7 changes: 1 addition & 6 deletions projects/app-crm/src/app/grid-crm/grid-crm.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
QueryList,
ViewChild
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import {
CloseScrollStrategy,
ConnectedPositioningStrategy,
Expand Down Expand Up @@ -133,8 +132,7 @@ export class GridCRMComponent implements OnInit, AfterViewInit {

constructor(
private csvExporter: IgxCsvExporterService,
private excelExporter: IgxExcelExporterService,
private activatedRoute: ActivatedRoute) {
private excelExporter: IgxExcelExporterService) {

const exporterCb = (args: IColumnExportingEventArgs) => {
if (args.field === 'Deals') { args.cancel = true; }
Expand All @@ -150,9 +148,6 @@ export class GridCRMComponent implements OnInit, AfterViewInit {
this.getDeals(employee);
}
this.localData = employees;
this.activatedRoute.queryParams.subscribe(params => {
this.dark = !!params.dark;
});
}

public toggleHiding() {
Expand Down
2 changes: 1 addition & 1 deletion projects/app-crm/src/assets/samples/grid-crm.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion projects/app-crm/src/assets/samples/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"generationTimeStamp":1670397625889}
{"generationTimeStamp":1670402409865}

0 comments on commit 0fc4205

Please sign in to comment.