Skip to content

[WIP] MINOR: Naming templates#691

Open
Amoki wants to merge 5 commits into
developfrom
naming-template-2
Open

[WIP] MINOR: Naming templates#691
Amoki wants to merge 5 commits into
developfrom
naming-template-2

Conversation

@Amoki

@Amoki Amoki commented Jul 1, 2026

Copy link
Copy Markdown
Member

https://platform-dev-naming-template-2.bimdata.io

Description

Add naming constraints interfaces.
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue) DON'T FORGET TO SEND THE PR INTO RELEASE
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project.
  • I have tested my code.
  • My code add or change i18n tokens
  • I want to run the tests for the commits of this PR


// In-memory cache of effective folder rules, keyed by folder id, to avoid
// re-fetching the rule on every rename/upload within the same folder.
const folderRuleCache = new Map();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The cache logic should be moved into NamingConstraintService for code consistency.

return NamingConstraintService.fetchConflictingDocuments(project);
};

export { NamingConstraintConflictError };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Useless import / export of NamingConstraintConflictError it should be imported directly from services/NamingConstraintService.js in the component.

const foldersToUpload = ref([]);
const uploadFiles = async (event, folder = currentFolder.value) => {
const { files, folders } = await getFilesFromEvent(event);
const proceedUpload = async (files, folder) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const proceedUpload = async (files, folder) => {
const proceedUpload = async ({ files, folders }, folder) => {

Comment on lines +359 to +363
let folders = [];
const uploadFiles = async (event, folder = currentFolder.value) => {
const fromEvent = await getFilesFromEvent(event);
const files = fromEvent.files;
folders = fromEvent.folders;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
let folders = [];
const uploadFiles = async (event, folder = currentFolder.value) => {
const fromEvent = await getFilesFromEvent(event);
const files = fromEvent.files;
folders = fromEvent.folders;
const uploadFiles = async (event, folder = currentFolder.value) => {
const { files, folders } = await getFilesFromEvent(event);

return name ? new File([file], name, { type: file.type }) : file;
});
const validFiles = files.filter((file) => matchName(file.name, rule.rule));
proceedUpload([...validFiles, ...finalFiles], folder);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
proceedUpload([...validFiles, ...finalFiles], folder);
proceedUpload({ files: [...validFiles, ...finalFiles], folders }, folder);

return;
}

proceedUpload(files, folder);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
proceedUpload(files, folder);
proceedUpload({ files, folders }, folder);

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants