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: sorting bug and style fixes with the feed info table #3024

Merged
merged 2 commits into from
Jan 4, 2025
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ You can also check [on GitHub](https://github.com/nextcloud/news/releases), the

### Fixed
- OPML import use text field for title if title field is missing (#3016)
- style fixes in settings section and feed info table
- sorting in the feed information table changes also the original sorting

# Releases
## [25.2.0-beta.2] - 2024-01-02
Expand Down
24 changes: 16 additions & 8 deletions src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,17 @@
</template>
<template #footer>
<NcAppNavigationSettings :name="t('news', 'Settings')">
<NcButton @click="showHelp = true">
{{ t('news', 'Keyboard shortcuts') }}
</NcButton>
<HelpModal v-if="showHelp" @close="showHelp=false" />
<NcButton @click="showFeedInfoTable = true">
{{ t('news', 'Article feed information') }}
</NcButton>
<div class="settings-button">
<NcButton wide="true" @click="showHelp = true">
{{ t('news', 'Keyboard shortcuts') }}
</NcButton>
</div>
<HelpModal v-if="showHelp" @close="showHelp = false" />
<div class="settings-button">
<NcButton wide="true" @click="showFeedInfoTable = true">
{{ t('news', 'Article feed information') }}
</NcButton>
</div>
<FeedInfoTable v-if="showFeedInfoTable" @close="showFeedInfoTable = false" />
<div>
<div class="select-container">
Expand Down Expand Up @@ -228,7 +232,7 @@
{{ t('news', 'Disable automatic refresh') }}
</label>
</div>
<h1>{{ t('news', 'Abonnements (OPML)') }}</h1>
<h2>{{ t('news', 'Abonnements (OPML)') }}</h2>
<div class="button-container">
<NcButton aria-label="UploadOpml"
:disabled="loading"
Expand Down Expand Up @@ -737,6 +741,10 @@ export default Vue.extend({
margin-left: auto;
}

.settings-button {
padding: 2px;
}

.new-folder-container {
padding: calc(var(--default-grid-baseline, 4px)* 2);
}
Expand Down
53 changes: 38 additions & 15 deletions src/components/modals/FeedInfoTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,57 @@
<th @click="sortBy('id')">
<span class="column-title">
ID
<SortAscIcon v-if="sortKey === 'id' && sortOrder === 1" />
<SortDescIcon v-if="sortKey === 'id' && sortOrder !== 1" />
<div class="sort-icon">
<SortAscIcon v-show="sortKey === 'id' && sortOrder === 1" :size="20" />
<SortDescIcon v-show="sortKey === 'id' && sortOrder !== 1" :size="20" />
</div>
</span>
</th>
<th @click="sortBy('title')">
<span class="column-title">
{{ t('news', 'Title') }}
<SortAscIcon v-if="sortKey === 'title' && sortOrder === 1" />
<SortDescIcon v-if="sortKey === 'title' && sortOrder !== 1" />
<span class="sort-icon">
<SortAscIcon v-show="sortKey === 'title' && sortOrder === 1" :size="20" />
<SortDescIcon v-show="sortKey === 'title' && sortOrder !== 1" :size="20" />
</span>
</span>
</th>
<th @click="sortBy('lastModified')">
<span class="column-title">
{{ t('news', 'Last update') }}
<SortAscIcon v-if="sortKey === 'lastModified' && sortOrder === 1" />
<SortDescIcon v-if="sortKey === 'lastModified' && sortOrder !== 1" />
<span class="sort-icon">
<SortAscIcon v-show="sortKey === 'lastModified' && sortOrder === 1" :size="20" />
<SortDescIcon v-show="sortKey === 'lastModified' && sortOrder !== 1" :size="20" />
</span>
</span>
</th>
<th @click="sortBy('nextUpdateTime')">
<span class="column-title">
{{ t('news', 'Next update') }}
<SortAscIcon v-if="sortKey === 'nextUpdateTime' && sortOrder === 1" />
<SortDescIcon v-if="sortKey === 'nextUpdateTime' && sortOrder !== 1" />
<span class="sort-icon">
<SortAscIcon v-show="sortKey === 'nextUpdateTime' && sortOrder === 1" :size="20" />
<SortDescIcon v-show="sortKey === 'nextUpdateTime' && sortOrder !== 1" :size="20" />
</span>
</span>
</th>
<th :title="t('news', 'Articles per update')"
@click="sortBy('articlesPerUpdate')">
<span class="column-title">
APU
<SortAscIcon v-if="sortKey === 'articlesPerUpdate' && sortOrder === 1" />
<SortDescIcon v-if="sortKey === 'articlesPerUpdate' && sortOrder !== 1" />
<span class="sort-icon">
<SortAscIcon v-show="sortKey === 'articlesPerUpdate' && sortOrder === 1" :size="20" />
<SortDescIcon v-show="sortKey === 'articlesPerUpdate' && sortOrder !== 1" :size="20" />
</span>
</span>
</th>
<th :title="t('news', 'Error Count') "
@click="sortBy('updateErrorCount')">
<span class="column-title">
EC
<SortAscIcon v-if="sortKey === 'updateErrorCount' && sortOrder === 1" />
<SortDescIcon v-if="sortKey === 'updateErrorCount' && sortOrder !== 1" />
<span class="sort-icon">
<SortAscIcon v-if="sortKey === 'updateErrorCount' && sortOrder === 1" :size="20" />
<SortDescIcon v-if="sortKey === 'updateErrorCount' && sortOrder !== 1" :size="20" />
</span>
</span>
</th>
</tr>
Expand Down Expand Up @@ -97,7 +109,7 @@ export default {
feeds: state => state.feeds.feeds,
}),
sortedFeeds() {
const sorted = this.feeds
const sorted = [...this.feeds]
if (this.sortKey) {
sorted.sort((a, b) => {
const valueA = a[this.sortKey]
Expand Down Expand Up @@ -165,15 +177,19 @@ export default {
th {
cursor: pointer;
font-weight: bold;
padding: .75rem 1rem .75rem 0;
border-bottom: 2px solid var(--color-background-darker);
&:hover {
background-color: var(--color-background-hover);
border-radius: 10px;
}
}

th * {
cursor: pointer;
}

td {
padding: .75rem 1rem .75rem 0;
padding: .25rem 1rem .25rem 0;
border-top: 1px solid var(--color-background-dark);
border-bottom: unset;

Expand All @@ -196,10 +212,17 @@ export default {
}

.column-title {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
gap: 4px;
padding: .25rem 1rem .25rem 0;
}

.sort-icon {
height: 20px;
width: 20px;
}
}
</style>
Loading