@etsoo/appscript 1.2.95 → 1.2.96
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/__tests__/app/CoreApp.ts +7 -1
- package/lib/cjs/app/CoreApp.d.ts +6 -0
- package/lib/cjs/app/CoreApp.js +15 -0
- package/lib/cjs/app/IApp.d.ts +6 -0
- package/lib/mjs/app/CoreApp.d.ts +6 -0
- package/lib/mjs/app/CoreApp.js +15 -0
- package/lib/mjs/app/IApp.d.ts +6 -0
- package/package.json +1 -1
- package/src/app/CoreApp.ts +18 -0
- package/src/app/IApp.ts +7 -0
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -71,7 +71,7 @@ class CoreAppTest extends CoreApp<
|
|
|
71
71
|
/**
|
|
72
72
|
* App root url
|
|
73
73
|
*/
|
|
74
|
-
homepage: '',
|
|
74
|
+
homepage: '/cms',
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Web url of the cloud
|
|
@@ -125,6 +125,12 @@ class CoreAppTest extends CoreApp<
|
|
|
125
125
|
|
|
126
126
|
const app = new CoreAppTest();
|
|
127
127
|
|
|
128
|
+
test('Tests for addRootUrl', () => {
|
|
129
|
+
expect(app.addRootUrl('/home')).toBe('/cms/home');
|
|
130
|
+
expect(app.addRootUrl('./home')).toBe('/cms/./home');
|
|
131
|
+
expect(app.addRootUrl('home')).toBe('/cms/home');
|
|
132
|
+
});
|
|
133
|
+
|
|
128
134
|
test('Tests for encrypt / decrypt', () => {
|
|
129
135
|
// Arrange
|
|
130
136
|
const input = 'Hello, world!';
|
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -141,6 +141,12 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
141
141
|
* @returns Result
|
|
142
142
|
*/
|
|
143
143
|
protected addIdentifier(field: string): string;
|
|
144
|
+
/**
|
|
145
|
+
* Add root (homepage) to the URL
|
|
146
|
+
* @param url URL to add
|
|
147
|
+
* @returns Result
|
|
148
|
+
*/
|
|
149
|
+
addRootUrl(url: string): string;
|
|
144
150
|
/**
|
|
145
151
|
* Restore settings from persisted source
|
|
146
152
|
*/
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -149,6 +149,21 @@ class CoreApp {
|
|
|
149
149
|
addIdentifier(field) {
|
|
150
150
|
return field + '-' + this.name;
|
|
151
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Add root (homepage) to the URL
|
|
154
|
+
* @param url URL to add
|
|
155
|
+
* @returns Result
|
|
156
|
+
*/
|
|
157
|
+
addRootUrl(url) {
|
|
158
|
+
const page = this.settings.homepage;
|
|
159
|
+
const endSlash = page.endsWith('/');
|
|
160
|
+
return (page +
|
|
161
|
+
(endSlash
|
|
162
|
+
? shared_1.Utils.trimStart(url, '/')
|
|
163
|
+
: url.startsWith('/')
|
|
164
|
+
? url
|
|
165
|
+
: '/' + url));
|
|
166
|
+
}
|
|
152
167
|
/**
|
|
153
168
|
* Restore settings from persisted source
|
|
154
169
|
*/
|
package/lib/cjs/app/IApp.d.ts
CHANGED
|
@@ -129,6 +129,12 @@ export interface IApp {
|
|
|
129
129
|
* Is screen size up 'md'
|
|
130
130
|
*/
|
|
131
131
|
mdUp?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Add root (homepage) to the URL
|
|
134
|
+
* @param url URL to add
|
|
135
|
+
* @returns Result
|
|
136
|
+
*/
|
|
137
|
+
addRootUrl(url: string): string;
|
|
132
138
|
/**
|
|
133
139
|
* Alert action result
|
|
134
140
|
* @param result Action result
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -141,6 +141,12 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
141
141
|
* @returns Result
|
|
142
142
|
*/
|
|
143
143
|
protected addIdentifier(field: string): string;
|
|
144
|
+
/**
|
|
145
|
+
* Add root (homepage) to the URL
|
|
146
|
+
* @param url URL to add
|
|
147
|
+
* @returns Result
|
|
148
|
+
*/
|
|
149
|
+
addRootUrl(url: string): string;
|
|
144
150
|
/**
|
|
145
151
|
* Restore settings from persisted source
|
|
146
152
|
*/
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -146,6 +146,21 @@ export class CoreApp {
|
|
|
146
146
|
addIdentifier(field) {
|
|
147
147
|
return field + '-' + this.name;
|
|
148
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Add root (homepage) to the URL
|
|
151
|
+
* @param url URL to add
|
|
152
|
+
* @returns Result
|
|
153
|
+
*/
|
|
154
|
+
addRootUrl(url) {
|
|
155
|
+
const page = this.settings.homepage;
|
|
156
|
+
const endSlash = page.endsWith('/');
|
|
157
|
+
return (page +
|
|
158
|
+
(endSlash
|
|
159
|
+
? Utils.trimStart(url, '/')
|
|
160
|
+
: url.startsWith('/')
|
|
161
|
+
? url
|
|
162
|
+
: '/' + url));
|
|
163
|
+
}
|
|
149
164
|
/**
|
|
150
165
|
* Restore settings from persisted source
|
|
151
166
|
*/
|
package/lib/mjs/app/IApp.d.ts
CHANGED
|
@@ -129,6 +129,12 @@ export interface IApp {
|
|
|
129
129
|
* Is screen size up 'md'
|
|
130
130
|
*/
|
|
131
131
|
mdUp?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Add root (homepage) to the URL
|
|
134
|
+
* @param url URL to add
|
|
135
|
+
* @returns Result
|
|
136
|
+
*/
|
|
137
|
+
addRootUrl(url: string): string;
|
|
132
138
|
/**
|
|
133
139
|
* Alert action result
|
|
134
140
|
* @param result Action result
|
package/package.json
CHANGED
package/src/app/CoreApp.ts
CHANGED
|
@@ -303,6 +303,24 @@ export abstract class CoreApp<
|
|
|
303
303
|
return field + '-' + this.name;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Add root (homepage) to the URL
|
|
308
|
+
* @param url URL to add
|
|
309
|
+
* @returns Result
|
|
310
|
+
*/
|
|
311
|
+
addRootUrl(url: string) {
|
|
312
|
+
const page = this.settings.homepage;
|
|
313
|
+
const endSlash = page.endsWith('/');
|
|
314
|
+
return (
|
|
315
|
+
page +
|
|
316
|
+
(endSlash
|
|
317
|
+
? Utils.trimStart(url, '/')
|
|
318
|
+
: url.startsWith('/')
|
|
319
|
+
? url
|
|
320
|
+
: '/' + url)
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
|
|
306
324
|
/**
|
|
307
325
|
* Restore settings from persisted source
|
|
308
326
|
*/
|
package/src/app/IApp.ts
CHANGED
|
@@ -170,6 +170,13 @@ export interface IApp {
|
|
|
170
170
|
*/
|
|
171
171
|
mdUp?: boolean;
|
|
172
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Add root (homepage) to the URL
|
|
175
|
+
* @param url URL to add
|
|
176
|
+
* @returns Result
|
|
177
|
+
*/
|
|
178
|
+
addRootUrl(url: string): string;
|
|
179
|
+
|
|
173
180
|
/**
|
|
174
181
|
* Alert action result
|
|
175
182
|
* @param result Action result
|