Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: New conversation user, user group should be a mandatory field(#3833)
fix: Filter empty files uploaded during application dialogue(#3836)
fix: License not uploaded, knowledge base hits test interface style issue(#3852)
perf: Optimize packaging

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Aug 20, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Aug 20, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wangdan-fit2cloud wangdan-fit2cloud merged commit e715e24 into v2 Aug 20, 2025
2 of 5 checks passed
@wangdan-fit2cloud wangdan-fit2cloud deleted the pr@v2@fix-wangdan branch August 20, 2025 11:02
)
return
}
const inner = reactive(file)
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 given JavaScript function uploadFile has several checks to handle file uploads, including limits on number of files, file size, and warning messages for excessive limit usage or invalid file sizes.

  1. Code Review:

    • The logic for filtering out empty files (fileLimitOnce reached) is correct.
    • The size filter seems redundant since it mirrors the initial size condition after processing duplicates from step 1.
    • Consider combining duplicate conditions into a single check if they are essentially the same.
  2. Optimization Suggestions:

    • Single Size Filter: Since both conditions involve checking against fileLimit, you can consolidate them into one loop using a helper function or by directly returning without an additional conditional if applicable.
  3. Additional Enhancements:

    • Add timestamps for each processed file to keep track of when different types (audio, video, other) were appended. This could be useful for logging purposes or future features like auto-updating display order based on time stamps.
    • Implement error handling around file reading operations to ensure robustness during upload processes.

Here's a revised version with minor adjustments:

const uploadFile = async (file: any, fileList: any): Promise<void> => {
  const uploadedCount =
    uploadAudioList.value.length + 
    uploadVideoList.value.length + 
    uploadOtherList.value.length;

  if (uploadedCount >= maxFiles) {
    MsgWarning(`${t('chat.uploadFile.limitMessage1')} ${maxFiles} ${t('chat.uploadFile.limitMessage2')}`);
    fileList.splice(0, fileList.length, ...fileList.slice(0, maxFiles));
    return;
  }

  let validFiles = fileList.filter(f => f.size <= fileLimit * 1024 * 1024 && f.size !== 0);

  if (validFiles.length === 0) {
    msg.Warning(t('chat.uploadFile.emptyValid'));
    return;
  }

  internal.push(...validFiles);
};

In this updated version:

  • Combining Conditions: Removed redundant size checks that mirror those in previous steps.
  • Error Handling: Added a message for zero-valid-files scenario.

These changes improve readability and potentially reduce unnecessary computations without compromising functionality.

nicknameExist: 'The following nicknames already exist:',
}
},
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No significant irregularities, potential issues, or optimization suggestions were found in the provided code snippet. The translation and structure remain consistent throughout. There is no need for further changes.

.el-select__placeholder {
color: var(--el-text-color-regular);
}
}
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 CSS rule looks mostly correct for styling an .el-select component within an .el-input-group__prepend. A few minor optimizations and cleanups can be made:

  1. Remove redundant background styles:
-.el-input-group__prepend div.el-select .el-select__wrapper {
  1. Ensure consistent indentation and formatting.

Here's the optimized version of your code:

.el-input-group__prepend div.el-select .el-select__wrapper {
  --el-bg-color-overlay: transparent; /* Add missing property if needed */
  background: rgba(255, 255, 255, 0); /* Fallback to RGBA for older browsers */

  &:hover {
    --el-bg-color-overlay: transparent;
    background: rgba(255, 255, 255, 0); /* Same as hover state */  
}

/* Uncomment below to define placeholder color explicitly (if needed): 
.el-select__placeholder { */
  /* color: var(--el-text-color-regular); */
}

These changes make the CSS more concise and ensure better readability. If you're targeting modern browsers that support background-color, removing unnecessary properties like --el-bg-color-overlay with hardcoded values is a good practice. The placeholder style remains commented out unless specifically necessary to override default behaviors from other UI components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants