Merge remote-tracking branch 'origin/new-theme' into new-theme

This commit is contained in:
argirok 2022-06-06 12:24:53 +03:00
commit d170d81db1
6 changed files with 57 additions and 50 deletions

View File

@ -25,7 +25,7 @@
<tr *ngFor="let selectedField of selectedFields; let i = index">
<td>
<div class="uk-grid uk-flex-middle uk-child-width-1-2@m uk-child-width-1-1">
<div input [(value)]="selectedField.id" inputClass="border-bottom" [tooltip]="true"
<div input [(value)]="selectedField.id" inputClass="border-bottom"
[options]="fieldIdsOptions" (valueChange)="fieldIdsChanged(i,selectedField.id)" type="select"></div>
<div input *ngIf="selectedField.id != 'q'" [(value)]="selectedField.includes" inputClass="border-bottom" [options]="getNotOperators(selectedField)" type="select"></div>
<div *ngIf="selectedField.id == 'q'">includes</div>

View File

@ -276,17 +276,17 @@
<div *ngIf="(searchUtils.status !== errorCodes.LOADING || !loadPaging)">
<ng-container *ngTemplateOutlet="selected_filters_pills;"></ng-container>
</div>
<div *ngIf="availablePageOptions.length > 0 || sort || searchUtils.totalResults > searchUtils.size ||
<div *ngIf="searchUtils.totalResults > 10 || sort || searchUtils.totalResults > searchUtils.size ||
(!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING)"
class="uk-grid uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m uk-margin-medium-top" uk-grid>
<div>
<div class="uk-flex uk-flex-middle">
<div *ngIf="availablePageOptions.length > 0" class="uk-width-small uk-margin-right">
<div *ngIf="searchUtils.totalResults > 10" class="uk-width-small uk-margin-right">
<div input type="select" placeholder="Results per page" inputClass="flat x-small"
[options]="availablePageOptions" [(value)]="searchUtils.size" [disabled]="disabled"
[options]="pageOptions" [(value)]="searchUtils.size" [disabled]="disabled"
(valueChange)="sizeChanged($event)"></div>
</div>
<search-sorting *ngIf="sort"
<search-sorting *ngIf="sort && searchUtils.totalResults > 0"
[entityType]="entityType" [sortBy]="searchUtils.sortBy"
(sortByChange)="sortByChanged($event)"
[isDisabled]="disabled">

View File

@ -1701,8 +1701,4 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
}
return totalPages;
}
get availablePageOptions() {
return this.pageOptions.filter(option => option < this.searchUtils.totalResults);
}
}

View File

@ -6,8 +6,8 @@
[class.uk-disabled]="!hasPermission(result)">
<div>
<div *ngIf="type === 'community' && result.isSubscribed"
class="uk-alert-primary uk-padding-small uk-position-top-left uk-text-center">
<span>Subscribed</span>
class="uk-text-background uk-text-center uk-position-top-left uk-padding-small uk-text-uppercase uk-text-bold">
<span>Member</span>
</div>
<div *ngIf="type === 'community' && result.status === 'manager'"
class="uk-position-top-right uk-margin-top uk-margin-right uk-flex uk-flex-column uk-flex-middle">

View File

@ -1,17 +1,13 @@
import {Component, Input, Output, EventEmitter} from '@angular/core';
import {Option} from "../../sharedComponents/input/input.component";
@Component({
selector: 'search-sorting',
template: `
<div class="uk-width-small">
<div input *ngIf="(entityType != 'community' && entityType != 'stakeholder' )"
<div *ngIf="options" class="uk-width-small">
<div input
type="select" placeholder="Sort by" inputClass="flat x-small"
[options]="optionsA" [(value)]="sortBy" [disabled]="isDisabled"
(valueChange)="sortByChanged()"></div>
<div input *ngIf="(entityType == 'community' || entityType == 'stakeholder')"
type="select" placeholder="Sort by" inputClass="flat x-small"
[options]="optionsB" [(value)]="sortBy" [disabled]="isDisabled"
[options]="options" [(value)]="sortBy" [disabled]="isDisabled"
(valueChange)="sortByChanged()"></div>
</div>
`
@ -22,21 +18,35 @@ export class SearchSortingComponent {
@Input() sortBy: string = '';
@Input() entityType: string = '';
@Output() sortByChange = new EventEmitter();
public optionsA = [
public options: Option[];
private generalOptions = [
{value: '', label: 'Relevance'},
{value: 'resultdateofacceptance,descending', label: 'Date (most recent)'},
{value: 'resultdateofacceptance,ascending', label: 'Date (least recent)'},
];
public optionsB = [
private communityOptions = [
{value: '', label: 'Title'},
{value: 'creationdate,descending', label: 'Creation Date (most recent)'},
{value: 'creationdate,ascending', label: 'Creation Date (least recent)'},
];
private stakeholderOptions = [
{value: '', label: 'Name'},
{value: 'creationdate,descending', label: 'Creation Date (most recent)'},
{value: 'creationdate,ascending', label: 'Creation Date (least recent)'},
];
constructor() {
}
constructor () {}
ngOnInit() {}
ngOnInit() {
if (this.entityType === 'community') {
this.options = this.communityOptions;
} else if (this.entityType === 'stakeholder') {
this.options = this.stakeholderOptions;
} else {
this.options = this.generalOptions;
}
}
sortByChanged() {

View File

@ -57,7 +57,7 @@ declare var UIkit;
<label>{{placeholderInfo.label}} <sup *ngIf="required">*</sup></label>
</div>
<div class="uk-flex" [class.uk-flex-middle]="type !== 'textarea'"
[attr.uk-tooltip]="(tooltip && !focused && type !== 'chips')?('title: ' + getLabel(formControl.value) + '; delay: 500'):null">
[attr.uk-tooltip]="(tooltip && !focused && type !== 'chips' && type !== 'textarea')?('title: ' + getLabel(formControl.value) + '; delay: 500; pos: bottom-left'):null">
<ng-template [ngIf]="type === 'text' || type === 'URL' || type === 'logoURL'">
<input #input class="input" [attr.placeholder]="placeholderInfo?.static?placeholderInfo.label:hint"
[formControl]="formAsControl" [class.uk-text-truncate]="!focused">
@ -194,13 +194,13 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
@Input() value: any | any[];
@Output() valueChange = new EventEmitter<any | any[]>();
@Input() hint: string;
@Input() tooltip: boolean = false;
/** Text */
@ViewChild('input') input: ElementRef;
/** Textarea options */
@ViewChild('textArea') textArea: ElementRef;
@Input('rows') rows: number = 3;
/** Select | Autocomplete | chips available options */
@Input() tooltip: boolean = false;
@Input() selectArrow: string = 'arrow_drop_down';
@Input() selectedIndex: number = 0;
@Input() selectable: boolean = false;
@ -263,6 +263,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
this.icon = this.selectArrow;
}
this.selectable = true;
this.tooltip = true;
}
}