Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix console warnings and errors #1328

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading