Skip to content

Commit

Permalink
feat: hide custom fields in summary tab only closes #1745
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Jan 28, 2024
1 parent 6855493 commit f96dc69
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.9 on 2024-01-28 02:50

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("core", "0039_coresettings_smtp_from_name"),
]

operations = [
migrations.AddField(
model_name="customfield",
name="hide_in_summary",
field=models.BooleanField(default=False),
),
]
18 changes: 18 additions & 0 deletions api/tacticalrmm/core/migrations/0041_auto_20240128_0301.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.9 on 2024-01-28 03:01

from django.db import migrations


def update_hide_in_summary(apps, schema_editor):
CustomField = apps.get_model("core", "CustomField")
for field in CustomField.objects.filter(hide_in_ui=True):
field.hide_in_summary = True
field.save(update_fields=["hide_in_summary"])


class Migration(migrations.Migration):
dependencies = [
("core", "0040_customfield_hide_in_summary"),
]

operations = [migrations.RunPython(update_hide_in_summary)]
1 change: 1 addition & 0 deletions api/tacticalrmm/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ class CustomField(BaseAuditModel):
default=list,
)
hide_in_ui = models.BooleanField(default=False)
hide_in_summary = models.BooleanField(default=False)

class Meta:
unique_together = (("model", "name"),)
Expand Down

0 comments on commit f96dc69

Please sign in to comment.