fix(editor): Fix new canvas discovery tooltip position after adding github stars button (#11898)

This commit is contained in:
Alex Grozav 2024-11-26 17:36:42 +02:00 committed by GitHub
parent 845ba6c917
commit f4ab5c7b92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,6 +21,7 @@ import { useSettingsStore } from '@/stores/settings.store';
import { usePushConnection } from '@/composables/usePushConnection'; import { usePushConnection } from '@/composables/usePushConnection';
import GithubButton from 'vue-github-button'; import GithubButton from 'vue-github-button';
import { useLocalStorage } from '@vueuse/core';
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
@ -37,7 +38,7 @@ const activeHeaderTab = ref(MAIN_HEADER_TABS.WORKFLOW);
const workflowToReturnTo = ref(''); const workflowToReturnTo = ref('');
const executionToReturnTo = ref(''); const executionToReturnTo = ref('');
const dirtyState = ref(false); const dirtyState = ref(false);
const githubButtonHidden = ref(localStorage.getItem(LOCAL_STORAGE_HIDE_GITHUB_STAR_BUTTON)); const githubButtonHidden = useLocalStorage(LOCAL_STORAGE_HIDE_GITHUB_STAR_BUTTON, false);
const tabBarItems = computed(() => [ const tabBarItems = computed(() => [
{ value: MAIN_HEADER_TABS.WORKFLOW, label: locale.baseText('generic.editor') }, { value: MAIN_HEADER_TABS.WORKFLOW, label: locale.baseText('generic.editor') },
@ -58,10 +59,7 @@ const isEnterprise = computed(
() => settingsStore.isQueueModeEnabled && settingsStore.isWorkerViewAvailable, () => settingsStore.isQueueModeEnabled && settingsStore.isWorkerViewAvailable,
); );
const showGitHubButton = computed( const showGitHubButton = computed(
() => () => !isEnterprise.value && !settingsStore.settings.inE2ETests && !githubButtonHidden.value,
!isEnterprise.value &&
!settingsStore.settings.inE2ETests &&
githubButtonHidden.value !== 'true',
); );
watch(route, (to, from) => { watch(route, (to, from) => {
@ -175,8 +173,7 @@ async function navigateToExecutionsView(openInNewTab: boolean) {
} }
function hideGithubButton() { function hideGithubButton() {
githubButtonHidden.value = 'true'; githubButtonHidden.value = true;
localStorage.setItem(LOCAL_STORAGE_HIDE_GITHUB_STAR_BUTTON, 'true');
} }
</script> </script>
@ -202,7 +199,7 @@ function hideGithubButton() {
@update:model-value="onTabSelected" @update:model-value="onTabSelected"
/> />
</div> </div>
<div class="github-button" v-if="showGitHubButton"> <div v-if="showGitHubButton" class="github-button">
<div class="github-button-container"> <div class="github-button-container">
<GithubButton <GithubButton
href="https://github.com/n8n-io/n8n" href="https://github.com/n8n-io/n8n"
@ -253,6 +250,8 @@ function hideGithubButton() {
position: relative; position: relative;
align-items: center; align-items: center;
align-self: stretch; align-self: stretch;
justify-content: center;
min-width: 170px;
padding-top: 2px; padding-top: 2px;
padding-left: var(--spacing-m); padding-left: var(--spacing-m);
padding-right: var(--spacing-m); padding-right: var(--spacing-m);