Skip to content

Commit

Permalink
Make contextHelpers configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Apr 21, 2022
1 parent 5e05d0f commit 73e0baf
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 27 deletions.
5 changes: 4 additions & 1 deletion config/config.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"search",
"text-editor"
],
"applications" : []
"applications" : [],
"options": {
"contextHelpers": true
},
}
5 changes: 4 additions & 1 deletion config/config.json.sample-oc10
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"search",
"text-editor",
"draw-io"
]
],
"options": {
"contextHelpers": true
},
}
5 changes: 4 additions & 1 deletion config/config.json.sample-ocis
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@
"id": "accounts",
"path": "https://localhost:9200/accounts.js"
}
]
],
"options": {
"contextHelpers": true
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
class="oc-mt-xs oc-text-meta"
v-text="inviteDescriptionMessage"
/>
<oc-contextual-helper v-if="resourceIsSpace" v-bind="spaceAddMemberHelp" />
<oc-contextual-helper v-else v-bind="inviteCollaboratorHelp" />
<oc-contextual-helper v-if="resourceIsSpace && helpersEnabled" v-bind="spaceAddMemberHelp" />
<oc-contextual-helper v-else-if="helpersEnabled" v-bind="inviteCollaboratorHelp" />
</p>
<div class="oc-flex oc-flex-middle oc-flex-between oc-mb-l">
<role-dropdown
Expand Down Expand Up @@ -128,6 +128,10 @@ export default {
...mapGetters('Files', ['currentFileOutgoingCollaborators', 'highlightedFile']),
...mapGetters(['configuration', 'getToken', 'user']),
helpersEnabled() {
return this.configuration.options.contextHelpers
},
inviteCollaboratorHelp() {
return shareInviteCollaboratorHelp
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
>Any external person with the respective link can access this resource. No sign-in
required. Assign a password to avoid unintended document exposure.</span
>
<oc-contextual-helper v-bind="viaLinkHelp" />
<oc-contextual-helper v-if="helpersEnabled" v-bind="viaLinkHelp" />
</p>
<oc-button
id="files-file-link-add"
Expand Down Expand Up @@ -109,10 +109,14 @@ export default defineComponent({
'currentFileOutgoingSharesLoading',
'sharesTreeLoading'
]),
...mapGetters(['capabilities']),
...mapGetters(['capabilities', 'configuration']),
...mapState('Files', ['sharesTree']),
...mapState(['user']),
helpersEnabled() {
return this.configuration.options.contextHelpers
},
viaLinkHelp() {
return shareViaLinkHelp
},
Expand Down
6 changes: 5 additions & 1 deletion packages/web-app-files/src/views/shares/SharedViaLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
<template #message>
<span v-translate>There are no resources with a public link at the moment</span>
<oc-contextual-helper v-bind="quickLinkHelp" />
<oc-contextual-helper v-if="helpersEnabled" v-bind="quickLinkHelp" />
</template>
</no-content-message>
<resource-table
Expand Down Expand Up @@ -103,6 +103,10 @@ export default defineComponent({
...mapGetters(['configuration']),
...mapState('Files/sidebar', { sidebarClosed: 'closed' }),
helpersEnabled() {
return this.configuration.options.contextHelpers
},
quickLinkHelp() {
return shareQuickLinkHelp
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,7 @@ exports[`SharedViaLink view when the view is not loading anymore when there are
<!---->
</div>
<div class="oc-text-muted oc-text-large"><span>There are no resources with a public link at the moment</span>
<div class="oc-contextual-helper"><button type="button" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw" id="oc-contextual-helper-3-button"><span class="oc-icon oc-icon-s oc-icon-passive"><!----></span></button>
<div id="oc-contextual-helper-3" class="oc-drop oc-box-shadow-medium oc-rounded">
<div class="oc-card oc-card-body oc-rounded oc-background-secondary oc-p-m">
<div class="info-drop-content">
<p class="info-text">The Quick link is the link that is always copied if you</p>
<ul class="info-list oc-pl-l">
<li class="oc-pl-rm">
right click on a file and choose "Get link" or
</li>
<li class="oc-pl-rm">
click on the quickaction "Get link"
</li>
</ul>
<p class="info-text-end"></p>
<!---->
</div>
</div>
</div>
</div>
<!---->
</div>
<div class="oc-text-muted"></div>
</div>
Expand Down

0 comments on commit 73e0baf

Please sign in to comment.