diff --git a/docs/RELEASE.md b/docs/RELEASE.md index ca414ec1..4f19f6e7 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -1,4 +1,9 @@ # Changelog +## [Version: 2.7.4.rc0] - 2025-01-09 +【修复】MOA审批拒绝时不显示备注字段 +【修复】内置审批服务页面异常 + + ## [Version: 2.7.3] - 2024-11-25 【新增】meta上下文管理功能,应用于快速审批、MOA和通知过滤 【修复】API请求节点POST参数编辑渲染问题 diff --git a/docs/RELEASE_EN.md b/docs/RELEASE_EN.md index 7297cd8a..c8dbf971 100644 --- a/docs/RELEASE_EN.md +++ b/docs/RELEASE_EN.md @@ -1,4 +1,9 @@ # Changelog +## [Version: 2.7.4.rc0] - 2025-01-09 +【Fix】The remark field is not displayed when the ticket is rejected through MOA. +【Fix】Abnormality of internal workflow page + + ## [Version: 2.7.3] - 2024-11-25 【Feature】Add meta context management, applied to fast approval, MOA, and notification receivers filter. 【Fix】API request node POST parameter editing rendering issue. diff --git a/itsm/component/bkchat/utils.py b/itsm/component/bkchat/utils.py index 6938ef2f..8fed9fc3 100644 --- a/itsm/component/bkchat/utils.py +++ b/itsm/component/bkchat/utils.py @@ -271,7 +271,20 @@ def proceed_fast_approval(request): } ) else: - if not remarked: + if remarked: + break + if approve_action == "true" and field.validate_type == "OPTION": + fields.append( + { + "id": field.id, + "key": field.key, + "type": field.type, + "choice": field.choice, + "value": "快速审批,审批人:{}".format(receiver), + } + ) + remarked = True + if approve_action == "false" and field.validate_type == "REQUIRE": fields.append( { "id": field.id, diff --git a/itsm/openapi/ticket/views.py b/itsm/openapi/ticket/views.py index f5faf7e9..398614c5 100644 --- a/itsm/openapi/ticket/views.py +++ b/itsm/openapi/ticket/views.py @@ -604,7 +604,26 @@ def proceed_approval(self, request): } ) else: - if not remarked: + if remarked: + break + if ( + serializer.validated_data["submit_action"] == "true" + and field.validate_type == "OPTION" + ): + fields.append( + { + "id": field.id, + "key": field.key, + "type": field.type, + "choice": field.choice, + "value": serializer.validated_data["submit_opinion"], + } + ) + remarked = True + if ( + serializer.validated_data["submit_action"] == "false" + and field.validate_type == "REQUIRE" + ): fields.append( { "id": field.id, diff --git a/itsm/workflow/views.py b/itsm/workflow/views.py index e0d709c6..4e6e0b8f 100644 --- a/itsm/workflow/views.py +++ b/itsm/workflow/views.py @@ -47,7 +47,8 @@ DateTimeType, TimeType, BooleanType, - SelectMultipleType, SelectType, + SelectMultipleType, + SelectType, ) from common.log import logger from itsm.component.constants import ( @@ -192,10 +193,6 @@ class WorkflowViewSet( permission_free_actions = ["get_global_choices", "list"] permission_classes = (WorkflowIamAuth,) - def get_queryset(self): - self.queryset = self.queryset.exclude(flow_type="internal") - return self.queryset - @action(detail=False, methods=["get"]) def get_global_choices(self, request): """查询全局选项列表信息""" @@ -540,7 +537,7 @@ def get_iam_resource_id(self): if self.action == "batch_update": return self.request.data.get("workflow_id") return None - + def perform_destroy(self, instance): # 从开始节点出来的连线只能由一条, 且不能被删除 if instance.from_state.type == START_STATE: @@ -750,7 +747,7 @@ class TemplateFieldViewSet(component_viewsets.ModelViewSet): "destroy": "field_delete", "update": "field_edit", } - + filter_fields = { "id": ["in"], "key": ["exact", "in", "contains", "startswith"], @@ -1102,7 +1099,7 @@ class TaskSchemaViewSet(DynamicListModelMixin, component_viewsets.ModelViewSet): permission_action_platform = "public_task_template_manage" permission_create_action = ["create", "clone"] permission_resource_is_project = True - + pagination_class = None def update(self, request, *args, **kwargs):