Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: MOA审批拒绝时不显示备注 --bug=134724637 #1466

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
@@ -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参数编辑渲染问题
Expand Down
5 changes: 5 additions & 0 deletions docs/RELEASE_EN.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
15 changes: 14 additions & 1 deletion itsm/component/bkchat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
21 changes: 20 additions & 1 deletion itsm/openapi/ticket/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 5 additions & 8 deletions itsm/workflow/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
DateTimeType,
TimeType,
BooleanType,
SelectMultipleType, SelectType,
SelectMultipleType,
SelectType,
)
from common.log import logger
from itsm.component.constants import (
Expand Down Expand Up @@ -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):
"""查询全局选项列表信息"""
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -750,7 +747,7 @@ class TemplateFieldViewSet(component_viewsets.ModelViewSet):
"destroy": "field_delete",
"update": "field_edit",
}

filter_fields = {
"id": ["in"],
"key": ["exact", "in", "contains", "startswith"],
Expand Down Expand Up @@ -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):
Expand Down