Skip to content

Commit

Permalink
Fix linter issues nextcloud#4251 (comment)
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Sazanov <m@sazanof.ru>
  • Loading branch information
Mikhail Sazanov committed Jan 25, 2023
1 parent 697a951 commit b99bd53
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 73 deletions.
46 changes: 24 additions & 22 deletions src/components/Editor/Attachments/AttachmentsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@
</div>
</div>

<Actions>
<NcActions>
<template #icon>
<Plus :size="20" />
</template>
<ActionButton @click="openFilesModal()">
<NcActionButton @click="openFilesModal()">
<template #icon>
<Folder :size="20" />
</template>
{{ t('calendar', 'Add from Files') }}
</ActionButton>
<ActionButton @click="clickOnUploadButton">
</NcActionButton>
<NcActionButton @click="clickOnUploadButton">
<template #icon>
<Upload :size="20" />
</template>
{{ t('calendar', 'Upload from device') }}
</ActionButton>
</Actions>
</NcActionButton>
</NcActions>
</div>
<div v-if="attachments.length > 0">
<ul class="attachments-list-item">
<ListItem v-for="attachment in attachments"
<NcListItem v-for="attachment in attachments"
:key="attachment.path"
:force-display-actions="true"
:title="getBaseName(attachment.fileName)"
Expand All @@ -45,29 +45,31 @@
<img :src="getPreview(attachment)" class="attachment-icon">
</template>
<template #actions>
<ActionButton @click="deleteAttachmentFromEvent(attachment)">
<NcActionButton @click="deleteAttachmentFromEvent(attachment)">
<template #icon>
<Close :size="20" />
</template>
{{ t('calendar', 'Delete file') }}
</ActionButton>
</NcActionButton>
</template>
</ListItem>
</NcListItem>
</ul>
</div>
</div>
</template>

<script>
import ListItem from '@nextcloud/vue/dist/Components/NcListItem'
import Actions from '@nextcloud/vue/dist/Components/NcActions'
import ActionButton from '@nextcloud/vue/dist/Components/NcActionButton'
import {
NcListItem,
NcActions,
NcActionButton
} from '@nextcloud/vue'
import Upload from 'vue-material-design-icons/Upload'
import Close from 'vue-material-design-icons/Close'
import Folder from 'vue-material-design-icons/Folder'
import Paperclip from 'vue-material-design-icons/Paperclip'
import Plus from 'vue-material-design-icons/Plus'
import Upload from 'vue-material-design-icons/Upload.vue'
import Close from 'vue-material-design-icons/Close.vue'
import Folder from 'vue-material-design-icons/Folder.vue'
import Paperclip from 'vue-material-design-icons/Paperclip.vue'
import Plus from 'vue-material-design-icons/Plus.vue'
import { generateUrl } from '@nextcloud/router'
import { getFilePickerBuilder, showError } from '@nextcloud/dialogs'
Expand All @@ -76,14 +78,14 @@ import {
getFileInfo,
createCalendarFolder,
} from '../../../services/attachmentService.js'
import { parseXML } from 'webdav/dist/node/tools/dav'
import { parseXML } from 'webdav/dist/node/tools/dav.js'
export default {
name: 'AttachmentsList',
components: {
ListItem,
Actions,
ActionButton,
NcListItem,
NcActions,
NcActionButton,
Upload,
Close,
Folder,
Expand Down
2 changes: 1 addition & 1 deletion src/store/calendarObjectInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { mapAlarmComponentToAlarmObject } from '../models/alarm.js'
import { getObjectAtRecurrenceId } from '../utils/calendarObject.js'
import logger from '../utils/logger.js'
import settings from './settings.js'
import { getRFCProperties } from '../models/rfcProps'
import { getRFCProperties } from '../models/rfcProps.js'
import { generateUrl } from '@nextcloud/router'

const state = {
Expand Down
103 changes: 53 additions & 50 deletions src/views/EditSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
-->

<template>
<AppSidebar :title="title"
<NcAppSidebar :title="title"
:title-editable="!isReadOnly && !isLoading"
:title-placeholder="$t('calendar', 'Event title')"
:subtitle="subTitle"
Expand All @@ -38,11 +38,11 @@
</div>
</template>
<template v-else-if="isError">
<EmptyContent :title="$t('calendar', 'Event does not exist')" :description="error">
<NcEmptyContent :title="$t('calendar', 'Event does not exist')" :description="error">
<template #icon>
<CalendarBlank :size="20" decorative />
</template>
</EmptyContent>
</NcEmptyContent>
</template>

<template #header>
Expand All @@ -51,37 +51,37 @@

<template v-if="!isLoading && !isError && !isNew"
#secondary-actions>
<ActionLink v-if="!hideEventExport && hasDownloadURL"
<NcActionLink v-if="!hideEventExport && hasDownloadURL"
:href="downloadURL">
<template #icon>
<Download :size="20" decorative />
</template>
{{ $t('calendar', 'Export') }}
</ActionLink>
<ActionButton v-if="!canCreateRecurrenceException && !isReadOnly" @click="duplicateEvent()">
</NcActionLink>
<NcActionButton v-if="!canCreateRecurrenceException && !isReadOnly" @click="duplicateEvent()">
<template #icon>
<ContentDuplicate :size="20" decorative />
</template>
{{ $t('calendar', 'Duplicate') }}
</ActionButton>
<ActionButton v-if="canDelete && !canCreateRecurrenceException" @click="deleteAndLeave(false)">
</NcActionButton>
<NcActionButton v-if="canDelete && !canCreateRecurrenceException" @click="deleteAndLeave(false)">
<template #icon>
<Delete :size="20" decorative />
</template>
{{ $t('calendar', 'Delete') }}
</ActionButton>
<ActionButton v-if="canDelete && canCreateRecurrenceException" @click="deleteAndLeave(false)">
</NcActionButton>
<NcActionButton v-if="canDelete && canCreateRecurrenceException" @click="deleteAndLeave(false)">
<template #icon>
<Delete :size="20" decorative />
</template>
{{ $t('calendar', 'Delete this occurrence') }}
</ActionButton>
<ActionButton v-if="canDelete && canCreateRecurrenceException" @click="deleteAndLeave(true)">
</NcActionButton>
<NcActionButton v-if="canDelete && canCreateRecurrenceException" @click="deleteAndLeave(true)">
<template #icon>
<Delete :size="20" decorative />
</template>
{{ $t('calendar', 'Delete this and all future') }}
</ActionButton>
</NcActionButton>
</template>

<template v-if="!isLoading && !isError"
Expand Down Expand Up @@ -114,7 +114,7 @@
@close="closeEditorAndSkipAction" />
</template>

<AppSidebarTab v-if="!isLoading && !isError"
<NcAppSidebarTab v-if="!isLoading && !isError"
id="app-sidebar-tab-details"
class="app-sidebar-tab"
:name="$t('calendar', 'Details')"
Expand Down Expand Up @@ -174,7 +174,7 @@
:calendar-object-instance="calendarObjectInstance"
:is-read-only="isReadOnly" />

<Modal v-if="showModal && !isPrivate()"
<NcModal v-if="showModal && !isPrivate()"
:title="t('calendar', 'Managing shared access')"
@close="closeAttachmentsModal">
<div class="modal-content">
Expand All @@ -185,7 +185,7 @@
{{ n('calendar', 'User requires access to your file', 'Users requires access to your file', showModalUsers.length) }}
</div>
<div class="users">
<ListItemIcon v-for="attendee in showModalUsers"
<NcListItemIcon v-for="attendee in showModalUsers"
:key="attendee.uri"
class="user-list-item"
:title="attendee.commonName"
Expand All @@ -196,7 +196,7 @@
{{ n('calendar', 'Attachment requiring shared access', 'Attachments requiring shared access', showModalNewAttachments.length) }}
</div>
<div class="attachments">
<ListItemIcon v-for="attachment in showModalNewAttachments"
<NcListItemIcon v-for="attachment in showModalNewAttachments"
:key="attachment.xNcFileId"
class="attachment-list-item"
:title="getBaseName(attachment.fileName)"
Expand All @@ -205,23 +205,23 @@
</div>
<div class="modal-footer">
<div class="modal-footer-checkbox">
<CheckboxRadioSwitch v-if="!isPrivate()" :checked.sync="doNotShare">
<NcCheckboxRadioSwitch v-if="!isPrivate()" :checked.sync="doNotShare">
{{ t('calendar', 'Deny access') }}
</CheckboxRadioSwitch>
</NcCheckboxRadioSwitch>
</div>
<div class="modal-footer-buttons">
<Button @click="closeAttachmentsModal">
<NcButton @click="closeAttachmentsModal">
{{ t('calendar', 'Cancel') }}
</Button>
<Button type="primary"
</NcButton>
<NcButton type="primary"
:disabled="showPreloader"
@click="acceptAttachmentsModal(thisAndAllFuture)">
{{ t('calendar', 'Invite') }}
</Button>
</NcButton>
</div>
</div>
</div>
</Modal>
</NcModal>
</div>
<SaveButtons v-if="showSaveButtons"
class="app-sidebar-tab__buttons"
Expand All @@ -230,8 +230,8 @@
:force-this-and-all-future="forceThisAndAllFuture"
@save-this-only="prepareAccessForAttachments(false)"
@save-this-and-all-future="prepareAccessForAttachments(true)" />
</AppSidebarTab>
<AppSidebarTab v-if="!isLoading && !isError"
</NcAppSidebarTab>
<NcAppSidebarTab v-if="!isLoading && !isError"
id="app-sidebar-tab-attendees"
class="app-sidebar-tab"
:name="$t('calendar', 'Attendees')"
Expand All @@ -251,8 +251,8 @@
:force-this-and-all-future="forceThisAndAllFuture"
@save-this-only="prepareAccessForAttachments(false)"
@save-this-and-all-future="prepareAccessForAttachments(true)" />
</AppSidebarTab>
<AppSidebarTab v-if="!isLoading && !isError"
</NcAppSidebarTab>
<NcAppSidebarTab v-if="!isLoading && !isError"
id="app-sidebar-tab-resources"
class="app-sidebar-tab"
:name="$t('calendar', 'Resources')"
Expand All @@ -272,19 +272,22 @@
:force-this-and-all-future="forceThisAndAllFuture"
@save-this-only="prepareAccessForAttachments(false)"
@save-this-and-all-future="prepareAccessForAttachments(true)" />
</AppSidebarTab>
</AppSidebar>
</NcAppSidebarTab>
</NcAppSidebar>
</template>
<script>
import AppSidebar from '@nextcloud/vue/dist/Components/NcAppSidebar'
import AppSidebarTab from '@nextcloud/vue/dist/Components/NcAppSidebarTab'
import ActionLink from '@nextcloud/vue/dist/Components/NcActionLink'
import ActionButton from '@nextcloud/vue/dist/Components/NcActionButton'
import EmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent'
import Modal from '@nextcloud/vue/dist/Components/NcModal'
import ListItemIcon from '@nextcloud/vue/dist/Components/NcListItemIcon'
import Button from '@nextcloud/vue/dist/Components/NcButton'
import CheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch'
import {
NcAppSidebar,
NcAppSidebarTab,
NcActionLink,
NcActionButton,
NcEmptyContent,
NcModal,
NcListItemIcon,
NcButton,
NcCheckboxRadioSwitch

} from '@nextcloud/vue'

import { mapState } from 'vuex'
import { generateUrl } from '@nextcloud/router'
Expand All @@ -304,8 +307,8 @@ import moment from '@nextcloud/moment'
import SaveButtons from '../components/Editor/SaveButtons.vue'
import PropertySelectMultiple from '../components/Editor/Properties/PropertySelectMultiple.vue'
import PropertyColor from '../components/Editor/Properties/PropertyColor.vue'
import ResourceList from '../components/Editor/Resources/ResourceList'
import InvitationResponseButtons from '../components/Editor/InvitationResponseButtons'
import ResourceList from '../components/Editor/Resources/ResourceList.vue'
import InvitationResponseButtons from '../components/Editor/InvitationResponseButtons.vue'
import AttachmentsList from '../components/Editor/Attachments/AttachmentsList.vue'

import AccountMultiple from 'vue-material-design-icons/AccountMultiple.vue'
Expand All @@ -328,11 +331,15 @@ export default {
SaveButtons,
IllustrationHeader,
AlarmList,
AppSidebar,
AppSidebarTab,
ActionLink,
ActionButton,
EmptyContent,
NcAppSidebar,
NcAppSidebarTab,
NcActionLink,
NcActionButton,
NcEmptyContent,
NcModal,
NcListItemIcon,
NcButton,
NcCheckboxRadioSwitch,
InviteesList,
PropertyCalendarPicker,
PropertySelect,
Expand All @@ -348,10 +355,6 @@ export default {
MapMarker,
InvitationResponseButtons,
AttachmentsList,
Modal,
ListItemIcon,
Button,
CheckboxRadioSwitch,
},
mixins: [
EditorMixin,
Expand Down

0 comments on commit b99bd53

Please sign in to comment.