Skip to content

Commit

Permalink
feat: use NcButton to toggle completed tasks visibility
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Jan 2, 2024
1 parent 0512386 commit 8350940
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
22 changes: 19 additions & 3 deletions src/views/AppContent/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
:calendar-id="calendarId"
:disabled="calendar.readOnly"
collection-id="uncompleted" />
<h2 v-show="closedCount(calendarId)" class="heading heading--hiddentasks reactive" @click="toggleHidden">
<span class="heading__name icon-triangle-s">{{ closedCountString }}</span>
</h2>
<NcButton v-if="closedCount(calendarId)"

Check failure on line 33 in src/views/AppContent/Calendar.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Trailing spaces not allowed
alignment="center-reverse"
type="tertiary"
class="reactive heading"
@click="toggleHidden">
<template #icon>
<ChevronUp v-if="showHidden" />
<ChevronDown v-else />
</template>
{{ closedCountString }}
</NcButton>
<TaskDragContainer v-if="showHidden"
:tasks="closedRootTasks(calendar.tasks)"
:calendar-id="calendarId"
Expand All @@ -53,6 +61,11 @@ import LoadCompletedButton from '../../components/LoadCompletedButton.vue'
import TaskDragContainer from '../../components/TaskDragContainer.vue'
import './task-list.scss'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import ChevronDown from 'vue-material-design-icons/ChevronDown.vue'
import ChevronUp from 'vue-material-design-icons/ChevronUp.vue'
import { translatePlural as n } from '@nextcloud/l10n'
import { mapGetters } from 'vuex'
Expand All @@ -63,6 +76,9 @@ export default {
LoadCompletedButton,
TaskDragContainer,
DeleteCompletedModal,
NcButton,
ChevronDown,
ChevronUp,
},
props: {
calendarId: {
Expand Down
14 changes: 0 additions & 14 deletions src/views/AppContent/task-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,6 @@ $breakpoint-mobile: 1024px;
padding-left: 15px;
}

&--hiddentasks {
margin-bottom: 0;

.heading__name {
display: inline-block;
padding-right: 16px;
background-position: right center;
cursor: pointer;
&:hover {
opacity: .7;
}
}
}

&__name {
font-weight: bold;
font-size: 16px;
Expand Down

0 comments on commit 8350940

Please sign in to comment.