@solidstarters/solid-core 1.2.79 → 1.2.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidstarters/solid-core",
3
- "version": "1.2.79",
3
+ "version": "1.2.81",
4
4
  "description": "This module is a NestJS module containing all the required core providers required by a Solid application",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -42,6 +42,8 @@ import {
42
42
  import { SettingService } from './setting.service';
43
43
  import { CreateUserDto } from 'src/dtos/create-user.dto';
44
44
  import { RoleMetadataService } from './role-metadata.service';
45
+ import commonConfig from 'src/config/common.config';
46
+
45
47
 
46
48
  enum LoginProvider {
47
49
  LOCAL = 'local',
@@ -74,7 +76,9 @@ export class AuthenticationService {
74
76
  private readonly smsService: Msg91OTPService,
75
77
  private readonly eventEmitter: EventEmitter2,
76
78
  private readonly settingService: SettingService,
77
- private readonly roleMetadataService: RoleMetadataService
79
+ private readonly roleMetadataService: RoleMetadataService,
80
+ @Inject(commonConfig.KEY)
81
+ private readonly commonConfiguration: ConfigType<typeof commonConfig>,
78
82
 
79
83
  ) { }
80
84
 
@@ -244,7 +248,7 @@ export class AuthenticationService {
244
248
  userName: user.username,
245
249
  password: autoGeneratedPwd,
246
250
  },
247
- true,
251
+ this.commonConfiguration.shouldQueueEmails,
248
252
  'user',
249
253
  user.id
250
254
  );
@@ -360,7 +364,7 @@ export class AuthenticationService {
360
364
  firstName: user.username,
361
365
  emailVerificationTokenOnRegistration: user.emailVerificationTokenOnRegistration,
362
366
  },
363
- true,
367
+ this.commonConfiguration.shouldQueueEmails,
364
368
  'user',
365
369
  user.id
366
370
  );
@@ -539,7 +543,7 @@ export class AuthenticationService {
539
543
  firstName: user.username,
540
544
  emailVerificationTokenOnLogin: user.emailVerificationTokenOnLogin
541
545
  },
542
- true,
546
+ this.commonConfiguration.shouldQueueEmails,
543
547
  'user',
544
548
  user.id
545
549
  );
@@ -738,7 +742,7 @@ export class AuthenticationService {
738
742
  // TODO: Need to prefix this with the page url where the forgot password page will open up.
739
743
  passwordResetLink: `${process.env.IAM_FRONTEND_APP_FORGOT_PASSWORD_PAGE_URL}?token=${user.verificationTokenOnForgotPassword}&username=${user.username}`
740
744
  },
741
- true,
745
+ this.commonConfiguration.shouldQueueEmails,
742
746
  'user',
743
747
  user.id
744
748
  );
@@ -182,7 +182,7 @@ export class CrudHelperService {
182
182
  }
183
183
 
184
184
  if (filters) {
185
- qb.where(new Brackets(whereQb => {
185
+ qb.andWhere(new Brackets(whereQb => {
186
186
  this.applyFilters(whereQb, filters, entityAlias, qb);
187
187
  }));
188
188
  }
@@ -594,6 +594,10 @@ export class ModelMetadataService {
594
594
  column2Fields.push(formViewLayoutFields[i]);
595
595
  }
596
596
  }
597
+ const viewName = `${model.singularName}-list-view`;
598
+ const formViewName = `${model.singularName}-form-view`;
599
+ const menuName = `${model.singularName}-menu-item`;
600
+
597
601
  const action = {
598
602
  displayName: `${model.displayName} List View`,
599
603
  name: `${model.singularName}-list-view`,
@@ -679,11 +683,30 @@ export class ModelMetadataService {
679
683
  ]
680
684
  }
681
685
  };
686
+
687
+ // Utility function to check if an item with the same name already exists
688
+ const notExists = (arr: any[], name: string) => !arr.some(item => item.name === name);
689
+
690
+ if (notExists(metaData.menus, menuName)) {
682
691
  metaData.menus.push(menu);
692
+ }
693
+
694
+ if (notExists(metaData.actions, viewName)) {
683
695
  metaData.actions.push(action);
696
+ }
697
+
698
+ if (notExists(metaData.views, viewName)) {
684
699
  metaData.views.push(modelListview);
700
+ }
701
+
702
+ if (notExists(metaData.views, formViewName)) {
685
703
  metaData.views.push(modelFormView);
686
704
  }
705
+ // metaData.menus.push(menu);
706
+ // metaData.actions.push(action);
707
+ // metaData.views.push(modelListview);
708
+ // metaData.views.push(modelFormView);
709
+ }
687
710
 
688
711
  //Populate the View, Actions and Menus in the database
689
712
  private async populateVAMConfigInDb(model: ModelMetadata) {