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

Feature/Hide GitHub-Related Buttons and Views Based on Configuration #122

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Collection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</template>
<template #content>
<ul>
<li>
<li v-if="props.config?.github !== false">
<a class="link w-full" :href="`https://github.com/${props.owner}/${props.repo}/blob/${props.branch}/${folder}`" target="_blank">
<div class="truncate">See folder on GitHub</div>
<Icon name="ExternalLink" class="h-4 w-4 stroke-2 shrink-0 ml-auto text-neutral-400 dark:text-neutral-500"/>
Expand Down Expand Up @@ -153,7 +153,7 @@
</template>
<template #content>
<ul>
<li>
<li v-if="props.config?.github !== false">
<a class="link w-full" :href="`https://github.com/${props.owner}/${props.repo}/blob/${props.branch}/${item.path}`" target="_blank">
<div class="truncate">See file on GitHub</div>
<Icon name="ExternalLink" class="h-4 w-4 stroke-2 shrink-0 ml-auto text-neutral-400 dark:text-neutral-500"/>
Expand Down
3 changes: 2 additions & 1 deletion src/components/FileBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
</template>
<template #content>
<ul>
<li>
<li v-if="props.config?.github !== false">
<a class="link w-full" :href="`https://github.com/${props.owner}/${props.repo}/blob/${props.branch}/${item.path}`" target="_blank">
<div class="truncate">See file on GitHub</div>
<Icon name="ExternalLink" class="h-4 w-4 stroke-2 shrink-0 ml-auto text-neutral-400 dark:text-neutral-500"/>
Expand Down Expand Up @@ -212,6 +212,7 @@ const props = defineProps({
owner: String,
repo: String,
branch: String,
config: Object,
root: { type: String, default: '' },
defaultPath: String,
defaultLayout: String,
Expand Down
1 change: 1 addition & 0 deletions src/components/Media.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:owner="owner"
:repo="repo"
:branch="branch"
:config="config"
:root="config.media.input"
:defaultPath="config.media.default"
:filterByExtensions="config.media.extensions"
Expand Down
2 changes: 1 addition & 1 deletion src/components/file/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</template>
<template #content>
<ul>
<li>
<li v-if="props.config?.github !== false">
<a :href="`https://github.com/${props.owner}/${props.repo}/blob/${props.branch}/${props.path}`" target="_blank" class="link">
<div>See file on GitHub</div>
<Icon name="ExternalLink" class="h-4 w-4 stroke-2 shrink-0 ml-auto text-neutral-400 dark:text-neutral-500"/>
Expand Down
1 change: 1 addition & 0 deletions src/components/file/TipTap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
:owner="repoStore.owner"
:repo="repoStore.repo"
:branch="repoStore.branch"
:config="repoStore.config"
:root="props.options?.image?.input ?? repoStore.config.object.media?.input"
:defaultPath="props.options?.image?.path ?? repoStore.config.object.media?.path"
:filterByCategories="props.options?.image?.extensions ? undefined : [ 'image' ]"
Expand Down
1 change: 1 addition & 0 deletions src/fields/core/image/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
:owner="repoStore.owner"
:repo="repoStore.repo"
:branch="repoStore.branch"
:config="repoStore.config"
:root="props.field.options?.input ?? repoStore.config.object.media?.input"
:defaultPath="props.field.options?.path ?? repoStore.config.object.media?.path"
:filterByCategories="props.field.options?.extensions ? undefined : [ 'image' ]"
Expand Down
3 changes: 2 additions & 1 deletion src/views/RepoView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</button>
</template>
<template #content>
<ul>
<ul v-if="repoStore.config?.object?.github !== false">
<li><div class="font-medium text-xs pb-1 px-3 text-neutral-400 dark:text-neutral-500">Owner & Repository</div></li>
<li>
<a class="link w-full" :href="`https://github.com/${props.owner}`" target="_blank">
Expand Down Expand Up @@ -62,6 +62,7 @@
<li><hr class="border-t border-neutral-150 dark:border-neutral-750 my-1"/></li>
<li><button @click.prevent="branchesModal.openModal(); isSidebarActive = false;" class="link w-full">Manage branches</button></li>
</ul>
<button v-else @click.prevent="repoMenuModal.openModal(); isSidebarActive = false;" class="link w-full">Change repository</button>
</template>
</Dropdown>
</div>
Expand Down