Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OCA.Files.Sidebar and migrate sharing #15719

Merged
merged 14 commits into from
Oct 29, 2019
Merged

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented May 24, 2019

If anyone have specific questions about part of a code, feel free to ask me on talk directly!


Todo

Bugs

  • Tooltip arrow needs a fix (position is calculated but our css is not allowing that)
    Capture d’écran_2019-07-11_16-59-23
  • Clipboard status tooltip not showing on the ActionLink (share link and internal link), this is because of the Actions component v-tooltip that conflicts. Asked the dev about it: https://twitter.com/skjnldsv/status/1149206297923002369. Removing the v-tooltip from Actions works. Other solution would be to force the tooltip to be shown and use the ActionLink default text slot to display the status. But clicking it focus on on another element than the action (fake element for the clipboard library) and therefore make the hover state change and the tooltip disappear.
  • Firefox refuse the auto copy for security since the call is not direct (share link creation, then use the mounted function. We should find another way to call it.
  • Datepicker can probably prevent picking a date before the current day
  • Weird ui when password is on by default (not enforced) and date is enforced. We have the popover to ask for an expire date, and a default password is generated on the background. So when you submit the share creation, it's being generated with a password that the user does not know yet!

APIs

Register new tab

<template>
	<Tab :icon="icon" :name="name" :class="{ 'icon-loading': loading }">
		<!-- Whatever in the tab -->
	</Tab>
</template>
<script>
import Tab from 'nextcloud-vue/dist/Components/AppSidebarTab'
export default {
	name: 'SharingTab',
	components: {
		Tab
	},
	props: {
		// fileInfo will be given by the Sidebar
		fileInfo: {
			type: Object,
			default: () => {},
			required: true
		}
	},
	data() {
		return {
			icon: 'icon-share',
			loading: true,
			name: t('files_sharing', 'Sharing')
		}
	},
	computed: {
		/**
		 * Needed to differenciate the tabs
		 * pulled from the AppSidebarTab component
		 * 
		 * @returns {string}
		 */
		id() {
			return this.name.toLowerCase().replace(/ /g, '-')
		},

		/**
		 * Returns the current active tab
		 * needed because AppSidebarTab also uses $parent.activeTab
		 *
		 * @returns {string}
		 */
		activeTab() {
			return this.$parent.activeTab
		}
	}
}
</script>
import SharingTab from './views/SharingTab'
window.addEventListener('DOMContentLoaded', () => {
	if (OCA.Files && OCA.Files.Sidebar) {
		OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab('sharing', SharingTab))
	}
})

Register new external link action in shares link menu (social sharing)

window.addEventListener('DOMContentLoaded', () => {
	if (OCA.Sharing && OCA.Sharing.ExternalLinkActions) {
		OCA.Sharing.ExternalLinkActions.registerAction({
			url: link =>`https://share.diasporafoundation.org/?url=${link}`,
			name: t('socialsharing_facebook', 'Share to  Diaspora'),
			icon: 'icon-social-diaspora'
		});
	}
});

Registering a new section in the sharing tab

OCA.Sharing.ShareTabSections.registerSection((el, fileInfo) => {
	if (fileInfo.mountType !== 'group') {
			return
	}
	return MyVueComponent
})

@skjnldsv skjnldsv added this to the Nextcloud 17 milestone May 24, 2019
@skjnldsv skjnldsv self-assigned this May 24, 2019
@skjnldsv skjnldsv force-pushed the enhancement/sidebar/standard branch from ac5f979 to e01c8bc Compare May 29, 2019 16:19
@skjnldsv skjnldsv force-pushed the enhancement/sidebar/standard branch from e01c8bc to 32fc618 Compare June 7, 2019 13:31
@skjnldsv

This comment has been minimized.

@juliusknorr

This comment has been minimized.

@skjnldsv

This comment has been minimized.

@skjnldsv skjnldsv force-pushed the enhancement/sidebar/standard branch 2 times, most recently from e1caa22 to d84baf4 Compare July 8, 2019 16:27
@skjnldsv skjnldsv force-pushed the enhancement/sidebar/standard branch 3 times, most recently from 7b7239c to 87480c0 Compare July 12, 2019 19:00
@MorrisJobke MorrisJobke mentioned this pull request Jul 15, 2019
28 tasks
@rullzer rullzer modified the milestones: Nextcloud 17, Nextcloud 18 Jul 15, 2019
@skjnldsv skjnldsv force-pushed the enhancement/sidebar/standard branch 4 times, most recently from 9cf8980 to e45019f Compare July 28, 2019 08:53
@skjnldsv skjnldsv force-pushed the enhancement/sidebar/standard branch from 3bcc7b6 to 4241a55 Compare August 8, 2019 17:22
@skjnldsv
Copy link
Member Author

History was made! :D
Capture d’écran_2019-10-29_14-48-25
Capture d’écran_2019-10-29_14-53-16

@jancborchardt
Copy link
Member

where were you when sidebar was merge

@skjnldsv skjnldsv mentioned this pull request Mar 18, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants