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

[stable5.0] fix(CalendarListNew): Public Calendar Modal Opening #6344

Merged
merged 1 commit into from
Sep 14, 2024
Merged
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
180 changes: 92 additions & 88 deletions src/components/AppNavigation/CalendarList/CalendarListNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,96 +4,100 @@
-->

<template>
<NcAppNavigationCaption class="app-navigation-entry-new-calendar"
:class="{'app-navigation-entry-new-calendar--open': isOpen}"
:name="$t('calendar', 'Calendars')"
:menu-open.sync="isOpen"
@click.prevent.stop="toggleDialog">
<template #actionsTriggerIcon>
<Plus :size="20" :title="$t('calendar', 'Add new')" decorative />
</template>
<template #actions>
<ActionButton v-if="showCreateCalendarLabel"
@click.prevent.stop="openCreateCalendarInput">
<template #icon>
<CalendarBlank :size="20" decorative />
</template>
{{ $t('calendar', 'New calendar') }}
</ActionButton>
<ActionInput v-if="showCreateCalendarInput"
:aria-label="$t('calendar', 'Name for new calendar')"
@submit.prevent.stop="createNewCalendar">
<template #icon>
<CalendarBlank :size="20" decorative />
</template>
</ActionInput>
<ActionText v-if="showCreateCalendarSaving"
icon="icon-loading-small">
<!-- eslint-disable-next-line no-irregular-whitespace -->
{{ $t('calendar', 'Creating calendar …') }}
</ActionText>
<div>
<NcAppNavigationCaption class="app-navigation-entry-new-calendar"
:class="{'app-navigation-entry-new-calendar--open': isOpen}"
:name="$t('calendar', 'Calendars')"
:menu-open.sync="isOpen"
@click.prevent.stop="toggleDialog">
<template #actionsTriggerIcon>
<Plus :size="20" :title="$t('calendar', 'Add new')" decorative />
</template>
<template #actions>
<ActionButton v-if="showCreateCalendarLabel"
@click.prevent.stop="openCreateCalendarInput">
<template #icon>
<CalendarBlank :size="20" decorative />
</template>
{{ $t('calendar', 'New calendar') }}

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListNew.vue#L22

Added line #L22 was not covered by tests
</ActionButton>
<ActionInput v-if="showCreateCalendarInput"
:aria-label="$t('calendar', 'Name for new calendar')"
@submit.prevent.stop="createNewCalendar">
<template #icon>
<CalendarBlank :size="20" decorative />

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListNew.vue#L27-L28

Added lines #L27 - L28 were not covered by tests
</template>
</ActionInput>
<ActionText v-if="showCreateCalendarSaving"
icon="icon-loading-small">
<!-- eslint-disable-next-line no-irregular-whitespace -->
{{ $t('calendar', 'Creating calendar …') }}
</ActionText>

<ActionButton v-if="showCreateCalendarTaskListLabel"
@click.prevent.stop="openCreateCalendarTaskListInput">
<template #icon>
<CalendarCheck :size="20" decorative />
</template>
{{ $t('calendar', 'New calendar with task list') }}
</ActionButton>
<ActionInput v-if="showCreateCalendarTaskListInput"
:aria-label="$t('calendar', 'Name for new calendar')"
@submit.prevent.stop="createNewCalendarTaskList">
<template #icon>
<CalendarCheck :size="20" decorative />
</template>
</ActionInput>
<ActionText v-if="showCreateCalendarTaskListSaving"
icon="icon-loading-small">
<!-- eslint-disable-next-line no-irregular-whitespace -->
{{ $t('calendar', 'Creating calendar …') }}
</ActionText>
<ActionButton v-if="showCreateCalendarTaskListLabel"
@click.prevent.stop="openCreateCalendarTaskListInput">
<template #icon>
<CalendarCheck :size="20" decorative />
</template>
{{ $t('calendar', 'New calendar with task list') }}
</ActionButton>
<ActionInput v-if="showCreateCalendarTaskListInput"
:aria-label="$t('calendar', 'Name for new calendar')"
@submit.prevent.stop="createNewCalendarTaskList">
<template #icon>
<CalendarCheck :size="20" decorative />
</template>
</ActionInput>

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListNew.vue#L50

Added line #L50 was not covered by tests
<ActionText v-if="showCreateCalendarTaskListSaving"
icon="icon-loading-small">
<!-- eslint-disable-next-line no-irregular-whitespace -->
{{ $t('calendar', 'Creating calendar …') }}
</ActionText>

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListNew.vue#L55

Added line #L55 was not covered by tests

<ActionSeparator v-if="canSubscribeLink" />
<ActionButton v-if="showCreateSubscriptionLabel && canSubscribeLink"
@click.prevent.stop="openCreateSubscriptionInput">
<template #icon>
<LinkVariant :size="20" decorative />
</template>
{{ $t('calendar', 'New subscription from link (read-only)') }}
</ActionButton>
<ActionInput v-if="showCreateSubscriptionInput"
:aria-label="$t('calendar', 'Name for new calendar')"
@submit.prevent.stop="createNewSubscription">
<template #icon>
<LinkVariant :size="20" decorative />
</template>
</ActionInput>
<ActionText v-if="showCreateSubscriptionSaving"
icon="icon-loading-small">
<!-- eslint-disable-next-line no-irregular-whitespace -->
{{ $t('calendar', 'Creating subscription …') }}
</ActionText>
<ActionButton v-if="canSubscribeLink" @click="showHolidaySubscriptionPicker = true">
{{ t('calendar', 'Add public holiday calendar') }}
<template #icon>
<Web :size="20" decorative />
</template>
</ActionButton>
<ActionButton v-if="hasPublicCalendars" @click="showPublicCalendarSubscriptionPicker = true">
{{ t('calendar', 'Add custom public calendar') }}
<template #icon>
<Web :size="20" decorative />
</template>
</ActionButton>
</template>
<template #extra>
<PublicCalendarSubscriptionPicker v-if="showHolidaySubscriptionPicker"
:show-holidays="true"
@close="showHolidaySubscriptionPicker = false" />
<PublicCalendarSubscriptionPicker v-if="showPublicCalendarSubscriptionPicker"
@close="showPublicCalendarSubscriptionPicker = false" />
</template>
</NcAppNavigationCaption>
<ActionSeparator v-if="canSubscribeLink" />

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListNew.vue#L57

Added line #L57 was not covered by tests
<ActionButton v-if="showCreateSubscriptionLabel && canSubscribeLink"
@click.prevent.stop="openCreateSubscriptionInput">

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListNew.vue#L59

Added line #L59 was not covered by tests
<template #icon>
<LinkVariant :size="20" decorative />
</template>
{{ $t('calendar', 'New subscription from link (read-only)') }}
</ActionButton>
<ActionInput v-if="showCreateSubscriptionInput"
:aria-label="$t('calendar', 'Name for new calendar')"
@submit.prevent.stop="createNewSubscription">

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListNew.vue#L66-L67

Added lines #L66 - L67 were not covered by tests
<template #icon>
<LinkVariant :size="20" decorative />
</template>
</ActionInput>
<ActionText v-if="showCreateSubscriptionSaving"
icon="icon-loading-small">
<!-- eslint-disable-next-line no-irregular-whitespace -->
{{ $t('calendar', 'Creating subscription …') }}
</ActionText>
<ActionButton v-if="canSubscribeLink"
:close-after-click="true"
@click="showHolidaySubscriptionPicker = true">

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListNew.vue#L72-L79

Added lines #L72 - L79 were not covered by tests
{{ t('calendar', 'Add public holiday calendar') }}
<template #icon>
<Web :size="20" decorative />
</template>
</ActionButton>
<ActionButton v-if="hasPublicCalendars"
:close-after-click="true"
@click="showPublicCalendarSubscriptionPicker = true">
{{ t('calendar', 'Add custom public calendar') }}
<template #icon>
<Web :size="20" decorative />
</template>

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListNew.vue#L84-L91

Added lines #L84 - L91 were not covered by tests
</ActionButton>
</template>
</NcAppNavigationCaption>
<PublicCalendarSubscriptionPicker v-if="showHolidaySubscriptionPicker"
:show-holidays="true"
@close="showHolidaySubscriptionPicker = false" />
<PublicCalendarSubscriptionPicker v-if="showPublicCalendarSubscriptionPicker"
@close="showPublicCalendarSubscriptionPicker = false" />
</div>

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/CalendarList/CalendarListNew.vue#L96-L100

Added lines #L96 - L100 were not covered by tests
</template>

<script>
Expand Down
Loading