Skip to content

Commit

Permalink
issue #1199 - try to stop mandatory columns from being moved
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Nov 21, 2024
1 parent 50aad4f commit 6dc2c6c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions snpdb/models/models_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,17 @@ class VariantGridColumn(models.Model):
model_field = models.BooleanField(default=True) # Standard field, can use Meta inspection to determine colmodel
queryset_field = models.BooleanField(default=True) # In queryset.values() (field or alias)

# These are required to be in custom columns
_MANDATORY_COLUMNS = {
"tags",
"tags_global",
}

def get_css_classes(self):
css_classes = ["user-column"]
if self.grid_column_name in self._MANDATORY_COLUMNS:
css_classes.append("mandatory")

if self.annotation_level:
annotation_level_class = ColumnAnnotationLevel(self.annotation_level).label
css_classes.append("%s-column" % annotation_level_class.lower())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Drag and drop columns to add/remove and change ordering.

The special first "variant" column is automatically created for all custom columns.
<!--
<h3>Mandatory columns</h3>
<ul>
<li><b>ID</b> - The special first "variant" column is automatically created for all custom columns.
<li><b>Tags</b> - This is needed to add tags in an analysis
<li><b>Tags global</b> - Shows all tags associated with a variant
</ul>
-->

<h3>Adding / Removing columns</h3>

<ul>
<li><b>My Columns</b> - active columns. Top to bottom order is shown left to right in the grid.
Expand Down

0 comments on commit 6dc2c6c

Please sign in to comment.