R: Change fieldname comment to description
This commit is contained in:
parent
03fc03a108
commit
417583efa5
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 5.1.7 on 2025-03-25 09:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0005_alter_libraryitem_owner'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='libraryitem',
|
||||
name='comment',
|
||||
field=models.TextField(blank=True, verbose_name='Описание'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 5.1.7 on 2025-03-25 19:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0006_alter_libraryitem_comment'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='libraryitem',
|
||||
old_name='comment',
|
||||
new_name='description',
|
||||
),
|
||||
]
|
|
@ -69,8 +69,8 @@ class LibraryItem(Model):
|
|||
max_length=255,
|
||||
blank=True
|
||||
)
|
||||
comment = TextField(
|
||||
verbose_name='Комментарий',
|
||||
description = TextField(
|
||||
verbose_name='Описание',
|
||||
blank=True
|
||||
)
|
||||
visible = BooleanField(
|
||||
|
|
|
@ -46,7 +46,7 @@ class TestLibraryItem(TestCase):
|
|||
self.assertIsNone(item.owner)
|
||||
self.assertEqual(item.title, 'Test')
|
||||
self.assertEqual(item.alias, '')
|
||||
self.assertEqual(item.comment, '')
|
||||
self.assertEqual(item.description, '')
|
||||
self.assertEqual(item.visible, True)
|
||||
self.assertEqual(item.read_only, False)
|
||||
self.assertEqual(item.access_policy, AccessPolicy.PUBLIC)
|
||||
|
@ -59,13 +59,13 @@ class TestLibraryItem(TestCase):
|
|||
title='Test',
|
||||
owner=self.user1,
|
||||
alias='KS1',
|
||||
comment='Test comment',
|
||||
description='Test description',
|
||||
location=LocationHead.COMMON
|
||||
)
|
||||
self.assertEqual(item.owner, self.user1)
|
||||
self.assertEqual(item.title, 'Test')
|
||||
self.assertEqual(item.alias, 'KS1')
|
||||
self.assertEqual(item.comment, 'Test comment')
|
||||
self.assertEqual(item.description, 'Test description')
|
||||
self.assertEqual(item.location, LocationHead.COMMON)
|
||||
|
||||
|
||||
|
|
|
@ -55,13 +55,13 @@ class LibraryViewSet(viewsets.ModelViewSet):
|
|||
if operation.title != instance.title:
|
||||
operation.title = instance.title
|
||||
changed = True
|
||||
if operation.comment != instance.comment:
|
||||
operation.comment = instance.comment
|
||||
if operation.description != instance.description:
|
||||
operation.description = instance.description
|
||||
changed = True
|
||||
if changed:
|
||||
update_list.append(operation)
|
||||
if update_list:
|
||||
Operation.objects.bulk_update(update_list, ['alias', 'title', 'comment'])
|
||||
Operation.objects.bulk_update(update_list, ['alias', 'title', 'description'])
|
||||
|
||||
def perform_destroy(self, instance: m.LibraryItem) -> None:
|
||||
if instance.item_type == m.LibraryItemType.RSFORM:
|
||||
|
@ -160,7 +160,7 @@ class LibraryViewSet(viewsets.ModelViewSet):
|
|||
clone.owner = cast(User, self.request.user)
|
||||
clone.title = serializer.validated_data['title']
|
||||
clone.alias = serializer.validated_data.get('alias', '')
|
||||
clone.comment = serializer.validated_data.get('comment', '')
|
||||
clone.description = serializer.validated_data.get('description', '')
|
||||
clone.visible = serializer.validated_data.get('visible', True)
|
||||
clone.read_only = False
|
||||
clone.access_policy = serializer.validated_data.get('access_policy', m.AccessPolicy.PUBLIC)
|
||||
|
|
|
@ -7,7 +7,16 @@ from . import models
|
|||
class OperationAdmin(admin.ModelAdmin):
|
||||
''' Admin model: Operation. '''
|
||||
ordering = ['oss']
|
||||
list_display = ['id', 'oss', 'operation_type', 'result', 'alias', 'title', 'comment', 'position_x', 'position_y']
|
||||
list_display = [
|
||||
'id',
|
||||
'oss',
|
||||
'operation_type',
|
||||
'result',
|
||||
'alias',
|
||||
'title',
|
||||
'description',
|
||||
'position_x',
|
||||
'position_y']
|
||||
search_fields = ['id', 'operation_type', 'title', 'alias']
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 5.1.7 on 2025-03-25 09:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('oss', '0008_alter_operation_result'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='operation',
|
||||
name='comment',
|
||||
field=models.TextField(blank=True, verbose_name='Описание'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 5.1.7 on 2025-03-25 19:13
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('oss', '0009_alter_operation_comment'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='operation',
|
||||
old_name='comment',
|
||||
new_name='description',
|
||||
),
|
||||
]
|
|
@ -53,8 +53,8 @@ class Operation(Model):
|
|||
verbose_name='Название',
|
||||
blank=True
|
||||
)
|
||||
comment = TextField(
|
||||
verbose_name='Комментарий',
|
||||
description = TextField(
|
||||
verbose_name='Описание',
|
||||
blank=True
|
||||
)
|
||||
|
||||
|
|
|
@ -141,8 +141,8 @@ class OperationSchema:
|
|||
if schema is not None:
|
||||
operation.alias = schema.alias
|
||||
operation.title = schema.title
|
||||
operation.comment = schema.comment
|
||||
operation.save(update_fields=['result', 'alias', 'title', 'comment'])
|
||||
operation.description = schema.description
|
||||
operation.save(update_fields=['result', 'alias', 'title', 'description'])
|
||||
|
||||
if schema is not None and has_children:
|
||||
rsform = RSForm(schema)
|
||||
|
@ -227,7 +227,7 @@ class OperationSchema:
|
|||
owner=self.model.owner,
|
||||
alias=operation.alias,
|
||||
title=operation.title,
|
||||
comment=operation.comment,
|
||||
description=operation.description,
|
||||
visible=False,
|
||||
access_policy=self.model.access_policy,
|
||||
location=self.model.location
|
||||
|
|
|
@ -44,7 +44,7 @@ class OperationCreateSerializer(serializers.Serializer):
|
|||
model = Operation
|
||||
fields = \
|
||||
'alias', 'operation_type', 'title', \
|
||||
'comment', 'result', 'position_x', 'position_y'
|
||||
'description', 'result', 'position_x', 'position_y'
|
||||
|
||||
create_schema = serializers.BooleanField(default=False, required=False)
|
||||
item_data = OperationCreateData()
|
||||
|
@ -63,7 +63,7 @@ class OperationUpdateSerializer(serializers.Serializer):
|
|||
class Meta:
|
||||
''' serializer metadata. '''
|
||||
model = Operation
|
||||
fields = 'alias', 'title', 'comment'
|
||||
fields = 'alias', 'title', 'description'
|
||||
|
||||
target = PKField(many=False, queryset=Operation.objects.all())
|
||||
item_data = OperationUpdateData()
|
||||
|
|
|
@ -28,6 +28,6 @@ class TestOperation(TestCase):
|
|||
self.assertEqual(self.operation.result, None)
|
||||
self.assertEqual(self.operation.alias, 'KS1')
|
||||
self.assertEqual(self.operation.title, '')
|
||||
self.assertEqual(self.operation.comment, '')
|
||||
self.assertEqual(self.operation.description, '')
|
||||
self.assertEqual(self.operation.position_x, 0)
|
||||
self.assertEqual(self.operation.position_y, 0)
|
||||
|
|
|
@ -123,7 +123,7 @@ class TestChangeAttributes(EndpointTester):
|
|||
|
||||
@decl_endpoint('/api/library/{item}', method='patch')
|
||||
def test_sync_from_result(self):
|
||||
data = {'alias': 'KS111', 'title': 'New Title', 'comment': 'New Comment'}
|
||||
data = {'alias': 'KS111', 'title': 'New Title', 'description': 'New description'}
|
||||
|
||||
self.executeOK(data=data, item=self.ks1.model.pk)
|
||||
self.operation1.refresh_from_db()
|
||||
|
@ -131,7 +131,7 @@ class TestChangeAttributes(EndpointTester):
|
|||
self.assertEqual(self.operation1.result, self.ks1.model)
|
||||
self.assertEqual(self.operation1.alias, data['alias'])
|
||||
self.assertEqual(self.operation1.title, data['title'])
|
||||
self.assertEqual(self.operation1.comment, data['comment'])
|
||||
self.assertEqual(self.operation1.description, data['description'])
|
||||
|
||||
@decl_endpoint('/api/oss/{item}/update-operation', method='patch')
|
||||
def test_sync_from_operation(self):
|
||||
|
@ -140,7 +140,7 @@ class TestChangeAttributes(EndpointTester):
|
|||
'item_data': {
|
||||
'alias': 'Test3 mod',
|
||||
'title': 'Test title mod',
|
||||
'comment': 'Comment mod'
|
||||
'description': 'Comment mod'
|
||||
},
|
||||
'positions': [],
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ class TestChangeAttributes(EndpointTester):
|
|||
self.ks3.refresh_from_db()
|
||||
self.assertEqual(self.ks3.model.alias, data['item_data']['alias'])
|
||||
self.assertEqual(self.ks3.model.title, data['item_data']['title'])
|
||||
self.assertEqual(self.ks3.model.comment, data['item_data']['comment'])
|
||||
self.assertEqual(self.ks3.model.description, data['item_data']['description'])
|
||||
|
||||
@decl_endpoint('/api/library/{item}', method='delete')
|
||||
def test_destroy_oss_consequence(self):
|
||||
|
|
|
@ -281,7 +281,7 @@ class TestChangeOperations(EndpointTester):
|
|||
'item_data': {
|
||||
'alias': 'Test4 mod',
|
||||
'title': 'Test title mod',
|
||||
'comment': 'Comment mod'
|
||||
'description': 'Comment mod'
|
||||
},
|
||||
'positions': [],
|
||||
'substitutions': [
|
||||
|
@ -315,7 +315,7 @@ class TestChangeOperations(EndpointTester):
|
|||
'item_data': {
|
||||
'alias': 'Test4 mod',
|
||||
'title': 'Test title mod',
|
||||
'comment': 'Comment mod'
|
||||
'description': 'Comment mod'
|
||||
},
|
||||
'positions': [],
|
||||
'arguments': [self.operation1.pk],
|
||||
|
|
|
@ -143,7 +143,7 @@ class TestOssViewset(EndpointTester):
|
|||
'item_data': {
|
||||
'alias': 'Test3',
|
||||
'title': 'Test title',
|
||||
'comment': 'Тест кириллицы',
|
||||
'description': 'Тест кириллицы',
|
||||
'position_x': 1,
|
||||
'position_y': 1,
|
||||
},
|
||||
|
@ -165,7 +165,7 @@ class TestOssViewset(EndpointTester):
|
|||
self.assertEqual(new_operation['alias'], data['item_data']['alias'])
|
||||
self.assertEqual(new_operation['operation_type'], data['item_data']['operation_type'])
|
||||
self.assertEqual(new_operation['title'], data['item_data']['title'])
|
||||
self.assertEqual(new_operation['comment'], data['item_data']['comment'])
|
||||
self.assertEqual(new_operation['description'], data['item_data']['description'])
|
||||
self.assertEqual(new_operation['position_x'], data['item_data']['position_x'])
|
||||
self.assertEqual(new_operation['position_y'], data['item_data']['position_y'])
|
||||
self.assertEqual(new_operation['result'], None)
|
||||
|
@ -223,7 +223,7 @@ class TestOssViewset(EndpointTester):
|
|||
'item_data': {
|
||||
'alias': 'Test4',
|
||||
'title': 'Test title',
|
||||
'comment': 'Comment',
|
||||
'description': 'Comment',
|
||||
'operation_type': OperationType.INPUT,
|
||||
'result': self.ks1.model.pk
|
||||
},
|
||||
|
@ -238,7 +238,7 @@ class TestOssViewset(EndpointTester):
|
|||
schema = LibraryItem.objects.get(pk=new_operation['result'])
|
||||
self.assertEqual(schema.alias, data['item_data']['alias'])
|
||||
self.assertEqual(schema.title, data['item_data']['title'])
|
||||
self.assertEqual(schema.comment, data['item_data']['comment'])
|
||||
self.assertEqual(schema.description, data['item_data']['description'])
|
||||
self.assertEqual(schema.visible, False)
|
||||
self.assertEqual(schema.access_policy, self.owned.model.access_policy)
|
||||
self.assertEqual(schema.location, self.owned.model.location)
|
||||
|
@ -286,7 +286,7 @@ class TestOssViewset(EndpointTester):
|
|||
self.executeBadData(data=data, item=self.owned_id)
|
||||
|
||||
self.operation1.result = None
|
||||
self.operation1.comment = 'TestComment'
|
||||
self.operation1.description = 'TestComment'
|
||||
self.operation1.title = 'TestTitle'
|
||||
self.operation1.save()
|
||||
response = self.executeOK(data=data)
|
||||
|
@ -296,7 +296,7 @@ class TestOssViewset(EndpointTester):
|
|||
self.assertEqual(new_schema['id'], self.operation1.result.pk)
|
||||
self.assertEqual(new_schema['alias'], self.operation1.alias)
|
||||
self.assertEqual(new_schema['title'], self.operation1.title)
|
||||
self.assertEqual(new_schema['comment'], self.operation1.comment)
|
||||
self.assertEqual(new_schema['description'], self.operation1.description)
|
||||
|
||||
data['target'] = self.operation3.pk
|
||||
self.executeBadData(data=data)
|
||||
|
@ -326,14 +326,14 @@ class TestOssViewset(EndpointTester):
|
|||
data['input'] = self.ks1.model.pk
|
||||
self.ks1.model.alias = 'Test42'
|
||||
self.ks1.model.title = 'Test421'
|
||||
self.ks1.model.comment = 'TestComment42'
|
||||
self.ks1.model.description = 'TestComment42'
|
||||
self.ks1.save()
|
||||
response = self.executeOK(data=data)
|
||||
self.operation1.refresh_from_db()
|
||||
self.assertEqual(self.operation1.result, self.ks1.model)
|
||||
self.assertEqual(self.operation1.alias, self.ks1.model.alias)
|
||||
self.assertEqual(self.operation1.title, self.ks1.model.title)
|
||||
self.assertEqual(self.operation1.comment, self.ks1.model.comment)
|
||||
self.assertEqual(self.operation1.description, self.ks1.model.description)
|
||||
|
||||
@decl_endpoint('/api/oss/{item}/set-input', method='patch')
|
||||
def test_set_input_change_schema(self):
|
||||
|
@ -382,7 +382,7 @@ class TestOssViewset(EndpointTester):
|
|||
'item_data': {
|
||||
'alias': 'Test3 mod',
|
||||
'title': 'Test title mod',
|
||||
'comment': 'Comment mod'
|
||||
'description': 'Comment mod'
|
||||
},
|
||||
'positions': [],
|
||||
'arguments': [self.operation2.pk, self.operation1.pk],
|
||||
|
@ -406,7 +406,7 @@ class TestOssViewset(EndpointTester):
|
|||
self.operation3.refresh_from_db()
|
||||
self.assertEqual(self.operation3.alias, data['item_data']['alias'])
|
||||
self.assertEqual(self.operation3.title, data['item_data']['title'])
|
||||
self.assertEqual(self.operation3.comment, data['item_data']['comment'])
|
||||
self.assertEqual(self.operation3.description, data['item_data']['description'])
|
||||
args = self.operation3.getQ_arguments().order_by('order')
|
||||
self.assertEqual(args[0].argument.pk, data['arguments'][0])
|
||||
self.assertEqual(args[0].order, 0)
|
||||
|
@ -426,7 +426,7 @@ class TestOssViewset(EndpointTester):
|
|||
'item_data': {
|
||||
'alias': 'Test3 mod',
|
||||
'title': 'Test title mod',
|
||||
'comment': 'Comment mod'
|
||||
'description': 'Comment mod'
|
||||
},
|
||||
'positions': [],
|
||||
}
|
||||
|
@ -435,10 +435,10 @@ class TestOssViewset(EndpointTester):
|
|||
self.operation1.refresh_from_db()
|
||||
self.assertEqual(self.operation1.alias, data['item_data']['alias'])
|
||||
self.assertEqual(self.operation1.title, data['item_data']['title'])
|
||||
self.assertEqual(self.operation1.comment, data['item_data']['comment'])
|
||||
self.assertEqual(self.operation1.description, data['item_data']['description'])
|
||||
self.assertEqual(self.operation1.result.alias, data['item_data']['alias'])
|
||||
self.assertEqual(self.operation1.result.title, data['item_data']['title'])
|
||||
self.assertEqual(self.operation1.result.comment, data['item_data']['comment'])
|
||||
self.assertEqual(self.operation1.result.description, data['item_data']['description'])
|
||||
|
||||
@decl_endpoint('/api/oss/{item}/update-operation', method='patch')
|
||||
def test_update_operation_invalid_substitution(self):
|
||||
|
@ -451,7 +451,7 @@ class TestOssViewset(EndpointTester):
|
|||
'item_data': {
|
||||
'alias': 'Test3 mod',
|
||||
'title': 'Test title mod',
|
||||
'comment': 'Comment mod'
|
||||
'description': 'Comment mod'
|
||||
},
|
||||
'positions': [],
|
||||
'arguments': [self.operation1.pk, self.operation2.pk],
|
||||
|
@ -490,7 +490,7 @@ class TestOssViewset(EndpointTester):
|
|||
self.operation3.refresh_from_db()
|
||||
schema = self.operation3.result
|
||||
self.assertEqual(schema.alias, self.operation3.alias)
|
||||
self.assertEqual(schema.comment, self.operation3.comment)
|
||||
self.assertEqual(schema.description, self.operation3.description)
|
||||
self.assertEqual(schema.title, self.operation3.title)
|
||||
self.assertEqual(schema.visible, False)
|
||||
items = list(RSForm(schema).constituents())
|
||||
|
|
|
@ -295,15 +295,15 @@ class OssViewSet(viewsets.GenericViewSet, generics.ListAPIView, generics.Retriev
|
|||
oss.update_positions(serializer.validated_data['positions'])
|
||||
operation.alias = serializer.validated_data['item_data']['alias']
|
||||
operation.title = serializer.validated_data['item_data']['title']
|
||||
operation.comment = serializer.validated_data['item_data']['comment']
|
||||
operation.save(update_fields=['alias', 'title', 'comment'])
|
||||
operation.description = serializer.validated_data['item_data']['description']
|
||||
operation.save(update_fields=['alias', 'title', 'description'])
|
||||
|
||||
if operation.result is not None:
|
||||
can_edit = permissions.can_edit_item(request.user, operation.result)
|
||||
if can_edit or operation.operation_type == m.OperationType.SYNTHESIS:
|
||||
operation.result.alias = operation.alias
|
||||
operation.result.title = operation.title
|
||||
operation.result.comment = operation.comment
|
||||
operation.result.description = operation.description
|
||||
operation.result.save()
|
||||
if 'arguments' in serializer.validated_data:
|
||||
oss.set_arguments(operation.pk, serializer.validated_data['arguments'])
|
||||
|
|
|
@ -42,7 +42,7 @@ class RSFormTRSSerializer(serializers.Serializer):
|
|||
'type': _TRS_TYPE,
|
||||
'title': schema.title,
|
||||
'alias': schema.alias,
|
||||
'comment': schema.comment,
|
||||
'comment': schema.description,
|
||||
'items': [],
|
||||
'claimed': False,
|
||||
'selection': [],
|
||||
|
@ -78,7 +78,7 @@ class RSFormTRSSerializer(serializers.Serializer):
|
|||
'type': _TRS_TYPE,
|
||||
'title': data['title'],
|
||||
'alias': data['alias'],
|
||||
'comment': data['comment'],
|
||||
'comment': data['description'],
|
||||
'items': [],
|
||||
'claimed': False,
|
||||
'selection': [],
|
||||
|
@ -123,7 +123,7 @@ class RSFormTRSSerializer(serializers.Serializer):
|
|||
if self.context['load_meta']:
|
||||
result['title'] = data.get('title', 'Без названия')
|
||||
result['alias'] = data.get('alias', '')
|
||||
result['comment'] = data.get('comment', '')
|
||||
result['description'] = data.get('description', '')
|
||||
if 'id' in data:
|
||||
result['id'] = data['id']
|
||||
self.instance = RSForm.from_id(result['id'])
|
||||
|
@ -144,7 +144,7 @@ class RSFormTRSSerializer(serializers.Serializer):
|
|||
owner=validated_data.get('owner', None),
|
||||
alias=validated_data['alias'],
|
||||
title=validated_data['title'],
|
||||
comment=validated_data['comment'],
|
||||
description=validated_data['description'],
|
||||
visible=validated_data['visible'],
|
||||
read_only=validated_data['read_only'],
|
||||
access_policy=validated_data['access_policy'],
|
||||
|
@ -171,8 +171,8 @@ class RSFormTRSSerializer(serializers.Serializer):
|
|||
instance.model.alias = validated_data['alias']
|
||||
if 'title' in validated_data:
|
||||
instance.model.title = validated_data['title']
|
||||
if 'comment' in validated_data:
|
||||
instance.model.comment = validated_data['comment']
|
||||
if 'description' in validated_data:
|
||||
instance.model.description = validated_data['description']
|
||||
|
||||
order = 0
|
||||
prev_constituents = instance.constituents()
|
||||
|
|
|
@ -30,7 +30,7 @@ class TestRSFormViewset(EndpointTester):
|
|||
work_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
data = {
|
||||
'title': 'Test123',
|
||||
'comment': '123',
|
||||
'description': '123',
|
||||
'alias': 'ks1',
|
||||
'location': LocationHead.PROJECTS,
|
||||
'access_policy': AccessPolicy.PROTECTED,
|
||||
|
@ -45,7 +45,7 @@ class TestRSFormViewset(EndpointTester):
|
|||
self.assertEqual(response.data['owner'], self.user.pk)
|
||||
self.assertEqual(response.data['title'], data['title'])
|
||||
self.assertEqual(response.data['alias'], data['alias'])
|
||||
self.assertEqual(response.data['comment'], data['comment'])
|
||||
self.assertEqual(response.data['description'], data['description'])
|
||||
|
||||
|
||||
@decl_endpoint('/api/rsforms', method='get')
|
||||
|
|
|
@ -586,8 +586,8 @@ def _prepare_rsform_data(data: dict, request: Request, owner: Union[User, None])
|
|||
data['title'] = 'Без названия ' + request.FILES['file'].fileName
|
||||
if 'alias' in request.data and request.data['alias'] != '':
|
||||
data['alias'] = request.data['alias']
|
||||
if 'comment' in request.data and request.data['comment'] != '':
|
||||
data['comment'] = request.data['comment']
|
||||
if 'description' in request.data and request.data['description'] != '':
|
||||
data['description'] = request.data['description']
|
||||
|
||||
visible = True
|
||||
if 'visible' in request.data:
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
"owner": 1,
|
||||
"title": "Банк выражений",
|
||||
"alias": "БВ",
|
||||
"comment": "Банк шаблонов для генерации выражений",
|
||||
"description": "Банк шаблонов для генерации выражений",
|
||||
"visible": true,
|
||||
"read_only": false,
|
||||
"access_policy": "public",
|
||||
|
@ -105,7 +105,7 @@
|
|||
"owner": 5,
|
||||
"title": "Групповая операция",
|
||||
"alias": "БК09",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"visible": true,
|
||||
"read_only": false,
|
||||
"access_policy": "public",
|
||||
|
@ -122,7 +122,7 @@
|
|||
"owner": 3,
|
||||
"title": "Булева алгебра",
|
||||
"alias": "БК12",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"visible": true,
|
||||
"read_only": false,
|
||||
"access_policy": "public",
|
||||
|
@ -139,7 +139,7 @@
|
|||
"owner": 3,
|
||||
"title": "Генеалогия",
|
||||
"alias": "D0001",
|
||||
"comment": "построено на основе понятия \"родство\" из Википедии",
|
||||
"description": "построено на основе понятия \"родство\" из Википедии",
|
||||
"visible": true,
|
||||
"read_only": false,
|
||||
"access_policy": "public",
|
||||
|
@ -156,7 +156,7 @@
|
|||
"owner": 1,
|
||||
"title": "Вещества и смеси",
|
||||
"alias": "КС Вещества",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"visible": false,
|
||||
"read_only": false,
|
||||
"access_policy": "public",
|
||||
|
@ -173,7 +173,7 @@
|
|||
"owner": 1,
|
||||
"title": "Объект-объектные отношения",
|
||||
"alias": "КС ООО",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"visible": false,
|
||||
"read_only": false,
|
||||
"access_policy": "public",
|
||||
|
@ -190,7 +190,7 @@
|
|||
"owner": 1,
|
||||
"title": "Процессы",
|
||||
"alias": "КС Процессы",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"visible": false,
|
||||
"read_only": false,
|
||||
"access_policy": "public",
|
||||
|
@ -207,7 +207,7 @@
|
|||
"owner": 1,
|
||||
"title": "Экологические правоотношения",
|
||||
"alias": "ЭКОС",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"visible": true,
|
||||
"read_only": false,
|
||||
"access_policy": "public",
|
||||
|
@ -224,7 +224,7 @@
|
|||
"owner": 1,
|
||||
"title": "Объектная среда",
|
||||
"alias": "КС Объект-сред",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"visible": false,
|
||||
"read_only": false,
|
||||
"access_policy": "public",
|
||||
|
@ -241,7 +241,7 @@
|
|||
"owner": 1,
|
||||
"title": "Процессные среды",
|
||||
"alias": "КС Проц-сред",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"visible": false,
|
||||
"read_only": false,
|
||||
"access_policy": "public",
|
||||
|
@ -6763,7 +6763,7 @@
|
|||
"fields": {
|
||||
"operation": 9,
|
||||
"argument": 1,
|
||||
"order": 0
|
||||
"order": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -6772,7 +6772,7 @@
|
|||
"fields": {
|
||||
"operation": 9,
|
||||
"argument": 2,
|
||||
"order": 1
|
||||
"order": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -6781,7 +6781,7 @@
|
|||
"fields": {
|
||||
"operation": 10,
|
||||
"argument": 4,
|
||||
"order": 0
|
||||
"order": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -6790,7 +6790,7 @@
|
|||
"fields": {
|
||||
"operation": 10,
|
||||
"argument": 9,
|
||||
"order": 1
|
||||
"order": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -7414,7 +7414,7 @@
|
|||
"result": 38,
|
||||
"alias": "КС Вещества",
|
||||
"title": "Вещества и смеси",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"position_x": 530.0,
|
||||
"position_y": 370.0
|
||||
}
|
||||
|
@ -7428,7 +7428,7 @@
|
|||
"result": 39,
|
||||
"alias": "КС ООО",
|
||||
"title": "Объект-объектные отношения",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"position_x": 710.0,
|
||||
"position_y": 370.0
|
||||
}
|
||||
|
@ -7442,7 +7442,7 @@
|
|||
"result": 40,
|
||||
"alias": "КС Процессы",
|
||||
"title": "Процессы",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"position_x": 890.0,
|
||||
"position_y": 370.0
|
||||
}
|
||||
|
@ -7456,7 +7456,7 @@
|
|||
"result": 43,
|
||||
"alias": "КС Объект-сред",
|
||||
"title": "Объектная среда",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"position_x": 620.0,
|
||||
"position_y": 470.0
|
||||
}
|
||||
|
@ -7470,7 +7470,7 @@
|
|||
"result": 44,
|
||||
"alias": "КС Проц-сред",
|
||||
"title": "Процессные среды",
|
||||
"comment": "",
|
||||
"description": "",
|
||||
"position_x": 760.0,
|
||||
"position_y": 570.0
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ export const schemaLibraryItem = z.strictObject({
|
|||
item_type: schemaLibraryItemType,
|
||||
title: z.string(),
|
||||
alias: z.string().nonempty(),
|
||||
comment: z.string(),
|
||||
description: z.string(),
|
||||
visible: z.boolean(),
|
||||
read_only: z.boolean(),
|
||||
location: z.string(),
|
||||
|
@ -82,7 +82,7 @@ export const schemaCloneLibraryItem = schemaLibraryItem
|
|||
item_type: true,
|
||||
title: true,
|
||||
alias: true,
|
||||
comment: true,
|
||||
description: true,
|
||||
visible: true,
|
||||
read_only: true,
|
||||
location: true,
|
||||
|
@ -101,7 +101,7 @@ export const schemaCreateLibraryItem = z
|
|||
item_type: schemaLibraryItemType,
|
||||
title: z.string().optional(),
|
||||
alias: z.string().optional(),
|
||||
comment: z.string(),
|
||||
description: z.string(),
|
||||
visible: z.boolean(),
|
||||
read_only: z.boolean(),
|
||||
location: z.string().refine(data => validateLocation(data), { message: errorMsg.invalidLocation }),
|
||||
|
@ -124,7 +124,7 @@ export const schemaUpdateLibraryItem = z.strictObject({
|
|||
item_type: schemaLibraryItemType,
|
||||
title: z.string().nonempty(errorMsg.requiredField),
|
||||
alias: z.string().nonempty(errorMsg.requiredField),
|
||||
comment: z.string(),
|
||||
description: z.string(),
|
||||
visible: z.boolean(),
|
||||
read_only: z.boolean()
|
||||
});
|
||||
|
|
|
@ -43,7 +43,7 @@ export function DlgCloneLibraryItem() {
|
|||
item_type: base.item_type,
|
||||
title: cloneTitle(base),
|
||||
alias: base.alias,
|
||||
comment: base.comment,
|
||||
description: base.description,
|
||||
visible: true,
|
||||
read_only: false,
|
||||
access_policy: AccessPolicy.PUBLIC,
|
||||
|
@ -119,7 +119,7 @@ export function DlgCloneLibraryItem() {
|
|||
)}
|
||||
/>
|
||||
|
||||
<TextArea id='dlg_comment' {...register('comment')} label='Описание' rows={4} error={errors.comment} />
|
||||
<TextArea id='dlg_comment' {...register('description')} label='Описание' rows={4} error={errors.description} />
|
||||
|
||||
{selected.length > 0 ? (
|
||||
<Controller
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('Testing matching LibraryItem', () => {
|
|||
item_type: LibraryItemType.RSFORM,
|
||||
title: 'Item1',
|
||||
alias: 'I1',
|
||||
comment: 'comment',
|
||||
description: 'description',
|
||||
time_create: 'I2',
|
||||
time_update: '',
|
||||
owner: null,
|
||||
|
@ -24,7 +24,7 @@ describe('Testing matching LibraryItem', () => {
|
|||
item_type: LibraryItemType.RSFORM,
|
||||
title: '',
|
||||
alias: '',
|
||||
comment: '',
|
||||
description: '',
|
||||
time_create: '',
|
||||
time_update: '',
|
||||
owner: null,
|
||||
|
@ -46,7 +46,7 @@ describe('Testing matching LibraryItem', () => {
|
|||
expect(matchLibraryItem(item1, item1.title + '@invalid')).toEqual(false);
|
||||
expect(matchLibraryItem(item1, item1.alias + '@invalid')).toEqual(false);
|
||||
expect(matchLibraryItem(item1, item1.time_create)).toEqual(false);
|
||||
expect(matchLibraryItem(item1, item1.comment)).toEqual(true);
|
||||
expect(matchLibraryItem(item1, item1.description)).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ const LOCATION_REGEXP = /^\/[PLUS]((\/[!\d\p{L}]([!\d\p{L}\- ]*[!\d\p{L}])?)*)?$
|
|||
*/
|
||||
export function matchLibraryItem(target: ILibraryItem, query: string): boolean {
|
||||
const matcher = new TextMatcher(query);
|
||||
return matcher.test(target.alias) || matcher.test(target.title) || matcher.test(target.comment);
|
||||
return matcher.test(target.alias) || matcher.test(target.title) || matcher.test(target.description);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -211,10 +211,10 @@ export function FormCreateItem() {
|
|||
|
||||
<TextArea
|
||||
id='schema_comment'
|
||||
{...register('comment')}
|
||||
{...register('description')}
|
||||
label='Описание'
|
||||
placeholder={file && 'Загрузить из файла'}
|
||||
error={errors.comment}
|
||||
error={errors.description}
|
||||
/>
|
||||
|
||||
<div className='flex justify-around gap-6 py-3'>
|
||||
|
|
|
@ -67,7 +67,7 @@ export const schemaOperation = z.strictObject({
|
|||
|
||||
alias: z.string(),
|
||||
title: z.string(),
|
||||
comment: z.string(),
|
||||
description: z.string(),
|
||||
|
||||
position_x: z.number(),
|
||||
position_y: z.number(),
|
||||
|
@ -107,7 +107,7 @@ export const schemaOperationCreate = z.strictObject({
|
|||
alias: z.string().nonempty(),
|
||||
operation_type: schemaOperationType,
|
||||
title: z.string(),
|
||||
comment: z.string(),
|
||||
description: z.string(),
|
||||
position_x: z.number(),
|
||||
position_y: z.number(),
|
||||
result: z.number().nullable()
|
||||
|
@ -145,7 +145,7 @@ export const schemaOperationUpdate = z.strictObject({
|
|||
item_data: z.strictObject({
|
||||
alias: z.string().nonempty(errorMsg.requiredField),
|
||||
title: z.string(),
|
||||
comment: z.string()
|
||||
description: z.string()
|
||||
}),
|
||||
arguments: z.array(z.number()),
|
||||
substitutions: z.array(schemaCstSubstitute)
|
||||
|
|
|
@ -63,10 +63,10 @@ export function InfoOperation({ operation }: InfoOperationProps) {
|
|||
{operation.title}
|
||||
</p>
|
||||
) : null}
|
||||
{operation.comment ? (
|
||||
{operation.description ? (
|
||||
<p>
|
||||
<b>Комментарий: </b>
|
||||
{operation.comment}
|
||||
<b>Описание: </b>
|
||||
{operation.description}
|
||||
</p>
|
||||
) : null}
|
||||
{operation.substitutions.length > 0 ? (
|
||||
|
|
|
@ -56,7 +56,7 @@ export function DlgCreateOperation() {
|
|||
position_y: defaultY,
|
||||
alias: '',
|
||||
title: '',
|
||||
comment: ''
|
||||
description: ''
|
||||
},
|
||||
arguments: initialInputs,
|
||||
create_schema: false,
|
||||
|
|
|
@ -49,7 +49,7 @@ export function TabInputOperation() {
|
|||
setValue('create_schema', false);
|
||||
setValue('item_data.alias', schema.alias);
|
||||
setValue('item_data.title', schema.title);
|
||||
setValue('item_data.comment', schema.comment, { shouldValidate: true });
|
||||
setValue('item_data.description', schema.description, { shouldValidate: true });
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -74,7 +74,7 @@ export function TabInputOperation() {
|
|||
label='Описание'
|
||||
noResize
|
||||
rows={3}
|
||||
{...register('item_data.comment')}
|
||||
{...register('item_data.description')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@ export function TabSynthesisOperation() {
|
|||
label='Описание'
|
||||
noResize
|
||||
rows={3}
|
||||
{...register('item_data.comment')}
|
||||
error={errors.item_data?.comment}
|
||||
{...register('item_data.description')}
|
||||
error={errors.item_data?.description}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ export function DlgEditOperation() {
|
|||
item_data: {
|
||||
alias: target.alias,
|
||||
title: target.title,
|
||||
comment: target.comment
|
||||
description: target.description
|
||||
},
|
||||
arguments: target.arguments,
|
||||
substitutions: target.substitutions.map(sub => ({
|
||||
|
|
|
@ -32,8 +32,8 @@ export function TabOperation() {
|
|||
label='Описание'
|
||||
noResize
|
||||
rows={3}
|
||||
{...register('item_data.comment')}
|
||||
error={errors.item_data?.comment}
|
||||
{...register('item_data.description')}
|
||||
error={errors.item_data?.description}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -38,7 +38,7 @@ export function FormOSS() {
|
|||
item_type: LibraryItemType.RSFORM,
|
||||
title: schema.title,
|
||||
alias: schema.alias,
|
||||
comment: schema.comment,
|
||||
description: schema.description,
|
||||
visible: schema.visible,
|
||||
read_only: schema.read_only
|
||||
}
|
||||
|
@ -90,10 +90,10 @@ export function FormOSS() {
|
|||
|
||||
<TextArea
|
||||
id='schema_comment'
|
||||
{...register('comment')}
|
||||
{...register('description')}
|
||||
label='Описание'
|
||||
rows={3}
|
||||
error={errors.comment}
|
||||
error={errors.description}
|
||||
disabled={!isMutable || isProcessing}
|
||||
/>
|
||||
{isMutable || isModified ? (
|
||||
|
|
|
@ -47,7 +47,7 @@ export function FormRSForm() {
|
|||
item_type: LibraryItemType.RSFORM,
|
||||
title: schema.title,
|
||||
alias: schema.alias,
|
||||
comment: schema.comment,
|
||||
description: schema.description,
|
||||
visible: schema.visible,
|
||||
read_only: schema.read_only
|
||||
}
|
||||
|
@ -119,10 +119,10 @@ export function FormRSForm() {
|
|||
|
||||
<TextArea
|
||||
id='schema_comment'
|
||||
{...register('comment')}
|
||||
{...register('description')}
|
||||
label='Описание'
|
||||
rows={3}
|
||||
error={errors.comment}
|
||||
error={errors.description}
|
||||
disabled={!isContentEditable || isProcessing}
|
||||
/>
|
||||
{isContentEditable || isDirty ? (
|
||||
|
|
Loading…
Reference in New Issue
Block a user