5htp-core 0.3.6-5 → 0.3.6-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp-core",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.3.6-5",
4
+ "version": "0.3.6-7",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  // Layout
13
13
  position: relative;
14
14
  gap: @spacing;
15
- min-width: fit-content; // Fit content, even when flexbox parent width < content width
15
+ min-width: 0/*fit-content*/; // Fit content, even when flexbox parent width < content width
16
16
 
17
17
  // Dimensions
18
18
  font-size: 1em;
@@ -63,12 +63,16 @@
63
63
 
64
64
  > .label {
65
65
  text-align: left;
66
- white-space: nowrap; // Autrement, si plusieurs mots, affiché sur plusieurs ligne
67
66
  gap: @spacing / 2;
68
67
  font-size: 1rem;
69
68
  line-height: 1.5em;
70
69
  z-index: 1; // Make the label on top of ::before for example
71
70
 
71
+ // Handle overflow
72
+ white-space: nowrap;
73
+ text-overflow: ellipsis;
74
+ overflow: hidden;
75
+
72
76
  li > & {
73
77
  flex: 1;
74
78
  }
@@ -1,3 +1,9 @@
1
+ .table {
2
+ &.card {
3
+ padding: 1em 0;
4
+ }
5
+ }
6
+
1
7
  table {
2
8
 
3
9
  width: 100%;
@@ -274,7 +274,11 @@ export default class ClientRouter<
274
274
  return route;
275
275
  }
276
276
 
277
- public error(code: number, options: TRoute["options"], renderer: TFrontRenderer<{}, { message: string }>) {
277
+ public error(
278
+ code: number,
279
+ options: Partial<TRoute["options"]>,
280
+ renderer: TFrontRenderer<{}, { message: string }>
281
+ ) {
278
282
 
279
283
  // Automatic layout form the nearest _layout folder
280
284
  const layout = getLayout('Error ' + code, options);
@@ -136,7 +136,10 @@ export default abstract class UsersManagementService<
136
136
  const user = await this.decodeSession(session, req);
137
137
  this.config.debug && console.log(LogPrefix, `Deserialized user ${sessionName}:`, this.displayName(user));
138
138
 
139
- return user;
139
+ return {
140
+ ...user,
141
+ _token: token
142
+ };
140
143
  }
141
144
 
142
145
  public unauthorized( req: THttpRequest ) {
@@ -1,37 +0,0 @@
1
- /*----------------------------------
2
- - DEPENDANCES
3
- ----------------------------------*/
4
-
5
- // Npm
6
- import React from 'react';
7
-
8
- // Core
9
- import { Router } from '@app';
10
- import { Button } from '@client/components';
11
-
12
- // App
13
- import useHeader from '@client/pages/useHeader';
14
-
15
- /*----------------------------------
16
- - CONTROLEUR
17
- ----------------------------------*/
18
- Router.error( 400, ({ message, modal }) => {
19
-
20
- useHeader({
21
- title: 'Bad request',
22
- subtitle: message
23
- });
24
-
25
- return (
26
- <div class="card w-3-4 col al-center pd-2">
27
-
28
- <i src="times-circle" class="fg error xxl" />
29
-
30
- <h1>Bad Request</h1>
31
-
32
- <p>{message}</p>
33
-
34
- <Button type="primary" link="/">Go Home</Button>
35
- </div>
36
- )
37
- });
@@ -1,49 +0,0 @@
1
- /*----------------------------------
2
- - DEPENDANCES
3
- ----------------------------------*/
4
-
5
- // Npm
6
- import React from 'react';
7
-
8
- // Core
9
- import { Router } from '@app';
10
- import { Button } from '@client/components';
11
-
12
- // App
13
- import useHeader from '@client/pages/useHeader';
14
-
15
- /*----------------------------------
16
- - RESSOURCES
17
- ----------------------------------*/
18
-
19
- /*----------------------------------
20
- - CONTROLEUR
21
- ----------------------------------*/
22
- Router.error( 401, ({ message, request, page }) => {
23
-
24
- request.response?.redirect('https://becrosspath.com');
25
-
26
- useHeader({
27
- title: 'Authentication Required',
28
- subtitle: message
29
- });
30
-
31
- React.useEffect(() => {
32
-
33
- page?.go('/');
34
-
35
- }, []);
36
-
37
- return (
38
- <div class="card w-3-4 col al-center pd-2">
39
-
40
- <i src="times-circle" class="fg error xxl" />
41
-
42
- <h1>Authentication Required</h1>
43
-
44
- <p>{message}</p>
45
-
46
- <Button type="primary" link="/">Go Home</Button>
47
- </div>
48
- )
49
- });
@@ -1,37 +0,0 @@
1
- /*----------------------------------
2
- - DEPENDANCES
3
- ----------------------------------*/
4
-
5
- // Npm
6
- import React from 'react';
7
-
8
- // Core
9
- import { Router } from '@app';
10
- import { Button } from '@client/components';
11
-
12
- // App
13
- import useHeader from '@client/pages/useHeader';
14
-
15
- /*----------------------------------
16
- - CONTROLEUR
17
- ----------------------------------*/
18
- Router.error( 403, ({ message, modal }) => {
19
-
20
- useHeader({
21
- title: 'Access Denied.',
22
- subtitle: message
23
- });
24
-
25
- return (
26
- <div class="card w-3-4 col al-center pd-2">
27
-
28
- <i src="times-circle" class="fg error xxl" />
29
-
30
- <h1>Access Denied.</h1>
31
-
32
- <p>{message}</p>
33
-
34
- <Button type="primary" link="/">Go Home</Button>
35
- </div>
36
- )
37
- });
@@ -1,37 +0,0 @@
1
- /*----------------------------------
2
- - DEPENDANCES
3
- ----------------------------------*/
4
-
5
- // Npm
6
- import React from 'react';
7
-
8
- // Core
9
- import { Router } from '@app';
10
- import { Button } from '@client/components';
11
-
12
- // App
13
- import useHeader from '@client/pages/useHeader';
14
-
15
- /*----------------------------------
16
- - CONTROLEUR
17
- ----------------------------------*/
18
- Router.error( 404, ({ message, modal }) => {
19
-
20
- useHeader({
21
- title: 'Page Not Found',
22
- subtitle: message
23
- });
24
-
25
- return (
26
- <div class="card w-3-4 col al-center pd-2">
27
-
28
- <i src="times-circle" class="fg error xxl" />
29
-
30
- <h1>Page Not Found</h1>
31
-
32
- <p>{message}</p>
33
-
34
- <Button type="primary" link="/">Go Home</Button>
35
- </div>
36
- )
37
- });
@@ -1,37 +0,0 @@
1
- /*----------------------------------
2
- - DEPENDANCES
3
- ----------------------------------*/
4
-
5
- // Npm
6
- import React from 'react';
7
-
8
- // Core
9
- import { Router } from '@app';
10
- import { Button } from '@client/components';
11
-
12
- // App
13
- import useHeader from '@client/pages/useHeader';
14
-
15
- /*----------------------------------
16
- - CONTROLEUR
17
- ----------------------------------*/
18
- Router.error( 500, ({ message }) => {
19
-
20
- useHeader({
21
- title: 'Technical Error',
22
- subtitle: message
23
- });
24
-
25
- return (
26
- <div class="card w-3-4 col al-center pd-2">
27
-
28
- <i src="times-circle" class="fg error xxl" />
29
-
30
- <h1>Technical Error</h1>
31
-
32
- <p>{message}</p>
33
-
34
- <Button type="primary" link="/">Go Home</Button>
35
- </div>
36
- )
37
- });