Skip to content

Commit

Permalink
Create right table view
Browse files Browse the repository at this point in the history
Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com>
  • Loading branch information
JuliaKirschenheuter committed Aug 23, 2023
1 parent 5234807 commit 2c8bc71
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 41 deletions.
2 changes: 1 addition & 1 deletion apps/settings/css/settings.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/settings/css/settings.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions apps/settings/css/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,9 @@ span.version {
}

h2 {
display: table-cell;
position: absolute;
padding-left: 6px;
padding-top: 15px;

margin-bottom: 12px;
.enable {
position: relative;
top: -1px;
Expand Down
37 changes: 22 additions & 15 deletions apps/settings/src/components/AppList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@
{{ t('settings', 'All apps are up-to-date.') }}
</div>

<transition-group name="app-list" tag="div" class="apps-list-container">
<transition-group name="app-list" tag="table" class="apps-list-container">
<tr class="apps-header">
<th class="app-image"><span class="hidden-visually">{{ t('settings', 'App icon') }}</span></th>
<th class="app-name"><span class="hidden-visually">{{ t('settings', 'App name') }}</span></th>
<th class="app-version"><span class="hidden-visually">{{ t('settings', 'App version') }}</span></th>
<th class="app-level"><span class="hidden-visually">{{ t('settings', 'App level') }}</span></th>
<th class="actions">
&nbsp;<span class="hidden-visually">{{ t('settings', 'Actions') }}</span>
</th>
</tr>
<AppItem v-for="app in apps"
:key="app.id"
:app="app"
Expand All @@ -48,19 +57,18 @@

<transition-group v-if="useBundleView"
name="app-list"
tag="div"
tag="table"
class="apps-list-container">
<template v-for="bundle in bundles">
<div :key="bundle.id" class="apps-header">
<div class="app-image" />
<h2>{{ bundle.name }} <input type="button" :value="bundleToggleText(bundle.id)" @click="toggleBundle(bundle.id)"></h2>
<div class="app-version" />
<div class="app-level" />
<div class="app-groups" />
<div class="actions">
&nbsp;
</div>
</div>
<tr :key="bundle.id" class="apps-header">
<th class="app-image"><span class="hidden-visually">{{ t('settings', 'App icon') }}</span></th>
<th><h2>{{ bundle.name }} <input type="button" :value="bundleToggleText(bundle.id)" @click="toggleBundle(bundle.id)"></h2></th>
<th class="app-version"><span class="hidden-visually">{{ t('settings', 'App version') }}</span></th>
<th class="app-level"><span class="hidden-visually">{{ t('settings', 'App level') }}</span></th>
<th class="actions">
&nbsp;<span class="hidden-visually">{{ t('settings', 'Actions') }}</span>
</th>
</tr>
<AppItem v-for="app in bundleApps(bundle.id)"
:key="bundle.id + app.id"
:app="app"
Expand Down Expand Up @@ -88,8 +96,7 @@
<AppItem v-for="app in searchApps"
:key="app.id"
:app="app"
:category="category"
:list-view="true" />
:category="category" />
</template>
</div>
</div>
Expand Down Expand Up @@ -240,7 +247,7 @@ export default {
const limit = pLimit(1)
this.apps
.filter(app => app.update)
.map(app => limit(() => this.$store.dispatch('updateApp', { appId: app.id }))
.map(app => limit(() => this.$store.dispatch('updateApp', { appId: app.id })),
)
},
},
Expand Down
35 changes: 20 additions & 15 deletions apps/settings/src/components/AppList/AppItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
-->

<template>
<div class="section" :class="{ selected: isSelected }" @click="showAppDetails">
<div class="app-image app-image-icon" @click="showAppDetails">
<component :is="listView ? `tr` : `div`"
class="section"
:class="{ selected: isSelected }"
@click="showAppDetails">
<component :is="isTableView" class="app-image app-image-icon" @click="showAppDetails">
<div v-if="(listView && !app.preview) || (!listView && !screenshotLoaded)" class="icon-settings-dark" />

<svg v-else-if="listView && app.preview"
Expand All @@ -39,19 +42,19 @@
</svg>

<img v-if="!listView && app.screenshot && screenshotLoaded" :src="app.screenshot" width="100%">
</div>
<div class="app-name" @click="showAppDetails">
</component>
<component :is="isTableView" class="app-name" @click="showAppDetails">
{{ app.name }}
</div>
<div v-if="!listView" class="app-summary">
</component>
<component :is="isTableView" v-if="!listView" class="app-summary">
{{ app.summary }}
</div>
<div v-if="listView" class="app-version">
</component>
<component :is="isTableView" v-if="listView" class="app-version">
<span v-if="app.version">{{ app.version }}</span>
<span v-else-if="app.appstoreData.releases[0].version">{{ app.appstoreData.releases[0].version }}</span>
</div>
</component>

<div class="app-level">
<component :is="isTableView" class="app-level">
<span v-if="app.level === 300"
:title="t('settings', 'This app is supported via your current Nextcloud subscription.')"
:aria-label="t('settings', 'This app is supported via your current Nextcloud subscription.')"
Expand All @@ -63,9 +66,8 @@
class="official icon-checkmark">
{{ t('settings', 'Featured') }}</span>
<AppScore v-if="hasRating && !listView" :score="app.score" />
</div>

<div class="actions">
</component>
<component :is="isTableView" class="actions">
<div v-if="app.error" class="warning">
{{ app.error }}
</div>
Expand Down Expand Up @@ -104,8 +106,8 @@
@click.stop="forceEnable(app.id)">
{{ forceEnableButtonText }}
</NcButton>
</div>
</div>
</component>
</component>
</template>

<script>
Expand Down Expand Up @@ -140,6 +142,9 @@ export default {
hasRating() {
return this.app.appstoreData && this.app.appstoreData.ratingNumOverall > 5
},
isTableView() {
return this.listView ? 'td' : 'div'

Check failure on line 146 in apps/settings/src/components/AppList/AppItem.vue

View workflow job for this annotation

GitHub Actions / eslint

Mixed spaces and tabs
},
},
watch: {
'$route.params.id'(id) {
Expand Down
4 changes: 2 additions & 2 deletions dist/settings-apps-view-7418.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-apps-view-7418.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

0 comments on commit 2c8bc71

Please sign in to comment.