Skip to content

Commit

Permalink
Fix app store link and hide it for users (fix #18495 #18500)
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Dec 23, 2019
1 parent 0c21e01 commit 10e2777
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/workflowengine/src/components/Workflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
:operation="operation"
@click.native="createNewRule(operation)" />

<a :key="'add'" :href="appstoreUrl" class="actions__item colored more">
<a v-if="showAppStoreHint"
:key="'add'"
:href="appstoreUrl"
class="actions__item colored more">
<div class="icon icon-add" />
<div class="actions__item__description">
<h3>{{ t('workflowengine', 'More flows') }}</h3>
Expand Down Expand Up @@ -49,6 +52,7 @@ import Rule from './Rule'
import Operation from './Operation'
import { mapGetters, mapState } from 'vuex'
import { loadState } from '@nextcloud/initial-state'
import { generateUrl } from '@nextcloud/router'
const ACTION_LIMIT = 3
Expand All @@ -61,7 +65,7 @@ export default {
data() {
return {
showMoreOperations: false,
appstoreUrl: '/index.php/settings/apps/workflow',
appstoreUrl: generateUrl('settings/apps/workflow'),
scope: loadState('workflowengine', 'scope'),
}
},
Expand All @@ -81,6 +85,9 @@ export default {
}
return Object.values(this.operations).slice(0, ACTION_LIMIT)
},
showAppStoreHint() {
return this.scope === 0 && OC.isUserAdmin()
},
},
mounted() {
this.$store.dispatch('fetchRules')
Expand Down

0 comments on commit 10e2777

Please sign in to comment.