aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2020-04-02 15:32:18 +0200
committerLibravatar vantezzen <hello@vantezzen.io>2020-04-02 15:32:18 +0200
commitddd002094d5c80ca4065b7d181e7f5b9471556da (patch)
tree1c5d9d018878595b32b4ec6bd3734bef698237d5 /app
parentMerge branch 'master' of https://github.com/getferdi/ferdi-server (diff)
downloadferdium-server-ddd002094d5c80ca4065b7d181e7f5b9471556da.tar.gz
ferdium-server-ddd002094d5c80ca4065b7d181e7f5b9471556da.tar.zst
ferdium-server-ddd002094d5c80ca4065b7d181e7f5b9471556da.zip
Update dashboard design
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/Http/DashboardController.js17
-rw-r--r--app/Controllers/Http/UserController.js6
2 files changed, 19 insertions, 4 deletions
diff --git a/app/Controllers/Http/DashboardController.js b/app/Controllers/Http/DashboardController.js
index 86cfa74..a47beb6 100644
--- a/app/Controllers/Http/DashboardController.js
+++ b/app/Controllers/Http/DashboardController.js
@@ -134,6 +134,7 @@ class DashboardController {
134 mail: general.email, 134 mail: general.email,
135 created: general.created_at, 135 created: general.created_at,
136 updated: general.updated_at, 136 updated: general.updated_at,
137 stringify: JSON.stringify,
137 services, 138 services,
138 workspaces, 139 workspaces,
139 }); 140 });
@@ -165,6 +166,7 @@ class DashboardController {
165 request, 166 request,
166 session, 167 session,
167 response, 168 response,
169 view,
168 }) { 170 }) {
169 const validation = await validateAll(request.all(), { 171 const validation = await validateAll(request.all(), {
170 file: 'required', 172 file: 'required',
@@ -210,7 +212,10 @@ class DashboardController {
210 } 212 }
211 } catch (e) { 213 } catch (e) {
212 const errorMessage = `Could not import your services into our system.\nError: ${e}`; 214 const errorMessage = `Could not import your services into our system.\nError: ${e}`;
213 return response.status(401).send(errorMessage); 215 return view.render('others.message', {
216 heading: 'Error while importing',
217 text: errorMessage,
218 });
214 } 219 }
215 220
216 // Import workspaces 221 // Import workspaces
@@ -234,10 +239,16 @@ class DashboardController {
234 } 239 }
235 } catch (e) { 240 } catch (e) {
236 const errorMessage = `Could not import your workspaces into our system.\nError: ${e}`; 241 const errorMessage = `Could not import your workspaces into our system.\nError: ${e}`;
237 return response.status(401).send(errorMessage); 242 return view.render('others.message', {
243 heading: 'Error while importing',
244 text: errorMessage,
245 });
238 } 246 }
239 247
240 return response.send('Your account has been imported.'); 248 return view.render('others.message', {
249 heading: 'Successfully imported',
250 text: 'Your account has been imported, you can now login as usual!',
251 });
241 } 252 }
242 253
243 logout({ 254 logout({
diff --git a/app/Controllers/Http/UserController.js b/app/Controllers/Http/UserController.js
index e580e49..e367d99 100644
--- a/app/Controllers/Http/UserController.js
+++ b/app/Controllers/Http/UserController.js
@@ -203,6 +203,7 @@ class UserController {
203 async import({ 203 async import({
204 request, 204 request,
205 response, 205 response,
206 view,
206 }) { 207 }) {
207 if (Env.get('IS_REGISTRATION_ENABLED') == 'false') { // eslint-disable-line eqeqeq 208 if (Env.get('IS_REGISTRATION_ENABLED') == 'false') { // eslint-disable-line eqeqeq
208 return response.status(401).send({ 209 return response.status(401).send({
@@ -227,7 +228,10 @@ class UserController {
227 errorMessage += `${message.message}\n`; 228 errorMessage += `${message.message}\n`;
228 } 229 }
229 } 230 }
230 return response.status(401).send(errorMessage); 231 return view.render('others.message', {
232 heading: 'Error while importing',
233 text: errorMessage,
234 });
231 } 235 }
232 236
233 const { 237 const {