Skip to content

Commit af0a876

Browse files
authored
Merge pull request #41439 from nextcloud/fix/41310-Create_possibility_to_open_an_app_details_via_keyboard
Add link for opening app details
2 parents bd483e7 + 25d8703 commit af0a876

File tree

10 files changed

+36
-45
lines changed

10 files changed

+36
-45
lines changed

apps/settings/css/settings.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/css/settings.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/css/settings.scss

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -650,14 +650,6 @@ span.version {
650650
margin: 5px 0;
651651
}
652652

653-
.app-name, .app-image * {
654-
cursor: pointer;
655-
}
656-
657-
.app-summary {
658-
opacity: .7;
659-
}
660-
661653
.app-image-icon .icon-settings-dark {
662654
width: 100%;
663655
height: 150px;
@@ -671,6 +663,10 @@ span.version {
671663

672664
.actions {
673665
margin-top: 10px;
666+
667+
button {
668+
margin: 10px 0;
669+
}
674670
}
675671
}
676672

@@ -881,10 +877,6 @@ span.version {
881877
$toolbar-padding: 8px;
882878
$toolbar-height: 44px + $toolbar-padding * 2;
883879

884-
.section {
885-
cursor: pointer;
886-
}
887-
888880
.app-list-move {
889881
transition: transform 1s;
890882
}

apps/settings/src/components/AppList/AppItem.vue

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@
2323
<template>
2424
<component :is="listView ? `tr` : `li`"
2525
class="section"
26-
:class="{ selected: isSelected }"
27-
@click="showAppDetails">
26+
:class="{ selected: isSelected }">
2827
<component :is="dataItemTag"
2928
class="app-image app-image-icon"
30-
:headers="getDataItemHeaders(`app-table-col-icon`)"
31-
@click="showAppDetails">
29+
:headers="getDataItemHeaders(`app-table-col-icon`)">
3230
<div v-if="(listView && !app.preview) || (!listView && !screenshotLoaded)" class="icon-settings-dark" />
3331

3432
<svg v-else-if="listView && app.preview"
@@ -48,9 +46,11 @@
4846
</component>
4947
<component :is="dataItemTag"
5048
class="app-name"
51-
:headers="getDataItemHeaders(`app-table-col-name`)"
52-
@click="showAppDetails">
53-
{{ app.name }}
49+
:headers="getDataItemHeaders(`app-table-col-name`)">
50+
<router-link class="app-name--link" :to="{ name: 'apps-details', params: { category: category, id: app.id }}"
51+
:aria-label="t('settings', 'Show details for {appName} app', { appName:app.name })">
52+
{{ app.name }}
53+
</router-link>
5454
</component>
5555
<component :is="dataItemTag"
5656
v-if="!listView"
@@ -185,19 +185,6 @@ export default {
185185
186186
},
187187
methods: {
188-
async showAppDetails(event) {
189-
if (event.currentTarget.tagName === 'INPUT' || event.currentTarget.tagName === 'A') {
190-
return
191-
}
192-
try {
193-
await this.$router.push({
194-
name: 'apps-details',
195-
params: { category: this.category, id: this.app.id },
196-
})
197-
} catch (e) {
198-
// we already view this app
199-
}
200-
},
201188
prefix(prefix, content) {
202189
return prefix + '_' + content
203190
},
@@ -217,4 +204,14 @@ export default {
217204
.app-image img {
218205
width: 100%;
219206
}
207+
208+
.app-name--link::after {
209+
content: '';
210+
position: absolute;
211+
top: 0;
212+
left: 0;
213+
right: 0;
214+
bottom: 0;
215+
}
216+
220217
</style>

apps/settings/src/components/AppList/AppScore.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
-->
2222

2323
<template>
24-
<img :src="scoreImage" class="app-score-image">
24+
<img :src="scoreImage" :alt="t('settings', 'Rating: {score}/10', {score:appScore})" class="app-score-image">
2525
</template>
2626
<script>
2727
import { imagePath } from '@nextcloud/router'
@@ -30,11 +30,13 @@ export default {
3030
name: 'AppScore',
3131
props: ['score'],
3232
computed: {
33+
appScore() {
34+
return Math.round(this.score * 10)
35+
},
3336
scoreImage() {
34-
const score = Math.round(this.score * 10)
35-
const imageName = 'rating/s' + score + '.svg'
37+
const imageName = 'rating/s' + this.appScore + '.svg'
3638
return imagePath('core', imageName)
37-
},
39+
}
3840
},
3941
}
4042
</script>

cypress/e2e/settings/apps.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe('Settings: App management', { testIsolation: true }, () => {
125125

126126
it('View app details', () => {
127127
// When I click on the "QA testing" app
128-
cy.get('#apps-list').contains('tr', 'QA testing').click({ force: true })
128+
cy.get('#apps-list').contains('a', 'QA testing').click({ force: true })
129129
// I see that the app details are shown
130130
cy.get('#app-sidebar-vue')
131131
.should('be.visible')

dist/settings-apps-view-7418.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-apps-view-7418.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-apps-users-management.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-apps-users-management.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)