]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix app store link and hide it for users (fix #18495 #18500)
authorJulius Härtl <jus@bitgrid.net>
Mon, 23 Dec 2019 09:31:28 +0000 (10:31 +0100)
committerJulius Härtl <jus@bitgrid.net>
Fri, 27 Dec 2019 07:45:39 +0000 (08:45 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/workflowengine/src/components/Workflow.vue

index d94d2bf90a5428affe3719a49d5c8c6cc6f880c5..29ca2f44ed059cd91a6cef5ba1364534e2c6d092 100644 (file)
                                        :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>
@@ -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
 
@@ -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'),
                }
        },
@@ -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')