Browse Source

cdb-view: don't allow views on sheet with data files

lviguier 1 year ago
parent
commit
657af61150
1 changed files with 6 additions and 1 deletions
  1. 6 1
      hide/comp/cdb/Editor.hx

+ 6 - 1
hide/comp/cdb/Editor.hx

@@ -2506,7 +2506,6 @@ class Editor extends Component {
 					endChanges();
 					onChange();
 				}},
-				{ label : '${getSheetProps(sheet).view == null ? "Create View" : "Edit View"}', click : function() { createView(getSheetProps(sheet).view != null ? null : sheet, getSheetProps(sheet).view != null ? sheet : null , index+1); } },
 				{ label : "Categories", menu: categoriesMenu(getSheetProps(sheet).categories, function(cats) {
 					beginChanges();
 					var props = getSheetProps(sheet);
@@ -2519,6 +2518,12 @@ class Editor extends Component {
 
 			]);
 		}
+		if ( sheet.props.dataFiles == null ) {
+			content.push({
+				label : '${getSheetProps(sheet).view == null ? "Create View" : "Edit View"}',
+				click : function() { createView(getSheetProps(sheet).view != null ? null : sheet, getSheetProps(sheet).view != null ? sheet : null , index+1); }
+			});
+		}
 		if( sheet.props.dataFiles == null )
 			content = content.concat([
 				{ label : "Add Index", checked : sheet.props.hasIndex, click : function() {