hide nav on similar cases page
This commit is contained in:
parent
669b82aeea
commit
facbbee251
13 changed files with 89 additions and 17 deletions
|
@ -45,7 +45,7 @@
|
|||
}
|
||||
@if (appState?.dicaReference) {
|
||||
|
||||
<div class="dica-ref-container">
|
||||
<div class="ref-container">
|
||||
|
||||
<div class="label">
|
||||
Référence de DICA:
|
||||
|
@ -56,6 +56,19 @@
|
|||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (appState?.refusalNotice?.length) {
|
||||
|
||||
<div class="ref-container">
|
||||
|
||||
<div class="label">
|
||||
Notice de refus:
|
||||
</div>
|
||||
<div class="ref">
|
||||
{{ appState.refusalNotice }}
|
||||
<app-copy [textToCopy]="appState.refusalNoticeURL"></app-copy>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
align-items: center;
|
||||
|
||||
|
||||
.dica-ref-container {
|
||||
.ref-container {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
|
|
@ -87,6 +87,8 @@
|
|||
|
||||
.selected-tab-content {
|
||||
min-height: 3rem;
|
||||
max-height: 8rem;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -89,9 +89,11 @@
|
|||
@if (displayedTab == 'similar-cases') {
|
||||
|
||||
<div class="tabs-search">
|
||||
<!-- <i class="ri-search-2-line search"></i>-->
|
||||
|
||||
<input class="search" placeholder="Use keywords for a precise research" type="text">
|
||||
<input id="search_similar_input"
|
||||
class="search"
|
||||
placeholder="Use keywords for a precise research"
|
||||
[(ngModel)]="searchSimilarInput"
|
||||
type="text">
|
||||
<button (click)="filterResults()" class="search-submit">
|
||||
<i class="ri-send-plane-fill"></i>
|
||||
</button>
|
||||
|
@ -106,8 +108,8 @@
|
|||
|
||||
<div class="row cases-results">
|
||||
|
||||
<!-- boucle des résultats-->
|
||||
@for (case of appState.similarCases; track case.id) {
|
||||
<!-- boucle des résultats de appState.similarCases filtrés par #search_similar_input -->
|
||||
@for (case of filteredSimilarCases; track case.id) {
|
||||
|
||||
<app-case-result [case]="case"></app-case-result>
|
||||
}
|
||||
|
@ -130,6 +132,6 @@
|
|||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
<app-bottom-navigation></app-bottom-navigation>
|
||||
<app-bottom-navigation [hideNextStepButton]="true"></app-bottom-navigation>
|
||||
</footer>
|
||||
</div>
|
||||
|
|
|
@ -165,6 +165,7 @@
|
|||
|
||||
|
||||
padding: 16px;
|
||||
padding-left: 40px;
|
||||
margin: 5px auto;
|
||||
|
||||
.search {
|
||||
|
|
|
@ -7,6 +7,7 @@ import {Store} from '@ngrx/store';
|
|||
import {NgClass} from '@angular/common';
|
||||
import {RouterLink} from '@angular/router';
|
||||
import {FiltersGroup} from 'sae-lib/filters/filters-group/filters-group';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-similar-cases',
|
||||
|
@ -17,6 +18,7 @@ import {FiltersGroup} from 'sae-lib/filters/filters-group/filters-group';
|
|||
NgClass,
|
||||
RouterLink,
|
||||
FiltersGroup,
|
||||
FormsModule,
|
||||
|
||||
],
|
||||
templateUrl: './similar-cases.html',
|
||||
|
@ -30,14 +32,39 @@ export class SimilarCases {
|
|||
activeTab: string = "summarized";
|
||||
displayHeaderTabs: boolean = false;
|
||||
disabledFilters: boolean = true;
|
||||
filteredSimilarCases: any = [];
|
||||
searchSimilarInput: string = '';
|
||||
|
||||
constructor(private store: Store<StateInterface>) {
|
||||
this.store.select(state => state.app).subscribe(app => {
|
||||
this.appState = app;
|
||||
// Initialize filteredSimilarCases with all cases by default
|
||||
this.filteredSimilarCases = this.appState.similarCases || [];
|
||||
});
|
||||
}
|
||||
|
||||
filterResults() {
|
||||
if (!this.appState.similarCases) {
|
||||
this.filteredSimilarCases = [];
|
||||
return;
|
||||
}
|
||||
|
||||
// If search input is empty, show all cases
|
||||
if (!this.searchSimilarInput || this.searchSimilarInput.trim() === '') {
|
||||
this.filteredSimilarCases = this.appState.similarCases;
|
||||
return;
|
||||
}
|
||||
|
||||
const searchTerm = this.searchSimilarInput.toLowerCase().trim();
|
||||
|
||||
// Filter cases that contain the search term in any of their string properties
|
||||
this.filteredSimilarCases = this.appState.similarCases.filter((caseItem: any) => {
|
||||
// Check if any property of the case contains the search term
|
||||
return Object.keys(caseItem).some(key => {
|
||||
const value = caseItem[key];
|
||||
// Only check string values
|
||||
return typeof value === 'string' && value.toLowerCase().includes(searchTerm);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ export const initialState: StateInterface = {
|
|||
botMessage: "Veuillez vérifier les filtres préselectionnés",
|
||||
dicaReference: "azhe ekhjfhkj e hkjzekjh",
|
||||
dicaReferenceURL: "fgkj kjrjgik .pdf",
|
||||
refusalNotice: "azhe ekhjfhkj e hkjzekjh",
|
||||
refusalNoticeURL: "fgkj kjrjgik .pdf",
|
||||
associatedDocuments: [{
|
||||
label: 'un doc',
|
||||
url: 'https://www.cipherbliss.com/un doc.pdf',
|
||||
|
|
|
@ -112,6 +112,8 @@ export interface StateInterface {
|
|||
botMessage: string,
|
||||
dicaReference: string,
|
||||
dicaReferenceURL: string,
|
||||
refusalNotice: string,
|
||||
refusalNoticeURL: string,
|
||||
associatedDocuments: Array<any>,
|
||||
filters: {
|
||||
engineType: SelectFilterType,
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
</nav>
|
||||
</div>
|
||||
|
||||
@if(!hideNextStepButton){
|
||||
|
||||
|
||||
<div class="fixed-navigation">
|
||||
<a class="next-step" routerLink="/similar-cases">
|
||||
<span class="label">
|
||||
|
@ -26,6 +29,7 @@
|
|||
</a>
|
||||
</div>
|
||||
|
||||
}
|
||||
<!-- Privacy Policy Popup -->
|
||||
@if (showPrivacyPolicy) {
|
||||
<div class="privacy-policy-popup">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {RouterLink} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
|
@ -11,6 +11,7 @@ import {RouterLink} from '@angular/router';
|
|||
})
|
||||
export class BottomNavigation {
|
||||
showPrivacyPolicy = false;
|
||||
@Input() hideNextStepButton: boolean = false;
|
||||
|
||||
togglePrivacyPolicy(): void {
|
||||
this.showPrivacyPolicy = !this.showPrivacyPolicy;
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<div class="translate-texts is-{{disabled? 'disabled' : 'enabled'}}">
|
||||
|
||||
|
||||
<!-- <button (click)="onRemoveFileSelected()" class="remove-file-upload">-->
|
||||
<!-- onRemoveFileSelected-->
|
||||
<!-- </button>-->
|
||||
<div [ngClass]="{
|
||||
'is-focused' : fromTextFocused
|
||||
}" id="fromText">
|
||||
|
||||
@if (!fileIsUploaded || !appState.fromText.length) {
|
||||
@if (!fileIsUploaded || !appState.fromText.length || !fromTextFocused) {
|
||||
<!-- @if (appState.fromText.length == 0) {-->
|
||||
<button (click)="clickFileUpload(fileUpload)" class=" click-file-upload is-outlined">
|
||||
<span class="label">
|
||||
|
@ -36,7 +38,7 @@
|
|||
{{ fileWeight }}
|
||||
</div>
|
||||
</div>
|
||||
<button class="remove-file-upload" (click)="onRemoveFileSelected()">x</button>
|
||||
<button (click)="onRemoveFileSelected()" class="remove-file-upload">x</button>
|
||||
</div>
|
||||
}
|
||||
<!-- delete button from_text-->
|
||||
|
|
|
@ -122,6 +122,12 @@
|
|||
|
||||
background: variables.$csc-file-selector-bg-color;
|
||||
|
||||
|
||||
margin: 0 16px;
|
||||
position: relative;
|
||||
top: -24px;
|
||||
|
||||
|
||||
.labeling {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||
import {Component, EventEmitter, Inject, Input, Output} from '@angular/core';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {NgClass} from '@angular/common';
|
||||
import {DOCUMENT, NgClass} from '@angular/common';
|
||||
import {Store} from '@ngrx/store';
|
||||
import {ActionTypes, StateInterface} from './../../redux/reducers';
|
||||
|
||||
|
@ -35,7 +35,10 @@ export class TranslateTexts {
|
|||
@Input() appState: any = {};
|
||||
@Output() updateFilters: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
constructor(private store: Store<StateInterface>) {
|
||||
constructor(
|
||||
private store: Store<StateInterface>,
|
||||
@Inject(DOCUMENT) private document: Document
|
||||
) {
|
||||
// Subscribe to the app state to get the loading state
|
||||
this.store.select(state => state.app.loading).subscribe(loading => {
|
||||
this.loadingResume = loading;
|
||||
|
@ -194,17 +197,23 @@ export class TranslateTexts {
|
|||
this.filePath = '';
|
||||
this.fileWeight = '';
|
||||
|
||||
// document.getElementById('fromText')?.focus();
|
||||
const ref = this.document.getElementById('fromText')
|
||||
console.log('ref', ref)
|
||||
if (ref) {
|
||||
ref.focus();
|
||||
}
|
||||
}
|
||||
|
||||
clickFileUpload(fileUpload: HTMLInputElement) {
|
||||
fileUpload.click();
|
||||
console.log('click file upload', fileUpload)
|
||||
this.fileIsUploaded = true;
|
||||
}
|
||||
|
||||
focusFromText(e?: any) {
|
||||
this.onRemoveFileSelected()
|
||||
this.fromTextFocused = true
|
||||
this.fromTextFocused = true;
|
||||
this.fileIsUploaded = false;
|
||||
}
|
||||
|
||||
blurFromText() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue