Skip to content

Commit

Permalink
Merge pull request #1328 from nextcloud/fix/small
Browse files Browse the repository at this point in the history
  • Loading branch information
juliushaertl committed Aug 30, 2024
2 parents 0f1f3b0 + 6e6cba4 commit ee0ffa4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/tables-favorite.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Favorite tables/views', () => {

cy.get('[data-cy="navigationViewItem"]').first().as('testView')

cy.get('@testView').parent().parent().should('contain.text', 'Tutorial')
cy.get('@testView').parent().parent().parent().should('contain.text', 'Tutorial')
cy.get('@testView').find('[aria-haspopup="menu"]').click({ force: true })

cy.intercept({ method: 'POST', url: '**/ocs/v2.php/apps/tables/api/2/favorites/*/*' }).as('favoriteViewReq')
Expand All @@ -70,14 +70,14 @@ describe('Favorite tables/views', () => {
cy.contains('Remove from favorites').click({ force: true })
cy.wait('@unfavoriteViewReq').its('response.statusCode').should('equal', 200)

cy.get('@testView').parent().parent().should('contain.text', 'Tutorial')
cy.get('@testView').parent().parent().parent().should('contain.text', 'Tutorial')
})

it('can (un)favorite views with favorited parent tables', () => {
cy.get('[data-cy="navigationViewItem"]').first().as('testView')
cy.get('[data-cy="navigationTableItem"]').first().as('tutorialTable')

cy.get('@testView').parent().parent().should('contain.text', 'Tutorial')
cy.get('@testView').parent().parent().parent().should('contain.text', 'Tutorial')
cy.get('@testView').find('[aria-haspopup="menu"]').click({ force: true })
cy.contains('Add to favorites').click({ force: true })

Expand Down
10 changes: 6 additions & 4 deletions src/modules/navigation/partials/NavigationTableItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,12 @@
{{ t('tables', 'Delete table') }}
</NcActionButton>
</template>
<NavigationViewItem v-for="view in getViews"
:key="'view'+view.id"
:view="view"
:show-share-sender="false" />
<div>
<NavigationViewItem v-for="view in getViews"
:key="'view'+view.id"
:view="view"
:show-share-sender="false" />
</div>
</NcAppNavigationItem>
</template>

Expand Down
8 changes: 4 additions & 4 deletions src/shared/components/ncTable/sections/CustomTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
</table>
<div v-if="totalPages > 1" class="pagination-footer" :class="{'large-width': !appNavCollapsed || isMobile}">
<div class="pagination-items">
<NcButton type="tertiary" :disabled="totalPages === 1 || pageNumber <= 1" @click="pageNumber = 1">
<NcButton type="tertiary" :disabled="totalPages === 1 || pageNumber <= 1" :aria-label="t('tables', 'Go to first page')" @click="pageNumber = 1">
<template #icon>
<PageFirstIcon :size="20" />
</template>
</NcButton>
<NcButton type="tertiary" :disabled="totalPages === 1 || pageNumber <= 1" @click="pageNumber--">
<NcButton type="tertiary" :disabled="totalPages === 1 || pageNumber <= 1" :aria-label="t('tables', 'Go to previous page')" @click="pageNumber--">
<template #icon>
<ChevronLeftIcon :size="20" />
</template>
Expand All @@ -57,12 +57,12 @@
</template>
</NcSelect>
</div>
<NcButton type="tertiary" :disabled="totalPages === 1 || pageNumber >= totalPages" @click="pageNumber++">
<NcButton type="tertiary" :disabled="totalPages === 1 || pageNumber >= totalPages" :aria-label="t('tables', 'Go to next page')" @click="pageNumber++">
<template #icon>
<ChevronRightIcon :size="20" />
</template>
</NcButton>
<NcButton type="tertiary" :disabled="totalPages === 1 || pageNumber >= totalPages" @click="pageNumber = totalPages">
<NcButton type="tertiary" :disabled="totalPages === 1 || pageNumber >= totalPages" :aria-label="t('tables', 'Go to last page')" @click="pageNumber = totalPages">
<template #icon>
<PageLastIcon :size="20" />
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/utils/displayError.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function statusMessage(status) {
* @param {string} msg as message to toast out
*/
function displaySimpleError(e = null, msg = '') {
console.error('Error occurred: ' + msg ?? '', e?.message)
console.error('Error occurred: ' + (msg ?? ''), e?.message)
showError(msg)
}

Expand Down

0 comments on commit ee0ffa4

Please sign in to comment.