Skip to content

Commit

Permalink
issues #929, #930, #935 (#17)
Browse files Browse the repository at this point in the history
* #935

* #930

* #929

* fix null issue
  • Loading branch information
amirbashan authored Jan 20, 2025
1 parent 52e126f commit 471b1f8
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
border: 1px solid black;
background: transparent;
transition-property: right opacity;
transition-duration: 0.15s;
transition-timing-function: ease-in-out;
border-radius: 20px;
border: 1px solid @color-blue-6;
background: @color-white;
box-shadow: 0px 0px 5px 0px rgba(31, 55, 246, 0.20);
opacity: 1;
&.mobile {
transition-duration: 0.15s;
transition-timing-function: ease-in-out;
}
&.hide {
opacity: 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ export class AreaSearchState {
this.searching_ = true;
this.inputPlaceholder_ = 'ניתן לחפש ישוב או איזור מוגדר';
this.selectorResize.next();
timer(500).subscribe(() => {
this.resultsWidth.next(this.areaInputEl.offsetWidth - 2);
timer(0).subscribe(() => {
this.showResults_ = true;
});
}
Expand Down
1 change: 1 addition & 0 deletions projects/srm/src/app/response/response.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
></span>
</span>
<span class='name'
*ngIf='isValid(response.name)'
[class.small]='smaller'
[style.font-weight]='fontWeight'
[style.color]='textColor'
Expand Down
4 changes: 4 additions & 0 deletions projects/srm/src/app/response/response.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,8 @@ export class ResponseComponent extends ResponseBase implements OnChanges {
get smaller() {
return this.small || (!this.dynamic && this.layout.mobile());
}

isValid(x = '') {
return x !== '<em>null</em>';
}
}
3 changes: 2 additions & 1 deletion projects/srm/src/app/search-filters/filters-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ export class FiltersState {
.sort((a, b) => (b.doc_count || 0) - (a.doc_count || 0))
.filter(x => x.key !== this.currentSearchParams.situation)
.filter(x => x.key !== this.currentSearchParams.response)
.filter(x => !!x.doc_count && x.doc_count > 5)
.slice(0, this.maxStaticFilters)
.map(x => {
return {
Expand Down Expand Up @@ -543,7 +544,7 @@ export class FiltersState {
this.toggleId({id: item.key}, paramsCopy);
this.api.getCounts(paramsCopy, !this.areaSearchState.nationWide_).subscribe((result) => {
const new_doc_count = result.search_counts._current.total_overall;
if (new_doc_count >= count) {
if (new_doc_count > count) {
item.doc_count = new_doc_count - count;
item.plus = true;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
}

.open-drawer {
right: 644px !important;
right: 745px !important;
}

.flip{
Expand Down Expand Up @@ -123,7 +123,7 @@

.open {
right: 336px;
width: 320px;
width: 421px;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ <h3>סינון מהיר:</h3>
<div class='items'>
@for (item of filtersState.staticFilters; track item.key) {
@if (item.key?.indexOf('human_situation') === 0 && item.key && filtersState.situationsMap[item.key]) {
<div *ngIf='getIsShowOption(item)' class='item' [class.checked]='checkedSituation(item)'
<div class='item' [class.checked]='checkedSituation(item)'
(click)='toggleSituation(filtersState.situationsMap[item.key], !checkedSituation(item))'
>
<div class='checkbox'></div>
<span class='name'>{{filtersState.situationsMap[item.key].name}}</span>
<span class='count'>{{count((filtersState.allFilteredSituations || []).indexOf(item.key) > -1 ? null : item)}}</span>
</div>
} @else if (item.key?.indexOf('human_service') === 0 && item.key && filtersState.responsesMap[item.key]) {
<div *ngIf='getIsShowOption(item)' class='item' [class.checked]='checkedResponse(item)'
<div class='item' [class.checked]='checkedResponse(item)'
(click)='toggleResponse(filtersState.responsesMap[item.key], !checkedSituation(item))'
>
<div class='checkbox'></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ export class SrpStaticFiltersComponent implements OnChanges {
return (this.filtersState.currentSearchParams?.filter_responses || []).indexOf(item.key || '') > -1
}

getIsShowOption(item: any): boolean {
if (!this.areaSearchState.nationWide_) return true;
if (this.checkedSituation(item) || this.checkedResponse(item)) return true;
const count = parseInt(this.count((this.filtersState.currentSearchParams?.filter_responses || []).indexOf(item.key) > -1 ? null : item));
return count > 5
}

toggleSituation(situation: any, isFilterOn = false) {
this.filtersState.toggleSituation(situation)
if (isFilterOn) this.analytics.quickFilterEvent(situation.id);
Expand Down

0 comments on commit 471b1f8

Please sign in to comment.