Spaces:
Building
Building
Update flare-ui/src/app/dialogs/version-edit-dialog/version-edit-dialog.component.ts
Browse files
flare-ui/src/app/dialogs/version-edit-dialog/version-edit-dialog.component.ts
CHANGED
@@ -203,6 +203,9 @@ export default class VersionEditDialogComponent implements OnInit {
|
|
203 |
loadVersion(version: Version) {
|
204 |
this.selectedVersion = version;
|
205 |
|
|
|
|
|
|
|
206 |
// Form değerlerini set et
|
207 |
this.versionForm.patchValue({
|
208 |
no: version.no,
|
@@ -392,7 +395,9 @@ export default class VersionEditDialogComponent implements OnInit {
|
|
392 |
|
393 |
// Check if version can be edited
|
394 |
get canEdit(): boolean {
|
395 |
-
|
|
|
|
|
396 |
}
|
397 |
|
398 |
addIntent() {
|
@@ -568,6 +573,8 @@ export default class VersionEditDialogComponent implements OnInit {
|
|
568 |
}
|
569 |
|
570 |
async saveVersion() {
|
|
|
|
|
571 |
if (!this.selectedVersion || !this.canEdit) {
|
572 |
this.snackBar.open('Cannot save published version', 'Close', { duration: 3000 });
|
573 |
return;
|
@@ -681,6 +688,7 @@ export default class VersionEditDialogComponent implements OnInit {
|
|
681 |
const retryUpdateData = {
|
682 |
caption: formValue.caption,
|
683 |
general_prompt: formValue.general_prompt || '',
|
|
|
684 |
llm: formValue.llm,
|
685 |
intents: formValue.intents.map((intent: any) => ({
|
686 |
name: intent.name,
|
|
|
203 |
loadVersion(version: Version) {
|
204 |
this.selectedVersion = version;
|
205 |
|
206 |
+
// Debug published status
|
207 |
+
console.log('Loading version:', version.no, 'Published:', version.published);
|
208 |
+
|
209 |
// Form değerlerini set et
|
210 |
this.versionForm.patchValue({
|
211 |
no: version.no,
|
|
|
395 |
|
396 |
// Check if version can be edited
|
397 |
get canEdit(): boolean {
|
398 |
+
const canEditResult = !this.selectedVersion?.published;
|
399 |
+
console.log('Can edit check:', 'Version:', this.selectedVersion?.no, 'Published:', this.selectedVersion?.published, 'Result:', canEditResult);
|
400 |
+
return canEditResult;
|
401 |
}
|
402 |
|
403 |
addIntent() {
|
|
|
573 |
}
|
574 |
|
575 |
async saveVersion() {
|
576 |
+
console.log('Save button clicked - canEdit:', this.canEdit, 'published:', this.selectedVersion?.published);
|
577 |
+
|
578 |
if (!this.selectedVersion || !this.canEdit) {
|
579 |
this.snackBar.open('Cannot save published version', 'Close', { duration: 3000 });
|
580 |
return;
|
|
|
688 |
const retryUpdateData = {
|
689 |
caption: formValue.caption,
|
690 |
general_prompt: formValue.general_prompt || '',
|
691 |
+
welcome_prompt: formValue.welcome_prompt || '',
|
692 |
llm: formValue.llm,
|
693 |
intents: formValue.intents.map((intent: any) => ({
|
694 |
name: intent.name,
|