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

refactor(editor): restrict mapping discoverability tooltip showing only on string input #4496

Merged
merged 9 commits into from
Nov 3, 2022

Conversation

cstuncsik
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Nov 1, 2022

N8N-5345

…ts can be mapped, but we want to show tooltips only on string inputs
@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Nov 1, 2022
ivov
ivov previously approved these changes Nov 1, 2022
Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

Tested with toggle and no longer triggering there.

packages/editor-ui/src/plugins/i18n/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

Thanks! The empty string default arg is missing.

@cstuncsik
Copy link
Contributor Author

Done

@cstuncsik cstuncsik requested a review from ivov November 3, 2022 10:45
@ivov
Copy link
Contributor

ivov commented Nov 3, 2022

Question, do you think the i18n signatures should be changed? My reasoning was that having an object as in the original keeps the i18n calls more readable, with labels key and fallback for the args. Above I meant only this change below, allowing us to remove unneeded ?? ''. Sorry if I was unclear.

private dynamicRender(
	{ key, fallback = '' }: { key: string; fallback: string; },
) {
	return this.i18n.te(key) ? this.i18n.t(key).toString() : fallback;
}

@cstuncsik
Copy link
Contributor Author

cstuncsik commented Nov 3, 2022

No problem

The following is not working, you can't define defaults and types at the same time and with default '' ts infers it as string and will complain about the passed parameter (since in most cases it is optional it can be undefined)

private dynamicRender(
  { key, fallback } = { key: '', fallback: '' },
) {
  return this.i18n.te(key) ? this.i18n.t(key).toString() : fallback;
}

So the only thing we can do is to move ?? '' part into this function

private dynamicRender(
  { key, fallback }: { key: string; fallback: string; },
) {
  return this.i18n.te(key) ? this.i18n.t(key).toString() : fallback ?? '';
}

@cstuncsik cstuncsik merged commit 78c024b into master Nov 3, 2022
@cstuncsik cstuncsik deleted the n8n-5345-mapping-discoverability-tooltip-showing branch November 3, 2022 12:04
@n8n-assistant n8n-assistant bot added the Upcoming Release Will be part of the upcoming release label Nov 3, 2022
MiloradFilipovic added a commit that referenced this pull request Nov 4, 2022
* master:
  refactor(editor): Migrate part of the vuex store to pinia (#4484)
  fix(editor): fix themes the monaco editor (no-changelog) (#4521)
  refactor(editor): restrict mapping discoverability tooltip showing only on string input (#4496)
  📚 Remove entries from Changelog
  📚 Update CHANGELOG.md and main package.json to 0.201.0
  🔖 Release [email protected]
  ⬆️ Set [email protected], [email protected], [email protected] and [email protected] on n8n
  🔖 Release [email protected]
  ⬆️ Set [email protected] and [email protected] on n8n-editor-ui
  🔖 Release [email protected]
  🔖 Release [email protected]
  ⬆️ Set [email protected] and [email protected] on n8n-nodes-base
  🔖 Release [email protected]
  ⬆️ Set [email protected] and [email protected] on n8n-node-dev
  🔖 Release [email protected]
  ⬆️ Set [email protected] on n8n-core
  🔖 Release [email protected]
  fix(core): make `deepCopy` backward compatible (#4505)
  fix(editor): workflow settings link font size change (no-changelog) (#4511)
  perf(editor): improve array intersection utility function (#4503)

# Conflicts:
#	packages/editor-ui/src/App.vue
#	packages/editor-ui/src/components/ActivationModal.vue
#	packages/editor-ui/src/components/NDVDraggablePanels.vue
#	packages/editor-ui/src/components/NodeSettings.vue
#	packages/editor-ui/src/components/Sticky.vue
#	packages/editor-ui/src/components/mixins/workflowHelpers.ts
#	packages/editor-ui/src/constants.ts
#	packages/editor-ui/src/plugins/i18n/index.ts
#	packages/editor-ui/src/views/ChangePasswordView.vue
#	packages/editor-ui/src/views/NodeView.vue
#	packages/editor-ui/src/views/SignupView.vue
@janober
Copy link
Member

janober commented Nov 10, 2022

Got released with [email protected]

@janober janober removed the Upcoming Release Will be part of the upcoming release label Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants