@senior-gestao-pessoas/hcm-entity-lookups 4.1.1 → 4.1.2-develop-652f766c

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.
@@ -6831,18 +6831,8 @@
6831
6831
  return item[field];
6832
6832
  }).join(_this.administrativeJudicialCaseLookupSeparator) })); }) })); }));
6833
6833
  };
6834
- AdministrativeJudicialCaseLookupService.prototype.getAdministrativeJudicialCaseSearchFields = function () {
6835
- return [
6836
- new angularComponents.FormField({
6837
- label: this.translate.instant(this.configService.getTranslationPrefix() + ".administrative_judicial_case_cod_emp"),
6838
- name: "company.codEmp",
6839
- type: angularComponents.FieldType.Integer,
6840
- }),
6841
- new angularComponents.FormField({
6842
- label: this.translate.instant(this.configService.getTranslationPrefix() + ".administrative_judicial_case_nom_emp"),
6843
- name: "company.nomEmp",
6844
- type: angularComponents.FieldType.String,
6845
- }),
6834
+ AdministrativeJudicialCaseLookupService.prototype.getAdministrativeJudicialCaseSearchFields = function (caseClassificationType, companyIds) {
6835
+ var searchFields = [
6846
6836
  new angularComponents.FormField({
6847
6837
  type: angularComponents.FieldType.Enum,
6848
6838
  name: "caseType",
@@ -6855,16 +6845,33 @@
6855
6845
  type: angularComponents.FieldType.String,
6856
6846
  name: "caseNumber",
6857
6847
  label: this.translate.instant(this.configService.getTranslationPrefix() + ".administrative_judicial_case_case_number"),
6858
- }),
6859
- new angularComponents.FormField({
6848
+ })
6849
+ ];
6850
+ if (!companyIds || companyIds.length === 0) {
6851
+ searchFields.unshift.apply(searchFields, __spread([
6852
+ new angularComponents.FormField({
6853
+ label: this.translate.instant(this.configService.getTranslationPrefix() + ".administrative_judicial_case_cod_emp"),
6854
+ name: "company.codEmp",
6855
+ type: angularComponents.FieldType.Integer,
6856
+ }),
6857
+ new angularComponents.FormField({
6858
+ label: this.translate.instant(this.configService.getTranslationPrefix() + ".administrative_judicial_case_nom_emp"),
6859
+ name: "company.nomEmp",
6860
+ type: angularComponents.FieldType.String,
6861
+ })
6862
+ ]));
6863
+ }
6864
+ if (!caseClassificationType) {
6865
+ searchFields.push(new angularComponents.FormField({
6860
6866
  type: angularComponents.FieldType.Enum,
6861
6867
  name: "caseClassificationType",
6862
6868
  label: this.translate.instant(this.configService.getTranslationPrefix() + ".administrative_judicial_case_case_classification_type"),
6863
6869
  placeholder: this.translate.instant(this.configService.getTranslationPrefix() + ".administrative_judicial_case_case_classification_type_placeholder"),
6864
6870
  multiple: false,
6865
6871
  options: this.caseClassificationType,
6866
- }),
6867
- ];
6872
+ }));
6873
+ }
6874
+ return searchFields;
6868
6875
  };
6869
6876
  AdministrativeJudicialCaseLookupService.ctorParameters = function () { return [
6870
6877
  { type: core$1.TranslateService },
@@ -6894,11 +6901,18 @@
6894
6901
  return _this;
6895
6902
  }
6896
6903
  AdministrativeJudicialCaseLookupComponent.prototype.ngOnInit = function () {
6897
- this.administrativeJudicialCaseSearchFields = this.administrativeJudicialCaseLookupService.getAdministrativeJudicialCaseSearchFields();
6898
- this.administrativeJudicialCaseSearchGridFields = this.administrativeJudicialCaseLookupService.getAdministrativeJudicialCaseSearchFields();
6899
- if (this.caseType) {
6900
- this.initialFilter = "caseType eq '" + this.caseType + "'";
6904
+ this.administrativeJudicialCaseSearchFields = this.administrativeJudicialCaseLookupService
6905
+ .getAdministrativeJudicialCaseSearchFields(this.caseClassificationType, this.companyIds);
6906
+ this.administrativeJudicialCaseSearchGridFields = this.administrativeJudicialCaseLookupService
6907
+ .getAdministrativeJudicialCaseSearchFields(this.caseClassificationType, this.companyIds);
6908
+ var filters = [];
6909
+ if (this.caseClassificationType) {
6910
+ filters.push("caseClassificationType eq '" + this.caseClassificationType + "'");
6911
+ }
6912
+ if (this.companyIds && this.companyIds.length > 0) {
6913
+ filters.push("company in (" + this.companyIds.map(function (id) { return "'" + id + "'"; }).join(",") + ")");
6901
6914
  }
6915
+ this.initialFilter = filters.join(" and ");
6902
6916
  };
6903
6917
  AdministrativeJudicialCaseLookupComponent.prototype.onAdministrativeJudicialCaseLookupRequest = function (value) {
6904
6918
  var _this = this;
@@ -6937,7 +6951,7 @@
6937
6951
  ]; };
6938
6952
  __decorate([
6939
6953
  core.Input()
6940
- ], AdministrativeJudicialCaseLookupComponent.prototype, "caseType", void 0);
6954
+ ], AdministrativeJudicialCaseLookupComponent.prototype, "caseClassificationType", void 0);
6941
6955
  AdministrativeJudicialCaseLookupComponent = __decorate([
6942
6956
  core.Component({
6943
6957
  // tslint:disable-next-line:component-selector