Skip to content

Commit

Permalink
style: improve styling
Browse files Browse the repository at this point in the history
Signed-off-by: Grigory V <scratchx@gmx.com>
  • Loading branch information
GVodyanov committed Jul 12, 2024
1 parent f40d495 commit beed1c3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 40 deletions.
61 changes: 22 additions & 39 deletions src/components/AppNavigation/CalendarList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
:calendar="calendar" />
</template>

<NcAppNavigationCaption :name="$t('calendar', 'Shared calendars')" />
<NcAppNavigationCaption :name="$t('calendar', 'Shared calendars')" v-if="sortedCalendars.shared.length"/>

Check warning on line 25 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Attribute "v-if" should go before ":name"

Check failure on line 25 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected a space before '/>', but not found
<template v-if="!isPublic">
<CalendarListItem v-for="calendar in sortedCalendars.shared"
:key="calendar.id"
Expand All @@ -35,7 +35,7 @@
:calendar="calendar" />
</template>

<NcAppNavigationCaption :name="$t('calendar', 'Deck')" />
<NcAppNavigationCaption :name="$t('calendar', 'Deck')" v-if="sortedCalendars.deck.length"/>

Check warning on line 38 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Attribute "v-if" should go before ":name"

Check failure on line 38 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected a space before '/>', but not found
<template v-if="!isPublic">
<CalendarListItem v-for="calendar in sortedCalendars.deck"
:key="calendar.id"
Expand All @@ -48,29 +48,27 @@
:calendar="calendar" />
</template>

<NcListItem :name="$t('calendar', 'Hidden')" @click="showHidden = !showHidden">
<NcAppNavigationSpacer />

<NcAppNavigationItem :name="$t('calendar', 'Hidden')" v-if="sortedCalendars.hidden.length" :allowCollapse="true">

Check warning on line 53 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Attribute "v-if" should go before ":name"

Check warning on line 53 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Attribute ':allowCollapse' must be hyphenated
<template #icon>
<CalendarMinus :size="20" />
</template>
<template #details>
<MenuUp v-if="showHidden" :size="20" />
<MenuDown v-else :size="20" />
<template>

Check warning on line 57 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

`<template>` require directive
<div v-if="!isPublic">
<CalendarListItem v-for="calendar in sortedCalendars.hidden"

Check warning on line 59 in src/components/AppNavigation/CalendarList.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList.vue#L58-L59

Added lines #L58 - L59 were not covered by tests
:key="calendar.id"

Check failure on line 60 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected indentation of 6 tabs but found 5 tabs
class="draggable-calendar-list-item"

Check failure on line 61 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected indentation of 6 tabs but found 5 tabs
:calendar="calendar" />

Check failure on line 62 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected indentation of 6 tabs but found 5 tabs
</div>
<div v-else>
<PublicCalendarListItem v-for="calendar in sortedCalendars.hidden"
:key="calendar.id"

Check failure on line 66 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected indentation of 6 tabs but found 5 tabs

Check warning on line 66 in src/components/AppNavigation/CalendarList.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList.vue#L65-L66

Added lines #L65 - L66 were not covered by tests
:calendar="calendar" />

Check failure on line 67 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected indentation of 6 tabs but found 5 tabs
</div>
</template>

Check warning on line 69 in src/components/AppNavigation/CalendarList.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList.vue#L68-L69

Added lines #L68 - L69 were not covered by tests
</NcListItem>
</NcAppNavigationItem>

<template v-if="!isPublic">
<CalendarListItem v-for="calendar in sortedCalendars.hidden"
v-show="showHidden"
:key="calendar.id"
class="draggable-calendar-list-item"
:calendar="calendar" />
</template>
<template v-else>
<PublicCalendarListItem v-for="calendar in sortedCalendars.hidden"
v-show="showHidden"
:key="calendar.id"
:calendar="calendar" />
</template>
<!-- The header slot must be placed here, otherwise vuedraggable adds undefined as item to the array -->
<template #footer>
<CalendarListItemLoadingPlaceholder v-if="loadingCalendars" />
Expand All @@ -79,7 +77,7 @@
</template>

<script>
import { NcAppNavigationCaption, NcListItem } from '@nextcloud/vue'
import { NcAppNavigationCaption, NcListItem, NcAppNavigationItem, NcAppNavigationSpacer } from '@nextcloud/vue'
import CalendarListItem from './CalendarList/CalendarListItem.vue'
import CalendarListNew from './CalendarList/CalendarListNew.vue'
import PublicCalendarListItem from './CalendarList/PublicCalendarListItem.vue'
Expand All @@ -106,6 +104,8 @@ export default {
draggable,
NcAppNavigationCaption,
NcListItem,

Check failure on line 106 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

The "NcListItem" component has been registered but not used

Check warning on line 106 in src/components/AppNavigation/CalendarList.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList.vue#L106

Added line #L106 was not covered by tests
NcAppNavigationItem,
NcAppNavigationSpacer,

Check warning on line 108 in src/components/AppNavigation/CalendarList.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList.vue#L108

Added line #L108 was not covered by tests
MenuDown,

Check failure on line 109 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

The "MenuDown" component has been registered but not used
MenuUp,

Check failure on line 110 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

The "MenuUp" component has been registered but not used
CalendarMinus,
Expand All @@ -124,7 +124,6 @@ export default {
return {
calendars: [],
disableDragging: false,
showHidden: false,
}
},
computed: {
Expand All @@ -146,6 +145,7 @@ export default {
}
this.calendars.forEach((calendar) => {
console.log(calendar.displayName)
if (calendar.isSharedWithMe) {
sortedCalendars.shared.push(calendar)
return
Expand Down Expand Up @@ -196,20 +196,3 @@ export default {
},
}
</script>

<style scoped>
:deep(.list-item) {
padding: 4px 8px 4px 8px;
margin-bottom: 0 !important;
margin-top: 20px !important;
}
:deep(.app-navigation-caption__name) {
margin-bottom: 0;
}
:deep(.list-item-details__details) {
margin: 0 !important;
margin-right: -1px !important;
}
</style>
10 changes: 9 additions & 1 deletion src/components/AppNavigation/CalendarList/CalendarListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<template>
<AppNavigationItem :loading="calendar.loading"
:aria-description="descriptionAppNavigationItem"
:name="calendar.displayName || $t('calendar', 'Untitled calendar')"
:name="calendarDisplayName || $t('calendar', 'Untitled calendar')"
:class="{deleted: isBeingDeleted, disabled: !calendar.enabled}"
@click.prevent.stop="toggleEnabled"
@update:menuOpen="actionsMenuOpen = $event">
Expand Down Expand Up @@ -205,6 +205,14 @@ export default {
countdown() {
return this.calendar.countdown
},

Check warning on line 208 in src/components/AppNavigation/CalendarList/CalendarListItem.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListItem.vue#L208

Added line #L208 was not covered by tests
calendarDisplayName() {
if (this.calendar.displayName.substring(0, 5) === 'Deck:') {
return this.calendar.displayName.substring(5)
} else {

Check warning on line 212 in src/components/AppNavigation/CalendarList/CalendarListItem.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListItem.vue#L210-L212

Added lines #L210 - L212 were not covered by tests
return this.calendar.displayName
}
},
},
methods: {
/**
Expand Down

0 comments on commit beed1c3

Please sign in to comment.