barsa-novin-ray-core 2.3.1 → 2.3.3

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.
@@ -2637,10 +2637,23 @@ class DynamicComponentService {
2637
2637
  };
2638
2638
  }
2639
2639
  }
2640
- getComponentType(componentName, moduleName) {
2640
+ getComponentType(componentSelector, componentName, moduleName) {
2641
2641
  const moName = moduleName + 'Module';
2642
2642
  const module = this._dynamicModuleWithComponents[moName];
2643
- return module.ngModuleRef.dynamicComponents.find((c) => c.name === componentName + 'Component');
2643
+ const cmpName = componentName + 'Component';
2644
+ if (!module) {
2645
+ return;
2646
+ }
2647
+ let x = module.ngModuleRef.dynamicComponents.find((c) => c.name.includes(cmpName));
2648
+ if (!x) {
2649
+ module.ngModuleRef.dynamicComponents.forEach((c) => {
2650
+ if (!x) {
2651
+ const cmp = c['ɵcmp'];
2652
+ cmp?.selectors?.length && (x = cmp.selectors[0].includes(componentSelector) ? c : null);
2653
+ }
2654
+ });
2655
+ }
2656
+ return x;
2644
2657
  }
2645
2658
  getComponentBySelector(selector, moduleName, injector) {
2646
2659
  const moName = moduleName + 'Module';
@@ -3599,8 +3612,8 @@ class PortalService {
3599
3612
  }
3600
3613
  this.setValueOnObject(path, index + 1, modules, object[prop]);
3601
3614
  }
3602
- getComponentType(moduleName, componentName, _selector) {
3603
- return this.dcm.getComponentType(componentName, moduleName);
3615
+ getComponentType(moduleName, componentName, selector) {
3616
+ return this.dcm.getComponentType(selector, componentName, moduleName);
3604
3617
  }
3605
3618
  getComponent(moduleName, _modulePath, _componentName, selector, parentInjector) {
3606
3619
  return this.dcm.getComponentBySelector(selector, moduleName, parentInjector);
@@ -3942,7 +3955,7 @@ class PortalService {
3942
3955
  }
3943
3956
  // const notFoundPath = configRoute.find((c) => c.path === '**');
3944
3957
  // notFoundPath && (notFoundPath.redirectTo = defaultPage.Route.replace('/', ''));
3945
- this._router.resetConfig(portalData.IsDynamicRoute ? newConfigRoutes : configRoute);
3958
+ this._router.resetConfig(portalData.IsDynamicRoute === 'True' ? newConfigRoutes : configRoute);
3946
3959
  }
3947
3960
  }
3948
3961
  this.extractAllPages(portalData);