Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
29a7f7f
feat(files_trashbin): migrate to vue
skjnldsv Jan 13, 2023
03c3277
feat(files): switch to pinia
skjnldsv Feb 4, 2023
638b3df
perf(files): update files store by chunks
skjnldsv Feb 4, 2023
2ff1c00
fix(files_trashbin): previews crop support
skjnldsv Feb 5, 2023
b761039
perf(files): fetch previews faster and cache properly
skjnldsv Mar 17, 2023
10010fc
feat(files): sorting
skjnldsv Mar 21, 2023
f330813
feat(files): custom columns
skjnldsv Mar 22, 2023
0db210a
chore(deps): cleanup unused deps and audit
skjnldsv Mar 22, 2023
0b4da61
feat(files): actions api
skjnldsv Mar 23, 2023
3c3050c
feat(files): implement sorting per view
skjnldsv Mar 24, 2023
0e764f7
fix(files): fix custom render components reactivity
skjnldsv Mar 24, 2023
0f717d4
feat(accessibility): add files table caption and summary
skjnldsv Mar 24, 2023
e85eb4c
fix(files): selection and render performance
skjnldsv Mar 24, 2023
f28944e
feat(files): propagate restore and delete events
skjnldsv Mar 25, 2023
bda286c
perf(files): less verbose
skjnldsv Mar 25, 2023
6358e97
fix(files): inline action styling
skjnldsv Mar 25, 2023
2b25199
fix(files): accessibility tab into recycled invisible files rows
skjnldsv Mar 25, 2023
7215a9a
fix(files): breadcrumbs accessibility title
skjnldsv Mar 28, 2023
4942747
fix(files): use inline NcActions
skjnldsv Mar 28, 2023
60b74e3
feat(files): batch actions
skjnldsv Mar 28, 2023
044e824
chore(deps): update lockfile
skjnldsv Mar 28, 2023
c7c9ee1
feat(files): move userconfig to dedicated store and fix crop previews
skjnldsv Mar 31, 2023
a66cae0
fix(deps): update webdav 5 usage
skjnldsv Mar 31, 2023
014a57e
fix: improved preview handling
skjnldsv Apr 4, 2023
bdbe477
feat(files): add FileAction service
skjnldsv Apr 4, 2023
904348b
chore(npm): build assets
skjnldsv Apr 4, 2023
1361182
chore(eslint): clean and fix
skjnldsv Apr 4, 2023
f060e5a
fix(tests): update jsunit tests after dep and files update
skjnldsv Apr 4, 2023
d432e0c
fix(cypress): component testing with pinia
skjnldsv Apr 5, 2023
8298bb4
fix:(files-checker): add cypress.d.ts and custom.d.ts
skjnldsv Apr 5, 2023
ea3e77d
fix(files): better wording and catch single action run
skjnldsv Apr 5, 2023
5b3900e
fix(tests): acceptance
skjnldsv Apr 6, 2023
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
Prev Previous commit
Next Next commit
feat(files): actions api
Signed-off-by: John Molakvoæ <[email protected]>
  • Loading branch information
skjnldsv committed Apr 6, 2023
commit 0b4da6117fff4d999cb492503a8b6fc04eb75f9d
5 changes: 4 additions & 1 deletion apps/files/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@
}

window._nc_event_bus.emit('files:legacy-view:initialized', this);

this.navigation = OCP.Files.Navigation
},

/**
Expand Down Expand Up @@ -224,7 +226,8 @@
* @return view id
*/
getActiveView: function() {
return this.navigation.active
return this.navigation
&& this.navigation.active
&& this.navigation.active.id;
},

Expand Down
12 changes: 5 additions & 7 deletions apps/files/src/actions/deleteAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { registerFileAction, Permission, FileAction } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
import axios from '@nextcloud/axios'
import TrashCan from '@mdi/svg/svg/trash-can.svg?raw'
import logger from '../logger'

registerFileAction(new FileAction({
id: 'delete',
Expand All @@ -38,12 +39,9 @@ registerFileAction(new FileAction({
.every(permission => (permission & Permission.DELETE) !== 0)
},
async exec(node) {
try {
await axios.delete(node.source)
return true
} catch (error) {
console.error(error)
return false
}
// No try...catch here, let the files app handle the error
await axios.delete(node.source)
return true
},
order: 100,
}))
63 changes: 63 additions & 0 deletions apps/files/src/components/CustomSvgIconRender.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!--
- @copyright Copyright (c) 2019 Gary Kim <[email protected]>
-
- @author Gary Kim <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->
<template>
<span class="custom-svg-icon" />
</template>

<script>
// eslint-disable-next-line import/named
import { sanitize } from 'dompurify'

export default {
name: 'CustomSvgIconRender',
props: {
svg: {
type: String,
required: true,
},
},
mounted() {
this.$el.innerHTML = sanitize(this.svg)
},
}
</script>
<style lang="scss" scoped>
.custom-svg-icon {
display: flex;
align-items: center;
align-self: center;
justify-content: center;
justify-self: center;
width: 44px;
height: 44px;
opacity: 1;

::v-deep svg {
// mdi icons have a size of 24px
// 22px results in roughly 16px inner size
height: 22px;
width: 22px;
fill: currentColor;
}
}

</style>
Loading