Skip to content

Commit

Permalink
Merge pull request #677 from intuitem/fix/delete_builtin
Browse files Browse the repository at this point in the history
Prevent direct deletion of library objects
  • Loading branch information
ab-smith authored Jul 27, 2024
2 parents a6c20a0 + 028673c commit 57d52a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/core/migrations/0019_merge_20240726_2156.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Generated by Django 5.0.6 on 2024-07-26 21:56

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("core", "0018_appliedcontrol_csf_function_and_more"),
("core", "0018_framework_translations_loadedlibrary_translations_and_more"),
]

operations = []
1 change: 1 addition & 0 deletions frontend/src/lib/components/ModelTable/ModelTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
const actionsURLModel = source.meta?.urlmodel ?? URLModel;
const preventDelete = (row: TableSource) =>
(row.meta.builtin && actionsURLModel !== 'loaded-libraries') ||
(URLModel !== 'libraries' && Object.hasOwn(row.meta, 'urn') && row.meta.urn) ||
(Object.hasOwn(row.meta, 'reference_count') && row.meta.reference_count > 0);
import { popup } from '@skeletonlabs/skeleton';
Expand Down

0 comments on commit 57d52a1

Please sign in to comment.