Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c1: QA fixes - Calendar #551

Merged
merged 23 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,17 @@
<ng-template pTemplate="filter" let-options="options">
<div *ngIf="emails.length" class="p-inputgroup">
<div class="p-input-icon-left">
<app-svg-icon [svgSource]="'search-medium'" [height]="'18px'" [width]="'18px'"></app-svg-icon>
<i>
<app-svg-icon [svgSource]="'search-medium'" [height]="'18px'" [width]="'18px'"></app-svg-icon>
</i>
<input type="text" class="!tw-h-32-px !tw-w-300-px" (keyup)="options.filter($event)"
pInputText placeholder="Search by Name / Email" formControlName="search" />
<app-svg-icon [svgSource]="'cross'" [width]="'24px'" [height]="'24px'"
[styleClasses]="'tw-text-faded-text-color tw-absolute tw-top-10-px tw-right-12-px tw-cursor-pointer'"
(iconClick)="clearSearch(options)">
</app-svg-icon>
<i>
<app-svg-icon [svgSource]="'cross'" [width]="'24px'" [height]="'24px'"
[styleClasses]="'tw-text-faded-text-color tw-absolute tw-top-10-px tw-right-12-px tw-cursor-pointer'"
(iconClick)="clearSearch(options)">
</app-svg-icon>
</i>
</div>
</div>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-8-px !tw-font-400 !tw-l
<ng-template pTemplate="filter" let-options="options">
<div *ngIf="emails.length" class="p-inputgroup">
<div class="p-input-icon-left p-input-icon-right">
<app-svg-icon [svgSource]="'search-medium'" height]="'18px'" [width]="'18px'"></app-svg-icon>
<i>
<app-svg-icon [svgSource]="'search-medium'" [height]="'18px'" [width]="'18px'"></app-svg-icon>
</i>
<input type="text" class="!tw-h-32-px !tw-w-270-px" (keyup)="options.filter($event)"
pInputText placeholder="Search by Name / Email" formControlName="search" />
<app-svg-icon [svgSource]="'cross-medium'" class="tw-cursor-pointer tw-text-16-px" (click)="clearSearch(options)" [height]="'16px'" [width]="'16px'"></app-svg-icon>
<i>
<app-svg-icon [svgSource]="'cross-medium'" class="tw-cursor-pointer tw-text-16-px" (click)="clearSearch(options)" [height]="'16px'" [width]="'16px'"></app-svg-icon>
</i>
</div>
</div>
</ng-template>
Expand Down
2 changes: 2 additions & 0 deletions src/app/shared/components/core/svg-icon/svg-icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ const ICON_MAPPING = {
'arrow-tail-down': 'grv-arrow-down',
'arrow-tail-left-medium': 'grv-arrow-left-medium',
'arrow-tail-right-medium': 'grv-arrow-right-medium',
'arrow-tail-right-small': 'grv-arrow-right-small',
'arrow-tail-up-down': 'grv-sort',
'arrow-tail-up-medium': 'grv-arrow-up-medium',
'arrow-tail-up': 'grv-arrow-up',
'bin': 'grv-trash',
'calendar': 'grv-calendar',
'calendar-medium': 'grv-calendar-medium',
'check-circle-outline-small': 'grv-checkmark-encircled-small',
'check-circle-outline': 'grv-checkmark-encircled',
'check-circle-outline-medium': 'grv-checkmark-encircled-medium',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,49 @@
<div>
<app-svg-icon [svgSource]="'calendar'" [width]="'24px'" [height]="'24px'" [styleClasses]="'tw-text-placeholder'"></app-svg-icon>
</div>
<!-- <p-calendar (click)="showCalendar($event)" placeholder="Custom dates" formControlName="start" (onClose)="getDates()" [touchUI]="isCalendarVisible" selectionMode="range" [readonlyInput]="true" inputId="range">
<ng-template pTemplate="header">
<div class="tw-flex tw-items-center tw-justify-center">
<div class="tw-pr-8-px">
<button type="button" class="p-button outline-sm tw-font-nav-link-font-weight">
This week
</button>
</div>
<div>
<button type="button" class="p-button outline-sm tw-font-nav-link-font-weight">
Last week
</button>
</div>
</div>
<div class="tw-pt-10-px tw-flex tw-items-center tw-justify-center">
<div class="tw-pr-8-px">
<button type="button" class="p-button outline-sm tw-whitespace-nowrap tw-font-nav-link-font-weight">
This month
</button>
</div>
<div>
<button type="button" class="p-button outline-sm tw-whitespace-nowrap tw-font-nav-link-font-weight">
Last month
</button>
</div>
</div>

<div class="tw-pt-14-px tw-h-32-px tw-rounded-4-px">
<span class="tw-text-calendar-day-text-color tw-text-12-px tw-font-nav-link-font-weight">
Or, Select Date range
</span>
</div>

<div class="tw-pt-16-px tw-pb-8-px">
<div class="tw-flex tw-items-center tw-text-date-picker-placeholder-text tw-border-1-px tw-border-solid tw-border-date-picker-border tw-py-4-px tw-px-12-px">
<p class="tw-pr-18-px">Start date</p>
<app-svg-icon [svgSource]="'arrow-tail-right-small'" [width]="'12px'" [height]="'12px'" [styleClasses]="'tw-text-date-picker-placeholder-text tw-pr-10-px'" [isTextColorAllowed]="true"></app-svg-icon>
<p>End date</p>
<app-svg-icon [svgSource]="'calendar-medium'" [width]="'18px'" [height]="'18px'" [styleClasses]="'tw-text-date-picker-placeholder-text tw-pl-22-px'" [isTextColorAllowed]="true"></app-svg-icon>
</div>
</div>
</ng-template>
</p-calendar> -->
<p-dropdown placeholder="Select date range" appendTo="body" [options]="dateOptions"
formControlName="dateRange" (click)="dropDownWatcher()" (onFocus)="isDateFieldFocused = true" (onBlur)="isDateFieldFocused = false"
[ngClass]="{'selectedItem': exportLogForm.controls.dateRange.value, 'filterDropdown': !exportLogForm.controls.dateRange.value}">
Expand All @@ -27,10 +70,11 @@
</ng-template>
<ng-template let-date pTemplate="item">
<div>
<p-calendar (click)="showCalendar($event)" placeholder="Custom dates" formControlName="start" (onClose)="getDates()" [touchUI]="isCalendarVisible" *ngIf="date.dateRange === presentDate" selectionMode="range" [readonlyInput]="true" inputId="range"></p-calendar>
<p-calendar (click)="showCalendar($event)" placeholder="Custom dates" formControlName="start" (onClose)="getDates()" [touchUI]="isCalendarVisible" *ngIf="date.dateRange === presentDate" selectionMode="range" [readonlyInput]="true" inputId="range">
</p-calendar>
<p class="tw-text-sub-text-color tw-text-14-px" [ngClass]="{'!tw-text-mandatory-field-color' : exportLogForm.controls.dateRange.value === date }" *ngIf="date.dateRange !== presentDate">{{ date.dateRange | titlecase | snakeCaseToSpaceCase }}</p>
<p class="tw-text-sub-text-color tw-text-12-px" *ngIf="date.dateRange !== presentDate && date.dateRange !== 'Today'">{{date.startDate | date : 'MMM dd, yyyy'}} - {{date.endDate | date : 'MMM dd, yyyy'}}</p>
<p class="tw-text-sub-text-color tw-text-12-px" *ngIf="date.dateRange === 'Today'">{{date.startDate | date : 'MMM dd, yyyy'}}</p>
<!-- <p class="tw-text-sub-text-color tw-text-12-px" *ngIf="date.dateRange !== presentDate && date.dateRange !== 'Today'">{{date.startDate | date : 'MMM dd, yyyy'}} - {{date.endDate | date : 'MMM dd, yyyy'}}</p> -->
<!-- <p class="tw-text-sub-text-color tw-text-12-px" *ngIf="date.dateRange === 'Today'">{{date.startDate | date : 'MMM dd, yyyy'}}</p> -->
</div>
</ng-template>
</p-dropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@

:host ::ng-deep .p-dialog {
@apply tw-max-h-full tw-m-0 #{!important};
}

:host ::ng-deep .p-button.outline-sm {
@apply tw-w-100-px tw-justify-center #{!important};
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@
[filter]="true"
filterBy="value">
<ng-template pTemplate="filter" let-options="options">
<div class="p-inputgroup">
<div class="p-input-icon-left">
<app-svg-icon [svgSource]="'search-medium'" [width]="'18px'" [height]="'18px'"></app-svg-icon>
<input type="text" class="!tw-h-32-px !tw-w-260-px"
(keyup)="options.filter($event)" pInputText />
</div>
</div>
<app-search [form]="form" [placeholder]="'Search'" [styleClasses]="'tw-w-[100%] tw-h-dropdown-option-height tw-bg-white'" (handleSimpleSearch)="simpleSearch($event)"></app-search>
</ng-template>
</p-dropdown>
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { brandingFeatureConfig } from 'src/app/branding/branding-config';
import { DestinationAttribute } from 'src/app/core/models/db/destination-attribute.model';
import { ExtendedGenericMapping } from 'src/app/core/models/db/extended-generic-mapping.model';
Expand Down Expand Up @@ -40,7 +41,11 @@ export class GenericMappingTableComponent implements OnInit {

@Input() isDashboardMappingResolve: boolean;

isSearchFocused: boolean;
optionsCopy: DestinationAttribute[];

form: FormGroup = new FormGroup({
searchOption: new FormControl('')
});

readonly brandingFeatureConfig = brandingFeatureConfig;

Expand All @@ -57,6 +62,10 @@ export class GenericMappingTableComponent implements OnInit {
}
}

simpleSearch(query: string) {
this.destinationOptions = this.optionsCopy.filter(attribute => attribute.value.toLowerCase().includes(query.toLowerCase()));
}

getDropdownValue(genericMapping: ExtendedGenericMapping) {
if (genericMapping.employeemapping?.length) {
if (this.employeeFieldMapping===FyleField.VENDOR) {
Expand Down Expand Up @@ -134,6 +143,7 @@ export class GenericMappingTableComponent implements OnInit {
}

ngOnInit(): void {
this.optionsCopy = this.destinationOptions.concat();
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<span [formGroup]="form" [class]="'custom-search-field ' + styleClasses" [ngStyle]="{ 'border-color': isSearchFocused ? 'var(--search-focused-filled-border)' : 'var(--search-default-border)' }">
<i class="pi pi-search"></i>
<app-svg-icon [svgSource]="'search-medium'" [width]="'18px'" [height]="'18px'" [styleClasses]="'tw-text-icon-muted tw-pr-8-px'"></app-svg-icon>
<input [formControlName]="formControllerName" class="tw-pb-1 tw-pt-1 tw-text-14-px tw-text-search-default-filled-text" type="text" (focus)="isSearchFocused = true" (blur)="isSearchFocused = false" [placeholder]="placeholder" />
<app-svg-icon *ngIf="form.value[formControllerName]" (iconClick)="clearSearch()" [svgSource]="'cross-medium'" [c1SvgSource]="'grv-cross-filled-medium'" [width]="'18px'" [height]="'18px'" [styleClasses]="'tw-cursor-pointer tw-text-icon-muted'"></app-svg-icon>
</span>
3 changes: 3 additions & 0 deletions src/assets/icons/arrow-tail-right-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/assets/icons/calendar-medium.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/co/grv-arrow-right-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/co/grv-calendar-medium.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/sprites/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/assets/themes/co/c1dl.scss
Original file line number Diff line number Diff line change
Expand Up @@ -859,5 +859,7 @@
--toggle-width: 38px;

--toggle-height: 22px;

--border-date-picker-border: var(--border-primary);
}
}
10 changes: 10 additions & 0 deletions src/assets/themes/fyle/fdl.scss
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,15 @@
--lv-table-header-border-color: var(--border-secondary);

--lv-table-border-color: var(--border-tertiary);

--calendar-day-text-color: var(--text-label);

--border-date-picker-border: var(--border-secondary);

--date-picker-placeholder-text: var(--text-placeholder);

--calendar-header-text-color: var(--text-primary);

--calendar-date-default-text-color: var(--text-secondary);
}
}
Loading
Loading