Skip to content

Commit e7f6e16

Browse files
committed
feat(federatedfilesharing): improve admin docs and settings
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent b434750 commit e7f6e16

10 files changed

Lines changed: 80 additions & 25 deletions

File tree

apps/federatedfilesharing/src/components/AdminSettings.vue

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,17 @@
4444
{{ t('federatedfilesharing', 'Allow people to publish their data to a global and public address book') }}
4545
</NcCheckboxRadioSwitch>
4646

47-
<NcCheckboxRadioSwitch type="switch"
48-
:checked.sync="federatedTrustedShareAutoAccept"
49-
@update:checked="update('federatedTrustedShareAutoAccept', federatedTrustedShareAutoAccept)">
50-
{{ t('federatedfilesharing', 'Automatically accept shares from federated accounts and groups by default') }}
51-
</NcCheckboxRadioSwitch>
47+
<!-- Trusted server handling -->
48+
<div class="settings-subsection">
49+
<h3 class="settings-subsection__name">
50+
{{ t('federatedfilesharing', 'Trusted federation') }}
51+
</h3>
52+
<NcCheckboxRadioSwitch type="switch"
53+
:checked.sync="federatedTrustedShareAutoAccept"
54+
@update:checked="update('federatedTrustedShareAutoAccept', federatedTrustedShareAutoAccept)">
55+
{{ t('federatedfilesharing', 'Automatically accept shares from trusted federated accounts and groups by default') }}
56+
</NcCheckboxRadioSwitch>
57+
</div>
5258
</NcSettingsSection>
5359
</template>
5460

@@ -118,3 +124,18 @@ export default {
118124
},
119125
}
120126
</script>
127+
<style scoped>
128+
.settings-subsection {
129+
margin-top: 20px;
130+
}
131+
132+
.settings-subsection__name {
133+
display: inline-flex;
134+
align-items: center;
135+
justify-content: center;
136+
font-size: 16px;
137+
font-weight: bold;
138+
max-width: 900px;
139+
margin-top: 0;
140+
}
141+
</style>

apps/federation/templates/settings-admin.php

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
11
<?php
2-
32
/**
43
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
54
* SPDX-FileCopyrightText: 2015-2016 ownCloud, Inc.
65
* SPDX-License-Identifier: AGPL-3.0-only
76
*/
8-
/** @var array $_ */
7+
98
use OCA\Federation\TrustedServers;
9+
use OCP\IL10N;
10+
use OCP\IURLGenerator;
11+
use OCP\Server;
12+
use OCP\Util;
13+
14+
/** @var IL10N $l */
15+
16+
Util::addScript('federation', 'settings-admin');
17+
Util::addStyle('federation', 'settings-admin');
1018

11-
/** @var \OCP\IL10N $l */
12-
script('federation', 'settings-admin');
13-
style('federation', 'settings-admin')
19+
$urlGenerator = Server::get(IURLGenerator::class);
20+
$documentationLink = $urlGenerator->linkToDocs('admin-sharing-federated') . '#configuring-trusted-nextcloud-servers';
21+
$documentationLabel = $l->t('External documentation for Federated Cloud Sharing');
1422
?>
1523
<div id="ocFederationSettings" class="section">
16-
<h2><?php p($l->t('Trusted servers')); ?></h2>
24+
<h2>
25+
<?php p($l->t('Trusted servers')); ?>
26+
<a target="_blank" rel="noreferrer noopener" class="icon-info"
27+
title="<?php p($documentationLabel);?>"
28+
href="<?php p($documentationLink); ?>"></a>
29+
</h2>
1730
<p class="settings-hint"><?php p($l->t('Federation allows you to connect with other trusted servers to exchange the account directory. For example this will be used to auto-complete external accounts for federated sharing. It is not necessary to add a server as trusted server in order to create a federated share.')); ?></p>
31+
<p class="settings-hint"><?php p($l->t('Each server must validate the other. This process may require a few cron cycles.')); ?></p>
1832

1933
<ul id="listOfTrustedServers">
2034
<?php foreach ($_['trustedServers'] as $trustedServer) { ?>

apps/settings/css/settings.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/css/settings.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/css/settings.scss

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ span.usersLastLoginTooltip {
568568
}
569569

570570
/* SETTINGS SECTIONS */
571+
// to match with NcSettingsSection component
571572
.section {
572573
margin-bottom: 0;
573574
/* section divider lines, none needed for last one */
@@ -577,13 +578,32 @@ span.usersLastLoginTooltip {
577578

578579
/* correctly display help icons next to headings */
579580
h2 {
580-
margin-bottom: 22px;
581+
display: inline-flex;
582+
align-items: center;
583+
justify-content: center;
584+
font-size: 20px;
585+
font-weight: bold;
586+
max-width: 900px;
587+
margin-top: 0;
581588

582-
.icon-info {
583-
padding: 6px 20px;
584-
vertical-align: text-bottom;
585-
display: inline-block;
589+
.icon-info {
590+
display: flex;
591+
align-items: center;
592+
justify-content: center;
593+
width: var(--default-clickable-area);
594+
height: var(--default-clickable-area);
595+
margin: calc((var(--default-clickable-area) - 16px) / 2 * -1);
596+
margin-inline-start: 0;
597+
color: var(--color-text-maxcontrast);
586598
}
599+
600+
}
601+
602+
p {
603+
margin-top: -0.2em;
604+
margin-bottom: 1em;
605+
color: var(--color-text-maxcontrast);
606+
max-width: 900px;
587607
}
588608
}
589609

dist/9701-9701.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/federatedfilesharing-vue-settings-admin.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/federatedfilesharing-vue-settings-admin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-init.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-init.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)