csc loading spinner

This commit is contained in:
tykayn 2025-09-22 09:59:08 +02:00
parent 8a426e6d0e
commit c8d013d57d
11 changed files with 71 additions and 36 deletions

View file

@ -24,7 +24,8 @@
</span>
</div>
<sae-translate-texts [appState]="appState"></sae-translate-texts>
<sae-translate-texts (onSuggestionMade)="displayWarningToCheckFilters()"
[appState]="appState"></sae-translate-texts>
</div>
<!-- analyse de question-->
<div id="question_analysis">
@ -32,7 +33,6 @@
Question analysis
</h2>
@if (appState?.botMessage) {
<sae-bot-talks
[message]="appState.botMessage"></sae-bot-talks>
}

View file

@ -1,8 +1,6 @@
:host {
//width: 1312px;
//display: block;
font-family: Barlow;
margin: 0 auto;
#question_analysis {
@ -36,6 +34,9 @@
padding-bottom: 16px;
width: 1600px;
margin: 0 auto;
span {
&:nth-of-type(1) {
width: 560px;

View file

@ -39,4 +39,9 @@ export class Main {
onAvailableChoicesChange(e: any) {
console.log('onSelectedChoicesChange', e);
}
displayWarningToCheckFilters() {
// update app, displayBotT
this.store.dispatch()
}
}

View file

@ -3,7 +3,7 @@
<div id="fromText">
@if (!fileIsUploaded && !textFocused) {
@if (!fileIsUploaded) {
<button (click)="clickFileUpload(fileUpload)" class=" click-file-upload is-outlined">
<span class="label">
Upload .csv file
@ -41,30 +41,37 @@
'is-visible' : fromText.length
}" class="delete-button button">x
</button>
<textarea
(focus)="focusFromText()"
(keyup)="onFromTextChanged()"
(ngModelChange)="onFromTextChanged()"
[ngModel]="appState.fromText"
cols="30"
id="from_text"
name="from_text"
placeholder="Copy/paste clients question \n or Drag and drop extracted .csv file from CRM portal..."
rows="5"></textarea>
@if (!fileIsUploaded) {
<textarea
(focus)="focusFromText()"
(keyup)="onFromTextChanged()"
(ngModelChange)="onFromTextChanged()"
[ngModel]="appState.fromText"
cols="30"
id="from_text"
name="from_text"
placeholder="Copy/paste clients question \n or Drag and drop extracted .csv file from CRM portal..."
rows="5"></textarea>
}
</div>
<div id="toText">
@if (loadingResume) {
<div class="loading">
loading...
<div class="loading-container">
<div class="loading">
<div class="spinning">
<i class="ri-restart-line"></i>
</div>
</div>
</div>
}
@if (toText.length > 0) {
<button (click)="emptyText('toText')" class="delete-button button">x</button>
}
<textarea [(ngModel)]="toText" cols="30" id="to_text" name="to_text" rows="10"></textarea>
@if (!loadingResume) {
<textarea [(ngModel)]="toText" cols="30" id="to_text" name="to_text" rows="10"></textarea>
}
</div>
</div>

View file

@ -139,4 +139,36 @@
display: none;
}
.loading-container {
display: flex;
justify-content: center;
align-items: center;
height: calc(235px - 16px);
}
.loading {
width: 3rem;
height: 3rem;
color: variables.$csc-magic-color;
i {
font-size: 3rem;
}
}
// Spinner animation
.spinning {
animation: spin 1s linear infinite;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
}

View file

@ -18,10 +18,11 @@ export class TranslateTexts {
public debounceEnabled: boolean = true;
public textFocused: boolean = false;
public fileIsUploaded: boolean = false;
public filePath: string = '';
public fileWeight: string = '';
// testing display of file selector
// public fileIsUploaded: boolean = true;
// public filePath: string = 'abcd.csv';
@ -91,6 +92,7 @@ export class TranslateTexts {
console.log('demo mode')
this.toText = "Résumé de démo à titre d'exemple"
this.loadingResume = false;
},
this.debounceDuration);