From facbbee251853afddafea54abb3468b6980c23f1 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Wed, 24 Sep 2025 11:40:51 +0200 Subject: [PATCH] hide nav on similar cases page --- .../sae-lib/chatbot/bot-talks/bot-talks.html | 15 ++++++++++- .../sae-lib/chatbot/bot-talks/bot-talks.scss | 3 ++- .../case-result/case-result.scss | 2 ++ .../pages/similar-cases/similar-cases.html | 14 +++++----- .../pages/similar-cases/similar-cases.scss | 1 + .../app/pages/similar-cases/similar-cases.ts | 27 +++++++++++++++++++ sae-csc/src/app/redux/initialState.ts | 2 ++ sae-csc/src/app/redux/reducers/index.ts | 2 ++ .../bottom-navigation/bottom-navigation.html | 4 +++ .../bottom-navigation/bottom-navigation.ts | 3 ++- .../translate-texts/translate-texts.html | 8 +++--- .../translate-texts/translate-texts.scss | 6 +++++ .../shared/translate-texts/translate-texts.ts | 19 +++++++++---- 13 files changed, 89 insertions(+), 17 deletions(-) diff --git a/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.html b/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.html index 63d1cf0..1605ae4 100644 --- a/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.html +++ b/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.html @@ -45,7 +45,7 @@ } @if (appState?.dicaReference) { -
+
Référence de DICA: @@ -56,6 +56,19 @@
} + @if (appState?.refusalNotice?.length) { + +
+ +
+ Notice de refus: +
+
+ {{ appState.refusalNotice }} + +
+
+ }
diff --git a/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.scss b/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.scss index e6454e6..07493b0 100644 --- a/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.scss +++ b/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.scss @@ -14,7 +14,8 @@ align-items: center; - .dica-ref-container { + .ref-container { + margin-top: 8px; display: flex; flex-direction: row; align-items: center; diff --git a/sae-csc/src/app/pages/similar-cases/case-result/case-result.scss b/sae-csc/src/app/pages/similar-cases/case-result/case-result.scss index 722987f..ba0d691 100644 --- a/sae-csc/src/app/pages/similar-cases/case-result/case-result.scss +++ b/sae-csc/src/app/pages/similar-cases/case-result/case-result.scss @@ -87,6 +87,8 @@ .selected-tab-content { min-height: 3rem; + max-height: 8rem; + overflow-y: auto; } } diff --git a/sae-csc/src/app/pages/similar-cases/similar-cases.html b/sae-csc/src/app/pages/similar-cases/similar-cases.html index 7a71be9..403de3c 100644 --- a/sae-csc/src/app/pages/similar-cases/similar-cases.html +++ b/sae-csc/src/app/pages/similar-cases/similar-cases.html @@ -89,9 +89,11 @@ @if (displayedTab == 'similar-cases') { diff --git a/sae-csc/src/app/pages/similar-cases/similar-cases.scss b/sae-csc/src/app/pages/similar-cases/similar-cases.scss index d738d25..d9a5e70 100644 --- a/sae-csc/src/app/pages/similar-cases/similar-cases.scss +++ b/sae-csc/src/app/pages/similar-cases/similar-cases.scss @@ -165,6 +165,7 @@ padding: 16px; + padding-left: 40px; margin: 5px auto; .search { diff --git a/sae-csc/src/app/pages/similar-cases/similar-cases.ts b/sae-csc/src/app/pages/similar-cases/similar-cases.ts index b4d353b..55f48b2 100644 --- a/sae-csc/src/app/pages/similar-cases/similar-cases.ts +++ b/sae-csc/src/app/pages/similar-cases/similar-cases.ts @@ -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) { 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); + }); + }); } } diff --git a/sae-csc/src/app/redux/initialState.ts b/sae-csc/src/app/redux/initialState.ts index 5ee4be3..057c38f 100644 --- a/sae-csc/src/app/redux/initialState.ts +++ b/sae-csc/src/app/redux/initialState.ts @@ -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', diff --git a/sae-csc/src/app/redux/reducers/index.ts b/sae-csc/src/app/redux/reducers/index.ts index 577ad72..3522279 100644 --- a/sae-csc/src/app/redux/reducers/index.ts +++ b/sae-csc/src/app/redux/reducers/index.ts @@ -112,6 +112,8 @@ export interface StateInterface { botMessage: string, dicaReference: string, dicaReferenceURL: string, + refusalNotice: string, + refusalNoticeURL: string, associatedDocuments: Array, filters: { engineType: SelectFilterType, diff --git a/sae-csc/src/app/shared/navigation/bottom-navigation/bottom-navigation.html b/sae-csc/src/app/shared/navigation/bottom-navigation/bottom-navigation.html index d1547f6..89226cf 100644 --- a/sae-csc/src/app/shared/navigation/bottom-navigation/bottom-navigation.html +++ b/sae-csc/src/app/shared/navigation/bottom-navigation/bottom-navigation.html @@ -14,6 +14,9 @@ + @if(!hideNextStepButton){ + + + } @if (showPrivacyPolicy) {
diff --git a/sae-csc/src/app/shared/navigation/bottom-navigation/bottom-navigation.ts b/sae-csc/src/app/shared/navigation/bottom-navigation/bottom-navigation.ts index b72393c..2f94803 100644 --- a/sae-csc/src/app/shared/navigation/bottom-navigation/bottom-navigation.ts +++ b/sae-csc/src/app/shared/navigation/bottom-navigation/bottom-navigation.ts @@ -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; diff --git a/sae-csc/src/app/shared/translate-texts/translate-texts.html b/sae-csc/src/app/shared/translate-texts/translate-texts.html index bb0a4a6..69cd684 100644 --- a/sae-csc/src/app/shared/translate-texts/translate-texts.html +++ b/sae-csc/src/app/shared/translate-texts/translate-texts.html @@ -1,11 +1,13 @@
- + + +
- @if (!fileIsUploaded || !appState.fromText.length) { + @if (!fileIsUploaded || !appState.fromText.length || !fromTextFocused) {
- +
} diff --git a/sae-csc/src/app/shared/translate-texts/translate-texts.scss b/sae-csc/src/app/shared/translate-texts/translate-texts.scss index 989df9c..0e13495 100644 --- a/sae-csc/src/app/shared/translate-texts/translate-texts.scss +++ b/sae-csc/src/app/shared/translate-texts/translate-texts.scss @@ -122,6 +122,12 @@ background: variables.$csc-file-selector-bg-color; + + margin: 0 16px; + position: relative; + top: -24px; + + .labeling { display: flex; flex-direction: row; diff --git a/sae-csc/src/app/shared/translate-texts/translate-texts.ts b/sae-csc/src/app/shared/translate-texts/translate-texts.ts index 1cc0323..551e41a 100644 --- a/sae-csc/src/app/shared/translate-texts/translate-texts.ts +++ b/sae-csc/src/app/shared/translate-texts/translate-texts.ts @@ -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 = new EventEmitter(); - constructor(private store: Store) { + constructor( + private store: Store, + @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() {