From bb100ea8790389d3d1d7383083dd05c0cf2ccfdb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julius=20H=C3=A4rtl?= <jus@bitgrid.net>
Date: Mon, 3 Dec 2018 11:04:25 +0100
Subject: Add setup check for .well-known urls
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Julius Härtl <jus@bitgrid.net>
---
 src/App.vue | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index 299d4c2e..56a362fc 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -4,10 +4,13 @@
 			<app-navigation :menu="menu" />
 		</div>
 		<div id="app-content">
-			<div class="social__wrapper">
-				<Search v-if="searchTerm != ''" :term="searchTerm" />
-				<router-view v-if="searchTerm === ''" :key="$route.fullPath" />
+			<div v-if="serverData.isAdmin && !serverData.checks.success" class="setup">
+				<h3 v-if="!serverData.checks.checks.wellknown">{{ t('social', '.well-known/webfinger isn\'t properly set up!') }}</h3>
+				<p v-if="!serverData.checks.checks.wellknown">{{ t('social', 'Social needs the .well-known auto discovery to be properly set up. If Nextcloud is not installed in the root of the domain it is often the case, that Nextcloud can\'t configure this automatically. To use Social the admin of this Nextcloud instance needs to manually configure the .well-known redirects: ') }}<a class="external_link" href="https://docs.nextcloud.com/server/15/go.php?to=admin-setup-well-known-URL" target="_blank"
+					rel="noreferrer noopener">{{ t('social', 'Open Documentation') }} ↗</a></p>
 			</div>
+			<Search v-if="searchTerm != ''" :term="searchTerm" />
+			<router-view v-if="searchTerm === ''" :key="$route.fullPath" />
 		</div>
 	</div>
 	<div v-else class="setup">
@@ -21,13 +24,13 @@
 						required>
 					<input :value="t('social', 'Finish setup')" type="submit" class="primary">
 				</p>
+				<template v-if="!serverData.checks.success">
+					<h3 v-if="!serverData.checks.checks.wellknown">{{ t('social', '.well-known/webfinger isn\'t properly set up!') }}</h3>
+					<p v-if="!serverData.checks.checks.wellknown">{{ t('social', 'Social needs the .well-known auto discovery to be properly set up. If Nextcloud is not installed in the root of the domain it is often the case, that Nextcloud can\'t configure this automatically. To use Social the admin of this Nextcloud instance needs to manually configure the .well-known redirects: ') }}<a class="external_link" href="https://docs.nextcloud.com/server/15/go.php?to=admin-setup-well-known-URL" target="_blank"
+						rel="noreferrer noopener">{{ t('social', 'Open Documentation') }} ↗</a></p>
+				</template>
 			</form>
 		</template>
-		<template v-else-if="serverData.error">
-			<h2>{{ t('social', 'Social app setup') }}</h2>
-			<p>{{ t('social', '.well-known/webfinger isn\'t properly set up!') }}</p>
-			<p>{{ t('social', 'Social needs the .well-known auto discovery to be properly set up. If Nextcloud is not installed in the root of the domain it is often the case, that Nextcloud can\'t configure this automatically. To use Social the admin of this Nextcloud instance needs to manually configure the .well-known redirects: ') }}<a class="external_link" href="https://docs.nextcloud.com/server/15/go.php?to=admin-setup-well-known-URL" target="_blank" rel="noreferrer noopener">{{ t('social', 'Open Documentation') }} ↗</a></p>
-		</template>
 		<template v-else>
 			<p>{{ t('social', 'The social app requires to be setup by the server administrator.') }}</p>
 		</template>
-- 
cgit v1.2.3

