Fix app store link and hide it for users (fix #18495 #18500)

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-12-23 10:31:28 +01:00
parent b8779eed36
commit dca861de94
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 9 additions and 2 deletions

View File

@ -13,7 +13,10 @@
:operation="operation" :operation="operation"
@click.native="createNewRule(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="icon icon-add" />
<div class="actions__item__description"> <div class="actions__item__description">
<h3>{{ t('workflowengine', 'More flows') }}</h3> <h3>{{ t('workflowengine', 'More flows') }}</h3>
@ -49,6 +52,7 @@ import Rule from './Rule'
import Operation from './Operation' import Operation from './Operation'
import { mapGetters, mapState } from 'vuex' import { mapGetters, mapState } from 'vuex'
import { loadState } from '@nextcloud/initial-state' import { loadState } from '@nextcloud/initial-state'
import { generateUrl } from '@nextcloud/router'
const ACTION_LIMIT = 3 const ACTION_LIMIT = 3
@ -61,7 +65,7 @@ export default {
data() { data() {
return { return {
showMoreOperations: false, showMoreOperations: false,
appstoreUrl: '/index.php/settings/apps/workflow', appstoreUrl: generateUrl('settings/apps/workflow'),
scope: loadState('workflowengine', 'scope'), scope: loadState('workflowengine', 'scope'),
} }
}, },
@ -81,6 +85,9 @@ export default {
} }
return Object.values(this.operations).slice(0, ACTION_LIMIT) return Object.values(this.operations).slice(0, ACTION_LIMIT)
}, },
showAppStoreHint() {
return this.scope === 0 && OC.isUserAdmin()
},
}, },
mounted() { mounted() {
this.$store.dispatch('fetchRules') this.$store.dispatch('fetchRules')