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: UX Document Conversion in multi worker environment #1378

Open
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

hexaltation
Copy link
Collaborator

Context

#1181 was revert due to gristlabs internal CI failing in multi-worker environment.

Proposed solution

This PR implements the same user journey fixing inconsistencies with multi-worker.
We will discuss @georgegevoian's remark #1015 (comment) in an other issue if changes are needed in a product point of view.

Related issues

Fixes #1015

Has this been tested?

  • 👍 yes, I added tests to the test suite

Copy link
Collaborator

@fflorent fflorent left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +475 to +488
const typeList: DocumentTypeItem[] = [{
label: t('Regular'),
type: ''
}, {
label: t('Template'),
type: 'template'
}, {
label: t('Tutorial'),
type: 'tutorial'
}].map((el) => ({
...el,
value: el.label,
cleanText: el.label.trim().toLowerCase()
}));
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling t top-level like this can be problematic. I'd suggest wrapping this in a function that returns the array.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hello @georgegevoian,

For my own culture can you be more explicit on what can be problematic with using t() at top level?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that's because the t function may not be initialized correctly (it needs to download a JSON file with the locales).

app/common/UserAPI.ts Outdated Show resolved Hide resolved
app/client/ui/DocumentSettings.ts Outdated Show resolved Hide resolved
app/client/ui/DocumentSettings.ts Outdated Show resolved Hide resolved
@hexaltation hexaltation force-pushed the issue-1015-convert-document-to-template-tuto branch from b3e151f to e4756cf Compare January 16, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs feedback
Status: Dev to review
Development

Successfully merging this pull request may close these issues.

Converting documents to tutorials or templates through the UI
3 participants