ciyidogan commited on
Commit
bbec022
·
verified ·
1 Parent(s): 5e97b8d

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
@@ -286,15 +286,17 @@ export default class VersionEditDialogComponent implements OnInit {
286
  }
287
 
288
  async createVersion() {
 
 
289
  const dialogRef = this.dialog.open(ConfirmDialogComponent, {
290
- width: '400px',
291
  data: {
292
  title: 'Create New Version',
293
- message: 'Select source version:',
294
  showDropdown: true,
295
  dropdownOptions: this.versions.map(v => ({
296
  value: v.id,
297
- label: `Version ${v.id}${v.published ? ' (Published)' : ''}${v.description ? ' - ' + v.description : ''}`
298
  })),
299
  dropdownPlaceholder: 'Select source version (or leave empty for blank)',
300
  confirmText: 'Create',
@@ -317,12 +319,14 @@ export default class VersionEditDialogComponent implements OnInit {
317
  id: undefined,
318
  published: false,
319
  last_update_date: undefined,
320
- description: `Copy of version ${sourceVersion.id}`
 
321
  };
322
  }
323
  } else {
324
  // Create blank version
325
  newVersionData = {
 
326
  description: 'New version',
327
  default_api: '',
328
  published: false,
 
286
  }
287
 
288
  async createVersion() {
289
+ const publishedVersions = this.versions.filter(v => v.published);
290
+
291
  const dialogRef = this.dialog.open(ConfirmDialogComponent, {
292
+ width: '500px',
293
  data: {
294
  title: 'Create New Version',
295
+ message: 'Which version would you like to use as a base for the new version?',
296
  showDropdown: true,
297
  dropdownOptions: this.versions.map(v => ({
298
  value: v.id,
299
+ label: `Version ${v.id}${v.published ? ' (Published)' : ''}${v.caption ? ' - ' + v.caption : ''}`
300
  })),
301
  dropdownPlaceholder: 'Select source version (or leave empty for blank)',
302
  confirmText: 'Create',
 
319
  id: undefined,
320
  published: false,
321
  last_update_date: undefined,
322
+ caption: `Copy of version ${sourceVersion.id}`,
323
+ description: sourceVersion.caption ? `Copy of ${sourceVersion.caption}` : `Copy of version ${sourceVersion.id}`
324
  };
325
  }
326
  } else {
327
  // Create blank version
328
  newVersionData = {
329
+ caption: `Version ${this.versions.length + 1}`,
330
  description: 'New version',
331
  default_api: '',
332
  published: false,