Correction
continuous-integration/drone/push Build is passing Details

pull/15/head
Matis MAZINGUE 10 months ago
parent 46fc613f6f
commit dc6c7d7e96

@ -51,11 +51,6 @@
</svg> </svg>
</button> </button>
</div> </div>
<div class="param-editor">
<button class="button-icon" type="button" (click)="addToDatabase()">
{{ 'Editor.Add' | translate }}
</button>
</div>
<div class="param-editor"> <div class="param-editor">
<button <button
class="btn-share" class="btn-share"

@ -82,7 +82,7 @@ const basicSetup: Extension = (() => [
], ],
}) })
export class EditorComponent { export class EditorComponent {
APP_URL = 'http://localhost:4200/'; // à retirer APP_URL = 'http://localhost:4200'; // à retirer
@Input() currentWork!: Work; @Input() currentWork!: Work;
isLoaded: boolean = false; // Pour vérifier si le chargement est terminé isLoaded: boolean = false; // Pour vérifier si le chargement est terminé
@ -208,9 +208,9 @@ export class EditorComponent {
} }
shareButtonClicked() { shareButtonClicked() {
const link = this.addToDatabase(); const link = this.currentWork ? this.currentWork.link : this.addToDatabase();
const url = `${this.APP_URL}/work/${link}`; const url = `${this.APP_URL}/work/${link}`;
const ok = TranslateModule;
// Vérifiez si l'API clipboard est disponible // Vérifiez si l'API clipboard est disponible
if (navigator.clipboard) { if (navigator.clipboard) {
navigator.clipboard navigator.clipboard
@ -230,11 +230,16 @@ export class EditorComponent {
} }
saveButtonClicked() { saveButtonClicked() {
this.workService.updateWork( if (this.currentWork) {
String(this.currentWork.id_work), this.workService.updateWork(
this.editorContent, String(this.currentWork.id_work),
this.selectedLanguage.name this.editorContent,
); this.selectedLanguage.name
);
}
else {
this.addToDatabase();
}
} }
protected readonly console = console; protected readonly console = console;

@ -150,7 +150,7 @@
}, },
"Editor": { "Editor": {
"Share": "Partager", "Share": "Partager",
"Save": "Sauvergarder", "Save": "Sauvegarder",
"Run": "EXECUTER", "Run": "EXECUTER",
"Add": "AJOUTER A LA BDD" "Add": "AJOUTER A LA BDD"
} }

Loading…
Cancel
Save