Browse Source

feat(AdvancedTable): Dont allow less than 1 visible data column

Owen Diffey 3 năm trước cách đây
mục cha
commit
1fd3add04a
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      frontend/src/components/AdvancedTable.vue

+ 4 - 0
frontend/src/components/AdvancedTable.vue

@@ -493,6 +493,10 @@ export default {
 		},
 		toggleColumnVisibility(column) {
 			if (this.shownColumns.indexOf(column.name) !== -1) {
+				if (this.shownColumns.length <= 2)
+					return new Toast(
+						`Unable to hide column ${column.displayName}, there must be at least 1 visibile column`
+					);
 				this.shownColumns.splice(
 					this.shownColumns.indexOf(column.name),
 					1