-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JanAckermann
committed
Feb 10, 2022
1 parent
8cce512
commit 474ff05
Showing
4 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/web-app-files/src/mixins/spaces/actions/setSpaceImage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { isLocationSpacesActive } from '../../../router' | ||
|
||
export default { | ||
computed: { | ||
$_setSpaceImage_items() { | ||
return [ | ||
{ | ||
name: 'set-space-image', | ||
icon: 'image-edit', | ||
handler: this.$_setSpaceImage_trigger, | ||
label: () => { | ||
return this.$gettext('Set as space image') | ||
}, | ||
isEnabled: ({ resources }) => { | ||
if (resources.length !== 1) { | ||
return false | ||
} | ||
if ( | ||
resources[0].extension !== 'jpeg' && | ||
resources[0].extension !== 'jpg' && | ||
resources[0].extension !== 'png' | ||
) { | ||
return false | ||
} | ||
return isLocationSpacesActive(this.$router, 'files-spaces-project') | ||
}, | ||
canBeDefault: false, | ||
componentType: 'oc-button', | ||
class: 'oc-files-actions-set-space-image-trigger' | ||
} | ||
] | ||
} | ||
}, | ||
methods: { | ||
async $_setSpaceImage_trigger({ resources }) {} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
packages/web-app-files/src/mixins/spaces/actions/setSpaceMarkdown.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { isLocationSpacesActive } from '../../../router' | ||
|
||
export default { | ||
computed: { | ||
$_setSpaceMarkdown_items() { | ||
return [ | ||
{ | ||
name: 'set-space-markdown', | ||
icon: 'markdown', | ||
handler: this.$_setSpaceMarkdown_trigger, | ||
label: () => { | ||
return this.$gettext('Set as space description') | ||
}, | ||
isEnabled: ({ resources }) => { | ||
if (resources.length !== 1) { | ||
return false | ||
} | ||
if (resources[0].extension !== 'md') { | ||
return false | ||
} | ||
return isLocationSpacesActive(this.$router, 'files-spaces-project') | ||
}, | ||
canBeDefault: false, | ||
componentType: 'oc-button', | ||
class: 'oc-files-actions-set-space-markdown-trigger' | ||
} | ||
] | ||
} | ||
}, | ||
methods: { | ||
async $_setSpaceMarkdown_trigger({ resources }) {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters