Skip to content

Commit

Permalink
fix(CalendarListNew): Public Calendar Modal Opening
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
  • Loading branch information
SebastianKrupinski committed Sep 14, 2024
1 parent e5be3ce commit d089187
Showing 1 changed file with 93 additions and 88 deletions.
181 changes: 93 additions & 88 deletions src/components/AppNavigation/CalendarList/CalendarListNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,96 +4,101 @@
-->

<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"
:closeAfterClick = "true"

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

View workflow job for this annotation

GitHub Actions / NPM lint

Attribute ':closeAfterClick' must be hyphenated

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

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected spaces found around equal signs
@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"
:closeAfterClick = "true"

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

View workflow job for this annotation

GitHub Actions / NPM lint

Attribute ':closeAfterClick' must be hyphenated

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

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected spaces found around equal signs
@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>

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

View workflow job for this annotation

GitHub Actions / NPM lint

Expected 1 line break before closing tag (`</ncappnavigationcaption>`), but 2 line breaks found

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

View workflow job for this annotation

GitHub Actions / NPM lint

Trailing spaces not allowed
</NcAppNavigationCaption>
<PublicCalendarSubscriptionPicker v-if="showHolidaySubscriptionPicker"
:show-holidays="true"
@close="showHolidaySubscriptionPicker = false" />
<PublicCalendarSubscriptionPicker v-if="showPublicCalendarSubscriptionPicker"
@close="showPublicCalendarSubscriptionPicker = false" />
</div>

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

View check run for this annotation

Codecov / codecov/patch

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

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

<script>
Expand Down

0 comments on commit d089187

Please sign in to comment.