Skip to content

Commit

Permalink
fixup! fixup! Add OCA.Files.Sidebar
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Aug 6, 2019
1 parent 10ad486 commit 3bcc7b6
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 13 deletions.
1 change: 1 addition & 0 deletions apps/files_sharing/appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'OCA\Files::loadAdditionalScripts',
function() {
\OCP\Util::addScript('files_sharing', 'dist/additionalScripts');
\OCP\Util::addStyle('files_sharing', 'icons');
}
);
\OC::$server->getEventDispatcher()->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function () {
Expand Down
9 changes: 9 additions & 0 deletions apps/files_sharing/css/icons.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.icon-room {
@include icon-color('app', 'spreed', $color-black);
}
.icon-circle {
@include icon-color('circles', 'circles', $color-black, false, 2);
}
.icon-guests {
@include icon-color('app', 'guests', $color-black);
}
2 changes: 2 additions & 0 deletions apps/files_sharing/src/components/SharingEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ export default {
title += ` (${ t('files_sharing', 'remote') })`
} else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP) {
title += ` (${ t('files_sharing', 'remote group') })`
} else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_GUEST) {
title += ` (${ t('files_sharing', 'guest') })`
}
return title
},
Expand Down
33 changes: 20 additions & 13 deletions apps/files_sharing/src/components/SharingEntryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
<Actions v-else-if="!loading" class="sharing-entry__actions"
menu-align="right" :open.sync="open"
@close="onMenuClose">
<template v-if="share">
<template v-if="share">
<template v-if="isShareOwner">
<!-- folder -->
<template v-if="isFolder && fileHasCreatePermission && this.config.isPublicUploadEnabled">
<ActionCheckbox :checked="share.permissions === publicUploadRValue"
Expand Down Expand Up @@ -195,21 +196,22 @@
trigger: 'manual'
}"
@update:value="debounceQueueUpdate('note')" />

<ActionButton icon="icon-delete" :disabled="saving" @click.prevent="onDelete">
{{ t('files_sharing', 'Delete share') }}
</ActionButton>
<ActionButton v-if="!isEmailShareType"
class="new-share-link" icon="icon-add"
@click.prevent.stop="onNewLinkShare">
{{ t('files_sharing', 'Add another link') }}
</ActionButton>
</template>

<!-- Create new share -->
<ActionButton v-else class="new-share-link" icon="icon-add" @click.prevent.stop="onNewLinkShare">
{{ t('files_sharing', 'Create a new share link') }}
<ActionButton icon="icon-delete" :disabled="saving" @click.prevent="onDelete">
{{ t('files_sharing', 'Delete share') }}
</ActionButton>
<ActionButton v-if="!isEmailShareType"
class="new-share-link" icon="icon-add"
@click.prevent.stop="onNewLinkShare">
{{ t('files_sharing', 'Add another link') }}
</ActionButton>
</template>

<!-- Create new share -->
<ActionButton v-else class="new-share-link" icon="icon-add" @click.prevent.stop="onNewLinkShare">
{{ t('files_sharing', 'Create a new share link') }}
</ActionButton>
</Actions>

<!-- loading indicator to replace the menu -->
Expand Down Expand Up @@ -274,6 +276,11 @@ export default {
* TODO: allow editing
*/
title() {
if (!this.isShareOwner) {
return t('files_sharing', 'Shared via link by {initiator}', {
initiator: this.share.ownerDisplayName
})
}
if (this.share && this.share.label && this.share.label.trim() !== '') {
return this.share.label
}
Expand Down
6 changes: 6 additions & 0 deletions apps/files_sharing/src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Share from '../models/Share'
import SharesRequests from './ShareRequests'
import ShareTypes from './ShareTypes'
import Config from '../services/ConfigService'
import { getCurrentUser } from 'nextcloud-auth';

export default {
mixins: [SharesRequests, ShareTypes],
Expand Down Expand Up @@ -147,7 +148,12 @@ export default {
date: 'Select Date' // TODO: Translate
}
}
},

isShareOwner() {
return this.share.owner === getCurrentUser().uid
}

},

methods: {
Expand Down

0 comments on commit 3bcc7b6

Please sign in to comment.