Skip to content
Merged
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
2 changes: 0 additions & 2 deletions apps/knowledge/serializers/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,6 @@ class Query(serializers.Serializer):
tag_ids = serializers.ListField(child=serializers.UUIDField(), allow_null=True, required=False,
allow_empty=True)
no_tag = serializers.BooleanField(required=False, default=False, allow_null=True)
tag_ids = serializers.ListField(child=serializers.UUIDField(),allow_null=True,required=False,allow_empty=True)
no_tag = serializers.BooleanField(required=False,default=False, allow_null=True)
tag_exclude = serializers.BooleanField(required=False,default=False, allow_null=True)

def get_query_set(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code provided in the diff looks like it has duplicate field declarations for tag_ids and no_tag. This is unnecessary duplication, which should be removed to ensure consistency and possibly improve performance.

Here's the revised version of the code:

@@ -395,10 +395,6 @@ class Query(serializers.Serializer):
         tag_ids = serializers.ListField(
             child=serializers.UUIDField(),
             allow_null=True,
             required=False,
             allow_empty=True
         )
         no_tag = serializers.BooleanField(required=False, default=False, allow_null=True)
-        tag_exclude = serializers.BooleanField(required=False, default=False, allow_null=True)

Key Changes:

  1. Removed Duplicate Field Declarations:
    The lines - tag_ids = serializers.ListField(...) have been moved above the second occurrence of tag_exclude.

This improvement not only cleans up the code but also ensures that each field is declared exactly once, maintaining readability and reducing potential confusion or bugs.

Expand Down
14 changes: 7 additions & 7 deletions ui/src/components/app-icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,32 +594,32 @@ export const iconMap: any = {
h('g', { 'clip-path': 'url(#clip0_10754_9765)' }, [
h('path', {
d: 'M1.23567 0.764126L0.76429 1.23549C0.634122 1.36565 0.634122 1.57668 0.76429 1.70685L13.9629 14.905C14.0931 15.0351 14.3042 15.0351 14.4343 14.905L14.9057 14.4336C15.0359 14.3034 15.0359 14.0924 14.9057 13.9622L1.70705 0.764126C1.57688 0.633963 1.36584 0.633963 1.23567 0.764126Z',
fill: '#3370FF',
fill: 'currentColor',
}),
h('path', {
d: 'M9.77756 6.94871V3.33311C9.77756 3.22403 9.69895 3.1333 9.59528 3.11448L9.55534 3.1109H5.93959L4.60626 1.77762H9.55534C10.3858 1.77762 11.0643 2.42839 11.1086 3.24777L11.1109 3.33311V8.28199L9.77756 6.94871Z',
fill: '#3370FF',
fill: 'currentColor',
}),
h('path', {
d: 'M0.888669 3.71681V8.66623L0.890971 8.75157C0.93528 9.57095 1.61375 10.2217 2.44422 10.2217H4.17756C4.32483 10.2217 4.44422 10.1023 4.44422 9.95506V9.15509C4.44422 9.00782 4.32483 8.88844 4.17756 8.88844H2.44422L2.40428 8.88486C2.30061 8.86604 2.222 8.77531 2.222 8.66623V5.05009L0.888669 3.71681Z',
fill: '#3370FF',
fill: 'currentColor',
}),
h('path', {
d: 'M5.33311 8.16107V12.6661L5.33542 12.7514C5.37972 13.5708 6.0582 14.2216 6.88867 14.2216H11.3938L10.0605 12.8883H6.88867L6.84872 12.8847C6.74506 12.8659 6.66645 12.7751 6.66645 12.6661V9.49435L5.33311 8.16107Z',
fill: '#3370FF',
fill: 'currentColor',
}),
h('path', {
d: 'M8.60626 5.77746L8.88867 6.05986V6.04411C8.88867 5.89684 8.76928 5.77746 8.622 5.77746H8.60626Z',
fill: '#3370FF',
fill: 'currentColor',
}),
h('path', {
d: 'M15.5542 12.7251L14.222 11.393V7.33295C14.222 7.22386 14.1434 7.13313 14.0397 7.11431L13.9998 7.11073H12.2664C12.1192 7.11073 11.9998 6.99135 11.9998 6.84408V6.04411C11.9998 5.89684 12.1192 5.77746 12.2664 5.77746H13.9998C14.8303 5.77746 15.5087 6.42822 15.553 7.2476L15.5553 7.33295V12.6661C15.5553 12.6858 15.555 12.7055 15.5542 12.7251Z',
fill: '#3370FF',
fill: 'currentColor',
}),
]),
h('defs', [
h('clipPath', { id: 'clip0_10754_9765' }, [
h('rect', { width: '16', height: '15.9993', fill: 'white' }),
h('rect', { width: '16', height: '15.9993', fill: 'currentColor' }),
]),
]),
],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code looks clean and does not contain any immediate irregularities or potential issues. The color attribute values are set to '#3370FF' initially but then changed to 'currentColor', which is valid if the default color of elements should be used.

However, there's one suggestion:

Optimization Suggestion:

Ensure that the <defs> section at the bottom is not duplicated within other parts of the codebase. In this case, it appears only once where it defines the clip path for all icons in the map. It's always better to define definitions like SVG filters, gradients, etc., just once per file where they're needed to avoid duplication and improve performance. This can especially impact large projects with many SVG components.

Expand Down