Skip to content

Commit

Permalink
fix: rename context functions to avoid conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Cleopatra Enjeck M. <[email protected]>
  • Loading branch information
enjeck committed Jan 22, 2025
1 parent 6fb10d3 commit 5da07fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/modules/modals/CreateContext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<NcContextResource :resources.sync="resources" :receivers.sync="receivers" />
</div>
<div class="row space-T">
<NcActionCheckbox :checked="showInNavigationDefault" @change="updateDisplayMode">
<NcActionCheckbox :checked="showInNavigationDefault" data-cy="createContextShowInNavSwitch" @change="changeDisplayMode">
{{ t('tables', 'Show in app list') }}
</NcActionCheckbox>
<p class="nav-display-subtext">
Expand Down Expand Up @@ -182,7 +182,7 @@ export default {
showError(t('tables', 'Could not create new application'))
}
},
updateDisplayMode() {
changeDisplayMode() {
this.showInNavigation = !this.showInNavigation
},
reset() {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/modals/EditContext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<NcContextResource :resources.sync="resources" :receivers.sync="receivers" />
</div>
<div class="row space-T">
<NcActionCheckbox :checked="showInNavigationDefault" @change="updateDisplayMode">
<NcActionCheckbox :checked="showInNavigationDefault" @change="changeDisplayMode">
{{ t('tables', 'Show in app list') }}
</NcActionCheckbox>
<p class="nav-display-subtext">
Expand Down Expand Up @@ -269,7 +269,7 @@ export default {
}

},
updateDisplayMode() {
changeDisplayMode() {
this.showInNavigationDefault = !this.showInNavigationDefault
},
actionTransfer() {
Expand Down
7 changes: 4 additions & 3 deletions src/modules/navigation/partials/NavigationContextItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</template>
{{ t('tables', 'Delete application') }}
</NcActionButton>
<NcActionCheckbox :checked="showInNavigation" @change="updateDisplayMode">
<NcActionCheckbox :checked="showInNavigation" data-cy="navigationContextShowInNavSwitch" @change="changeDisplayMode">
{{ t('tables', 'Show in app list') }}
</NcActionCheckbox>
</template>
Expand All @@ -44,7 +44,7 @@
<script>
import { NcAppNavigationItem, NcActionButton, NcIconSvgWrapper, NcActionCheckbox } from '@nextcloud/vue'
import '@nextcloud/dialogs/style.css'
import { mapState } from 'pinia'
import { mapState, mapActions } from 'pinia'
import TableIcon from 'vue-material-design-icons/Table.vue'
import { emit } from '@nextcloud/event-bus'
import PlaylistEdit from 'vue-material-design-icons/PlaylistEdit.vue'
Expand Down Expand Up @@ -99,6 +99,7 @@ export default {
},

methods: {
...mapActions(useTablesStore, ['updateDisplayMode']),
emit,
async editContext() {
emit('tables:context:edit', this.context.id)
Expand All @@ -117,7 +118,7 @@ export default {
}
return false
},
async updateDisplayMode() {
async changeDisplayMode() {
const value = !this.showInNavigation
const displayMode = value ? NAV_ENTRY_MODE.NAV_ENTRY_MODE_ALL : NAV_ENTRY_MODE.NAV_ENTRY_MODE_HIDDEN
let hadAtLeastOneEntry = false
Expand Down

0 comments on commit 5da07fd

Please sign in to comment.