@annalib/anna-core 24.1.17 → 24.1.18

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.
@@ -880,13 +880,13 @@ class AnnaDateTimeFormatService {
880
880
  return converted;
881
881
  }
882
882
  getBroadcastWeek(startDate, format = "MM/DD/YYYY") {
883
- let dayjsDate = dayjs(startDate, format);
884
- let date = dayjsDate.clone();
885
- let day = date.day();
883
+ const dayjsDate = dayjs(startDate, format);
884
+ const date = dayjsDate.clone();
885
+ const day = date.day();
886
886
  // Find the closest Monday <= the date
887
- let start = dayjs(date).subtract((day + 6) % 7, "day");
887
+ const start = dayjs(date).subtract((day + 6) % 7, "day");
888
888
  // Find the closest Sunday >= the date
889
- let end = dayjs(date).add((7 - day) % 7, "day");
889
+ const end = dayjs(date).add((7 - day) % 7, "day");
890
890
  // console.log({weekStart: start , weekEnd: end})
891
891
  return { start, end };
892
892
  }
@@ -2136,7 +2136,7 @@ class AnnaFilterService {
2136
2136
  key === "revisionStartDate" ||
2137
2137
  key === "GeneratedOn" ||
2138
2138
  key === "Week" ||
2139
- key == "ActualWeekStartDate" ||
2139
+ key === "ActualWeekStartDate" ||
2140
2140
  key === "ViolatedSpotDate" ||
2141
2141
  key === "ViolatingSpotDate") {
2142
2142
  filteredData = filteredData.filter((obj) => this.isObjectInTheRange(obj, value, key));
@@ -2150,7 +2150,7 @@ class AnnaFilterService {
2150
2150
  key === "startTimeForFilter" ||
2151
2151
  key === "endTimeForFilter" ||
2152
2152
  key === "StartTime" ||
2153
- key == "EndTime" ||
2153
+ key === "EndTime" ||
2154
2154
  key === "start_time_for_filter" ||
2155
2155
  key === "end_time_for_filter" ||
2156
2156
  key === "time") {
@@ -4199,8 +4199,7 @@ class AnnaNonEditableGenericTableComponent {
4199
4199
  this.setTableBottomBorder();
4200
4200
  }
4201
4201
  if (this.showSkeletonLoading) {
4202
- this.tableElementRef.nativeElement.scrollTop = 0;
4203
- this.tableElementRef.nativeElement.scrollLeft = 0;
4202
+ this.setScrollToInitialPosition();
4204
4203
  this.tableData = this.numberOfSkeletonRows;
4205
4204
  this.renderedData = this.numberOfSkeletonRows;
4206
4205
  this.isNoDataToDisplaySubject$.next(false);
@@ -4739,19 +4738,7 @@ class AnnaNonEditableGenericTableComponent {
4739
4738
  if (latestFilters.length > 0 &&
4740
4739
  item.disableTooltipIcon &&
4741
4740
  latestFilters[latestFilters.length - 1] === key) {
4742
- if (key === "period") {
4743
- const uniqStartDate = uniq(this.clonedTableData.map((u) => u.startDate));
4744
- const uniqEndDate = uniq(this.clonedTableData.map((u) => u.endDate));
4745
- item.disableTooltipIcon = !(uniqStartDate.length > 1 || uniqEndDate.length > 1);
4746
- }
4747
- else {
4748
- values = this.clonedTableData.map((u) => u[key]);
4749
- if ((item.filter === "CHECKBOX" && uniq(values).filter((n) => n != null).length > 1) ||
4750
- (item.filter !== "CHECKBOX" &&
4751
- uniq(values).filter((n) => n != null && n !== "-").length > 1)) {
4752
- item.disableTooltipIcon = false;
4753
- }
4754
- }
4741
+ item.disableTooltipIcon = false;
4755
4742
  }
4756
4743
  if (item.disableTooltipIcon) {
4757
4744
  if (key === "period") {
@@ -4944,8 +4931,13 @@ class AnnaNonEditableGenericTableComponent {
4944
4931
  radioButtonIconClicked(data) {
4945
4932
  this.radioButtonMessageIconClicked.emit(data);
4946
4933
  }
4934
+ setScrollToInitialPosition() {
4935
+ this.tableElementRef.nativeElement.scrollTop = 0;
4936
+ this.tableElementRef.nativeElement.scrollLeft = 0;
4937
+ }
4947
4938
  filterApplied(tableData) {
4948
4939
  this.tableData = tableData;
4940
+ this.setScrollToInitialPosition();
4949
4941
  this.setInitialRowsForTable();
4950
4942
  this.disableEnableEachColumnTooltipIcon();
4951
4943
  this.filterAppliedToTable.emit(tableData);
@@ -4962,7 +4954,7 @@ class AnnaNonEditableGenericTableComponent {
4962
4954
  if (this.statusNoteTooltip && this.statusNoteTooltip.isOpen()) {
4963
4955
  this.statusNoteTooltip.close();
4964
4956
  }
4965
- let lastIndex = note.length < 100 ? note.length : 100;
4957
+ const lastIndex = note.length < 100 ? note.length : 100;
4966
4958
  this.statusNoteForTooltip = "";
4967
4959
  this.statusNoteForTooltip = note.substring(0, lastIndex);
4968
4960
  this.statusNoteForPopup = note;