From 89cb0f26353c1440e966487f961de9f6d166c8b1 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Mon, 15 Sep 2025 17:46:00 +0200 Subject: [PATCH] tab switch results --- .../app/chatbot/message-box/message-box.scss | 271 +++++++++--------- .../projects/sae-lib/buttons/copy/copy.html | 8 +- .../sae-lib/chatbot/bot-talks/bot-talks.html | 27 +- .../sae-lib/chatbot/bot-talks/bot-talks.scss | 35 +++ .../sae-lib/chatbot/bot-talks/bot-talks.ts | 14 +- sae-csc/src/app/app.html | 8 +- sae-csc/src/app/app.ts | 4 + .../case-result/case-result.html | 54 ++-- .../case-result/case-result.scss | 8 +- .../similar-cases/case-result/case-result.ts | 9 +- .../pages/similar-cases/similar-cases.html | 56 ++-- .../pages/similar-cases/similar-cases.scss | 70 ++++- .../app/pages/similar-cases/similar-cases.ts | 6 +- sae-csc/src/app/redux/initialState.ts | 35 ++- sae-csc/src/app/redux/reducers/index.ts | 24 +- .../top-navigation/top-navigation.html | 5 +- 16 files changed, 396 insertions(+), 238 deletions(-) diff --git a/airwatch/src/app/chatbot/message-box/message-box.scss b/airwatch/src/app/chatbot/message-box/message-box.scss index b3fc209..466eb48 100644 --- a/airwatch/src/app/chatbot/message-box/message-box.scss +++ b/airwatch/src/app/chatbot/message-box/message-box.scss @@ -2,159 +2,160 @@ :host { width: 100%; -} -.avatar { + .avatar { - width: 32px; - height: 32px; - flex-shrink: 0; - border-radius: 8px; - background-size: contain !important; + width: 32px; + height: 32px; + flex-shrink: 0; + border-radius: 8px; + background-size: contain !important; - .user & { - background-size: contain; - background: yellow url('../../../../public/user.png'); - } - - - .llm & { - background: yellow url('../../../../public/chatbot.png'); - } - - -} - - -.message { - - .user-more-infos { - margin-top: -35px; - margin-left: 39px; - } - - &.user { - background: white; - color: #000; - } - - &.llm { - .message-content { - color: #000; + .user & { + background-size: contain; + background: yellow url('../../../../public/user.png'); } - .actions { - .button { - background: rgba(59, 135, 204, 0.7); - color: black; - } + + .llm & { + background: yellow url('../../../../public/chatbot.png'); } - } - - .actions { - .fullscreen { - float: right; - } - } - - .app-theme-light & { - - background: #F5F5F5; } - .app-theme-dark & { - - background: #2c2c2c; - color: #d5d5d5; - - .message { - - &.user { - background: #232432; - color: #8b8ecf; - } - - &.llm { - background: #232432; - - .message-content { - color: #8b8ecf; - } - - .actions { - - .button { - background: #0d0e15; - color: grey; - } - } - - } - } - - } - - .app-theme-funky & { - color: #1B1D27; - background: #ffe8e8; - - .message { - .message-content { - color: #fff3f3; - } - - &.user { - background: #d6a3a3; - color: #1B1D27; - } - - &.llm { - - background: #9f36bc; - color: #bba7d6; - - .actions { - - .button { - background: #b08eba; - color: #d4b4ff; - } - } - - } - } - - } .message { + .user-more-infos { + margin-top: -35px; + margin-left: 39px; + } + &.user { - background: variables.$neutral-white; + background: white; + color: #000; } &.llm { - background: rgba(#3B87CC1A, 10%); + .message-content { + color: #000; + } + + .actions { + .button { + background: rgba(59, 135, 204, 0.7); + color: black; + } + } + + } + + .actions { + .fullscreen { + float: right; + } + } + + .app-theme-light & { + + background: #F5F5F5; + + } + + .app-theme-dark & { + + background: #2c2c2c; + color: #d5d5d5; + + .message { + + &.user { + background: #232432; + color: #8b8ecf; + } + + &.llm { + background: #232432; + + .message-content { + color: #8b8ecf; + } + + .actions { + + .button { + background: #0d0e15; + color: grey; + } + } + + } + } + + } + + .app-theme-funky & { + color: #1B1D27; + background: #ffe8e8; + + .message { + .message-content { + color: #fff3f3; + } + + &.user { + background: #d6a3a3; + color: #1B1D27; + } + + &.llm { + + background: #9f36bc; + color: #bba7d6; + + .actions { + + .button { + background: #b08eba; + color: #d4b4ff; + } + } + + } + } + + } + + .message { + + &.user { + background: variables.$neutral-white; + } + + &.llm { + background: rgba(#3B87CC1A, 10%); + + } + } + } + + + .expanded-message-fullscreen { + display: none; + width: 50%; + + &.is-visible { + display: block; + padding: 20px; + background: #ccc; + border-radius: 3px; + position: relative; + top: 0; + left: 0; + z-index: 100; } } -} - - -.expanded-message-fullscreen { - display: none; - width: 50%; - - &.is-visible { - display: block; - padding: 20px; - background: #ccc; - border-radius: 3px; - position: relative; - top: 0; - left: 0; - z-index: 100; - - } + } diff --git a/my-workspace/projects/sae-lib/buttons/copy/copy.html b/my-workspace/projects/sae-lib/buttons/copy/copy.html index dc10c36..2aa2aab 100644 --- a/my-workspace/projects/sae-lib/buttons/copy/copy.html +++ b/my-workspace/projects/sae-lib/buttons/copy/copy.html @@ -1,7 +1,7 @@ - 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 29f3f82..83f2fba 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 @@ -2,21 +2,22 @@
- {{ message }} -
- - +
+ {{ message }} +
+ @if (appState?.dicaReference) { - - - - +
- - - - - +
+ Référence de DICA: +
+
+ {{ appState.dicaReference }} + +
+
+ }
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 a9bcdbf..47d0478 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 @@ -10,6 +10,36 @@ display: flex; flex-direction: row; align-items: center; + + .message { + margin-bottom: 16px; + } + + + .dica-ref-container { + display: flex; + flex-direction: row; + align-items: center; + gap: 5px; + + .label { + font-weight: 600; + } + + .ref { + display: flex; + padding: 6px 10px 8px 10px; + align-items: center; + gap: 5px; + + border-radius: 20px; + background: #C2A9FD; + + + } + + } + } .bubble { @@ -34,4 +64,9 @@ height: 32px; border-radius: 8px; } + + app-copy button.copy { + background: transparent !important; + border: 0; + } } diff --git a/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.ts b/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.ts index b9cb7f7..efd3ee8 100644 --- a/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.ts +++ b/my-workspace/projects/sae-lib/chatbot/bot-talks/bot-talks.ts @@ -1,18 +1,16 @@ import {Component, Input} from '@angular/core'; +import {Copy} from '../../buttons/copy/copy'; @Component({ selector: 'sae-bot-talks', - imports: [], + imports: [ + Copy + ], templateUrl: './bot-talks.html', styleUrl: './bot-talks.scss' }) export class BotTalks { - @Input() public message = 'Hello!'; - @Input() public links: any = [ - { - title: 'Refusal notice :', - label: 'DMP-00051341: Avis de refus', - url: 'https://www.cipherbliss.com/fake-link', - }] + @Input() public message: string = 'Hello!'; + @Input() public appState: any = {}; } diff --git a/sae-csc/src/app/app.html b/sae-csc/src/app/app.html index 72cfd25..d4b6405 100644 --- a/sae-csc/src/app/app.html +++ b/sae-csc/src/app/app.html @@ -1,14 +1,10 @@ - CSC implémentation + CSC Solution Matcher - - - - @if (currentUrl !== '/login' && currentUrl !== '/') { - + } diff --git a/sae-csc/src/app/app.ts b/sae-csc/src/app/app.ts index 5885d7f..6de5416 100644 --- a/sae-csc/src/app/app.ts +++ b/sae-csc/src/app/app.ts @@ -18,6 +18,7 @@ export class App { public router = inject(Router); currentUrl: string = ''; public appState: any = {}; + public user: any = {}; protected readonly title = signal('implem'); constructor(private store: Store) { @@ -25,6 +26,9 @@ export class App { this.store.select(state => state.app).subscribe(appState => { this.appState = appState; }); + this.store.select(state => state.user).subscribe(user => { + this.user = user; + }); this.router.events.pipe( filter(event => event instanceof NavigationEnd) ).subscribe((event: any) => { diff --git a/sae-csc/src/app/pages/similar-cases/case-result/case-result.html b/sae-csc/src/app/pages/similar-cases/case-result/case-result.html index ca76f4e..1303cbe 100644 --- a/sae-csc/src/app/pages/similar-cases/case-result/case-result.html +++ b/sae-csc/src/app/pages/similar-cases/case-result/case-result.html @@ -2,42 +2,51 @@
- -7B / 72-21-02 / Booster blades stg 3 / LPC STG.3 BLADES DISLOCATION / 894773 + -
v
+ 7B / 72-21-02 / Booster blades stg 3 / LPC STG.3 BLADES DISLOCATION / 894773 + +
+
-
+ + +
Information
-
+
Original Question
-
+
Answer Sent
-
+
Engine part
-
+
Findings
-
+
DICA @@ -46,31 +55,40 @@
- + + @if (activeTab == 'info') { + + + AI’s summary : +
+ + {{ case.info }} +
+ + } + @if (activeTab == 'dica') { + {{ case.DICA }} + {{ case.DICA_file }} + } - AI’s summary :
Work stoppage case for CFM56-7B engine (ESN: 894773) at MTU Zhuhai. LPC Stage 3 blade - platform - dislocation detected during shop visit BSI. Maximum dislocation: 1.22mm axial, 0.63mm radial. Customer requests - evaluation, acceptance criteria, or DICA for further action. No corresponding limits in AMM 72-00-00 BSI inspection - chapter.
Date : - 2023-12-12 + {{ case.date }}
Chrono ID : - CSC/CFM/2023-10/00446-A + {{ case.chrono_id }}
Responsable Team : - FO-CFM + {{ case.responsable_team }}
GE Instruction: - - + {{ case.ge_instruction }}
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 bb2d956..be29ea4 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 @@ -51,10 +51,16 @@ flex-direction: row; align-items: start; padding-bottom: 6px; + cursor: pointer; label { padding-left: 6px; - display: inline-block; + display: block; + flex-grow: 1; + } + + &:hover { + font-weight: 600; } &.is-active { diff --git a/sae-csc/src/app/pages/similar-cases/case-result/case-result.ts b/sae-csc/src/app/pages/similar-cases/case-result/case-result.ts index b6e3d98..78f59aa 100644 --- a/sae-csc/src/app/pages/similar-cases/case-result/case-result.ts +++ b/sae-csc/src/app/pages/similar-cases/case-result/case-result.ts @@ -1,19 +1,20 @@ import {Component, Input} from '@angular/core'; +import {NgClass} from '@angular/common'; @Component({ selector: 'app-case-result', - imports: [], + imports: [ + NgClass + ], templateUrl: './case-result.html', styleUrl: './case-result.scss' }) export class CaseResult { - @Input() case: any = {}; - public activeTab: string = '' + public activeTab: string = 'information' selectCaseTab(activeTab: string) { - console.log('todo') this.activeTab = activeTab } } 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 c4ed186..c4fca64 100644 --- a/sae-csc/src/app/pages/similar-cases/similar-cases.html +++ b/sae-csc/src/app/pages/similar-cases/similar-cases.html @@ -12,7 +12,7 @@ New question - @@ -21,8 +21,6 @@ @if (displayHeaderTabs) {
- -
@@ -40,8 +38,6 @@ } @else { {{ appState.fromText }} - - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto cum dolor fugit illo laboriosam necessitatibus neque placeat quam ullam unde. Accusamus asperiores, aspernatur atque autem commodi, dicta doloremque doloribus enim error et illo ipsam labore laborum libero natus necessitatibus nemo officiis perferendis placeat, quo reprehenderit sapiente sint vitae voluptatem voluptatum? }
@@ -53,10 +49,11 @@
-
+
+ [appState]="appState" + [message]="'I found useful document(s) which can help to answer to this question ! Check if these documents are applied to similar cases'" + >
@@ -64,13 +61,25 @@
-
+
Similar cases
-
- Technical manual +
+ Associated documents + + @if (appState.technicalManuals.length > 0) { + + + }
@@ -78,9 +87,12 @@
{{ appState.similarCases.length }} cases found, 3 cases suggested @@ -89,15 +101,15 @@ @if (displayedTab == 'similar-cases') {
-
-
-
- AI suggestions - - -
-
-
+ + + + + + + + +
@@ -114,6 +126,8 @@
+ + (les manuels ici)
}
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 a60e231..9f3c247 100644 --- a/sae-csc/src/app/pages/similar-cases/similar-cases.scss +++ b/sae-csc/src/app/pages/similar-cases/similar-cases.scss @@ -3,6 +3,16 @@ padding: 64px; + + .indicator { + background: green; + width: 8px; + height: 8px; + border-radius: 100%; + margin-left: 16px; + display: inline-block; + } + .title-box { color: #1B1D27; font-family: Barlow; @@ -47,6 +57,12 @@ + button { margin-left: 4px; } + + &.search-solutions { + border-radius: 10px; + color: white; + background: var(--Gradient, linear-gradient(77deg, #073A7C -4.23%, #1767AD 51.8%, #255B8E 87.72%)); + } } } @@ -54,6 +70,7 @@ border-radius: 10px; background: #E3EAF1; padding: 16px; + margin-top: 16px; .tabs { display: flex; @@ -105,10 +122,19 @@ } } + .row-bot-talks { + margin-top: 1rem; + margin-bottom: 1rem; + } + .toggle-ai-suggestion { color: #A86CFD; } + .tabs-container { + margin-top: 32px; + } + .tabs-body { padding: 24px 20px; gap: 32px; @@ -126,9 +152,46 @@ line-height: 16px; width: 100%; min-width: 976px; - display: block; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + + padding: 16px; margin: 5px auto; + + .search { + } + + input { + width: 976px; + padding: 16px; + border: 0; + border-radius: 8px 0 0 8px; + background: #FFF; + } + + .search-submit { + display: inline-flex; + padding: 9px 14px; + align-items: center; + gap: 10px; + border: 0; + display: inline-flex; + padding: 9px 14px; + align-items: center; + gap: 10px; + color: white; + height: 51px; + + border-radius: 0 8px 8px 0; + background: linear-gradient(145deg, #55BCEC -21.82%, #005AA2 82.35%); + + i { + font-size: 1.5rem; + } + } } .tabs-results { @@ -175,10 +238,7 @@ #similar_cases_tab { .cases-results { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; + margin-top: 16px; app-case-result { margin-bottom: 8px; 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 7428b18..9dd01ae 100644 --- a/sae-csc/src/app/pages/similar-cases/similar-cases.ts +++ b/sae-csc/src/app/pages/similar-cases/similar-cases.ts @@ -5,7 +5,6 @@ import {BottomNavigation} from '../../shared/navigation/bottom-navigation/bottom import {StateInterface} from '../../redux/reducers'; import {Store} from '@ngrx/store'; import {NgClass} from '@angular/common'; -import {MainButton} from 'sae-lib/buttons/main-button/main-button'; @Component({ selector: 'app-similar-cases', @@ -14,7 +13,7 @@ import {MainButton} from 'sae-lib/buttons/main-button/main-button'; CaseResult, BottomNavigation, NgClass, - MainButton, + ], templateUrl: './similar-cases.html', styleUrl: './similar-cases.scss' @@ -33,4 +32,7 @@ export class SimilarCases { }); } + filterResults() { + + } } diff --git a/sae-csc/src/app/redux/initialState.ts b/sae-csc/src/app/redux/initialState.ts index da73166..b38b468 100644 --- a/sae-csc/src/app/redux/initialState.ts +++ b/sae-csc/src/app/redux/initialState.ts @@ -7,14 +7,21 @@ export const initialState: StateInterface = { backendAPIRoot: "", demoMode: true, loading: false, - // fromText: "le texte", - fromText: "", + fromText: "le texte original", + // fromText: "", fromFile: "", toText: "", botMessage: "", + dicaReference: "azhe ekhjfhkj e hkjzekjh", + dicaReferenceURL: "fgkj kjrjgik .pdf", + associatedDocuments: [{ + label: 'un doc', + url: 'https://www.cipherbliss.com/un doc.pdf', + }], filters: { engineType: { availableList: [{ + label: 'choix 1', value: 'choix 1', }], @@ -47,6 +54,7 @@ export const initialState: StateInterface = { similarCases: [ { id: 1, + title: "7B / 72-21-02 / Booster blades stg 3 / LPC STG.3 BLADES DISLOCATION / 894773", info: "Work stoppage case for CFM56-7B engine (ESN: 894773) at MTU Zhuhai. LPC Stage 3 blade platform dislocation detected during shop visit BSI. Maximum dislocation: 1.22mm axial, 0.63mm radial. Customer requests evaluation, acceptance criteria, or DICA for further action. No corresponding limits in AMM 72-00-00 BSI inspection chapter. ", date: "2023-01-01", chrono_id: "CSC/CFM/2023-10/00446-A", @@ -58,25 +66,29 @@ export const initialState: StateInterface = { findings: "some findings were found here", DICA: "one dica stuff", DICA_file: "dica_file.pdf", + suggested: true, }, { - id: 1, + id: 2, + title: "21-02 / Booster blades stg 3 / HOP / 894773", info: "Bhlah lahl hl lhalhadlh No corresponding limits in AMM 72-00-00 BSI inspection chapter. ", date: "2024-07-08", chrono_id: "CSC/CFM/1234-10/00446-A", - responsable_team: "FO-CFM", - ge_instruction: "-", + responsable_team: "FO-ZERSEDGF", + ge_instruction: "sdifojsfdgjifkilj", original_question: "blah abl a a jjdbblja bajdblad blab ladlb kaabl", answer_sent: "dfosdoo osg ogf ogf kgof gfkdmdm gfkdfmkl km opsg gfsok sfol lorem", engine_part: "ABD cd CD DC DC ZFR ETT HETHG", findings: "some findings were found here", DICA: "one dica stuff", DICA_file: "dica_file_2.pdf", + suggested: true, }, { - id: 1, + id: 3, + title: "21-02 / Stuff happens / HOP / 132316548564", info: "Work stoppage case for CFM56-7B engine (ESN: 894773) at MTU Zhuhai. LPC Stage 3 blade platform dislocation detected during shop visit BSI. Maximum dislocation: 1.22mm axial, 0.63mm radial. Customer requests evaluation, acceptance criteria, or DICA for further action. No corresponding limits in AMM 72-00-00 BSI inspection chapter. ", date: "2023-01-01", chrono_id: "CSC/CFM/2023-10/00446-A", - responsable_team: "FO-CFM", + responsable_team: "FO-ABC", ge_instruction: "-", original_question: "blah abl a a jjdbblja bajdblad blab ladlb kaabl", answer_sent: "dfosdoo osg ogf ogf kgof gfkdmdm gfkdfmkl km opsg gfsok sfol lorem", @@ -84,11 +96,18 @@ export const initialState: StateInterface = { findings: "some findings were found here", DICA: "one dica stuff", DICA_file: "dica_file.pdf", + suggested: false, }, ], + searchInput: "", enableAiSuggestion: false, - technicalManuals: [], + technicalManuals: [{ + id: '123', + title: 'le manuel 123', + // content: 'blzdlbzdblzblzlb', + // url: 'example.com/url.pdf', + }], resumeTitle: "Work stoppage case for CFM56-7B engine (ESN: 802379)...", admin: { pendingUsers: {}, diff --git a/sae-csc/src/app/redux/reducers/index.ts b/sae-csc/src/app/redux/reducers/index.ts index 397c6d6..33bac04 100644 --- a/sae-csc/src/app/redux/reducers/index.ts +++ b/sae-csc/src/app/redux/reducers/index.ts @@ -71,17 +71,18 @@ export type SelectFilterType = { } export type technicalManualType = { + id: string; title: string; - information: string; - originalQuestion: string; - answerSent: string; - caseSummary: string; - enginePart: object; - findings: object; - date: object; - chronoId: string; - teamInCharge: string; - partNumber: string; + // information: string; + // originalQuestion: string; + // answerSent: string; + // caseSummary: string; + // enginePart: object; + // findings: object; + // date: object; + // chronoId: string; + // teamInCharge: string; + // partNumber: string; } export type AppActions = | UpdateUserAction @@ -106,6 +107,9 @@ export interface StateInterface { fromText: string, toText: string, botMessage: string, + dicaReference: string, + dicaReferenceURL: string, + associatedDocuments: Array, filters: { engineType: SelectFilterType, findings: SelectFilterType, diff --git a/sae-csc/src/app/shared/navigation/top-navigation/top-navigation.html b/sae-csc/src/app/shared/navigation/top-navigation/top-navigation.html index 9c20dff..2692bb1 100644 --- a/sae-csc/src/app/shared/navigation/top-navigation/top-navigation.html +++ b/sae-csc/src/app/shared/navigation/top-navigation/top-navigation.html @@ -38,12 +38,11 @@ - @if (appState.user) { - + @if (user) { }