Skip to content

Commit

Permalink
Limit more view btns to certain views
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed May 19, 2024
1 parent 733ec9c commit dd16d47
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions panel/src/components/View/Buttons/AddUsersButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<k-button
v-if="$panel.view.component === 'k-users-view'"
:disabled="!$panel.permissions.users.create"
:text="$t('user.create')"
icon="add"
Expand Down
4 changes: 3 additions & 1 deletion panel/src/components/View/Buttons/RemoveLanguageButton.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<k-button
v-if="$panel.view.props.deletable"
v-if="
$panel.view.component === 'k-language-view' && $panel.view.props.deletable
"
:title="$t('delete')"
icon="trash"
size="sm"
Expand Down
9 changes: 1 addition & 8 deletions panel/src/components/View/Buttons/StatusButton.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<k-button
v-if="status"
v-if="$panel.view.component === 'k-page-view' && status"
v-bind="button"
:responsive="true"
:text="status.label"
Expand Down Expand Up @@ -35,13 +35,6 @@ export default {
status() {
return this.$panel.view.props.status;
}
},
mounted() {
if (this.$panel.view.component !== "k-page-view") {
console.error(
"The status view button should only be used for the page view."
);
}
}
};
</script>

0 comments on commit dd16d47

Please sign in to comment.