Skip to content

Commit

Permalink
614 brief generator issues (#623)
Browse files Browse the repository at this point in the history
* add the comment to work on

* fix the responsive design of the ia modal

* Add the rules and design it to seperate the infos for better user experience

---------

Co-authored-by: skanderKhabou <[email protected]>
  • Loading branch information
skanderKha and skanderKhabou authored Oct 19, 2023
1 parent 8837b9a commit 2c6c632
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
}

@media (max-width: 575.98px) {

.pt-3-mobile {
padding-top: 1rem !important;
}
Expand All @@ -227,6 +228,15 @@
width: 100% !important;
}

.modal-body.modal-custom{
margin-top: 0 !important;
margin-bottom: 3em !important;
}

.btn-close{
z-index: 2;
}

.btn-zoom1 {
top: 70px;
z-index: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class DraftCampaignPresentationComponent implements OnInit {
titles: [''],
title: ['', Validators.required],
summary: ['', Validators.required],
description: [''] // Assuming you have a description field in your formtitle
description: [''] // Assuming you have a descriptigit son field in your formtitle
});
this.render = rendererFactory.createRenderer(null, null);
this.form = new UntypedFormGroup({
Expand All @@ -102,15 +102,16 @@ closeModal(content: any) {
this.isGenerating = true;
this.campaignFacade.generateBriefIA(this.form.get('titles')?.value).subscribe(
(data:any) => {
if(data.message === 'success') {
this.ai_result= data.data.choices[0].message.content;
const jsonData = JSON.parse(this.ai_result);
if(data.message === 'success') {
this.ai_result= data.data.choices[0].message.content;
const jsonData = JSON.parse(this.ai_result);
const title = jsonData.title;
const description = jsonData.description;
const shortDescription = jsonData.short_description;
const rules: string[]= jsonData.rules;
this.form.patchValue({ title: title });
this.form.patchValue({ summary: shortDescription });
this.form.patchValue({ description: description });
this.form.patchValue({ description: '<p><b>DESCRIPTION: </b></p>' + description + '<p><b>RULES: </b></p>' + rules?.map(rule => `- ${rule}`).join('<br>') });
this.isGenerating = false;
this.closeModalAi();
} else this.isGenerating = false;
Expand Down
1 change: 1 addition & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,7 @@ body {
position: relative;
}

/* modal par default prise de styles partout dans le code il faut enlever le justify content */
.modal-content {
position: absolute;
left: 50%;
Expand Down

0 comments on commit 2c6c632

Please sign in to comment.