remult 0.26.15 → 0.26.16
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/esm/server/get-remult-admin-html.js +1 -1
- package/esm/server/remult-admin.js +6 -1
- package/esm/src/remult3/Fields.js +12 -0
- package/esm/src/remult3/remult3.js +9 -17
- package/package.json +1 -1
- package/server/get-remult-admin-html.js +1 -1
- package/server/remult-admin.d.ts +8 -1
- package/server/remult-admin.js +6 -1
- package/src/remult3/Fields.js +12 -0
- package/src/remult3/relationInfoMember.d.ts +2 -2
- package/src/remult3/remult3.js +9 -17
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getRelationFieldInfo, } from '../src/remult3/relationInfoMember.js';
|
|
2
2
|
import { Filter } from '../src/filter/filter-interfaces.js';
|
|
3
3
|
import { getHtml } from './get-remult-admin-html.js';
|
|
4
|
+
import { getValueList } from '../src/remult3/RepositoryImplementation.js';
|
|
4
5
|
export default function remultAdminHtml(options) {
|
|
5
6
|
let optionsFromServer = { ...options };
|
|
6
7
|
//@ts-ignore
|
|
@@ -63,6 +64,8 @@ export function buildEntityInfo(options) {
|
|
|
63
64
|
}
|
|
64
65
|
fields.push({
|
|
65
66
|
key: x.key,
|
|
67
|
+
readOnly: x.dbReadOnly || !x.apiUpdateAllowed(),
|
|
68
|
+
values: getValueList(x),
|
|
66
69
|
valFieldKey,
|
|
67
70
|
caption: x.caption,
|
|
68
71
|
relationToOne: relation,
|
|
@@ -72,7 +75,9 @@ export function buildEntityInfo(options) {
|
|
|
72
75
|
? 'number'
|
|
73
76
|
: x.valueType === Boolean
|
|
74
77
|
? 'boolean'
|
|
75
|
-
:
|
|
78
|
+
: x.valueType === Date
|
|
79
|
+
? 'date'
|
|
80
|
+
: 'string',
|
|
76
81
|
});
|
|
77
82
|
}
|
|
78
83
|
entities.push({
|
|
@@ -98,6 +98,18 @@ export class Fields {
|
|
|
98
98
|
},
|
|
99
99
|
}, ...options);
|
|
100
100
|
}
|
|
101
|
+
// static id<entityType = any>(
|
|
102
|
+
// options?: FieldOptions<entityType, string> & { idFactory?: () => string },
|
|
103
|
+
// ): ClassFieldDecorator<entityType, string | undefined> {
|
|
104
|
+
// let buildId = options?.idFactory ?? createId
|
|
105
|
+
// return Field(() => String, {
|
|
106
|
+
// allowApiUpdate: false,
|
|
107
|
+
// defaultValue: () => buildId(),
|
|
108
|
+
// saving: (_, r) => {
|
|
109
|
+
// if (!r.value) r.value = buildId()
|
|
110
|
+
// },
|
|
111
|
+
// })
|
|
112
|
+
// }
|
|
101
113
|
/**
|
|
102
114
|
* Defines a field that can hold a value from a specified set of string literals.
|
|
103
115
|
* @param {() => readonly valueType[]} optionalValues - A function that returns an array of allowed string literals.
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export const flags = {
|
|
2
2
|
error500RetryCount: 4,
|
|
3
3
|
};
|
|
4
|
+
//p1 - add luid - it's cool for order by.
|
|
5
|
+
//p1 - replace uuid with crypto.randomUUID and allow custom fallback
|
|
6
|
+
//p1 - add nanoid
|
|
7
|
+
//p1 - add id and use luid by default, but allow changes with Fields.id.defaultIdProvider
|
|
8
|
+
//p1 - explain the benefits of changing the default provider for testing in docs.
|
|
9
|
+
//p1 - fix app custom filters example for multiple filters.
|
|
10
|
+
//p1 - add not!!!!
|
|
11
|
+
//p1 - add LifecycleEvent to documentation
|
|
4
12
|
//y1 - Talk about the case where we had one to many, without a field - just a filter - for example, event,event participants, users - and a field that shows all users that are not participants
|
|
5
13
|
//p1 - Fix hagai and starter project to latest ts
|
|
6
14
|
//y1 TODO - discuss next auth withRemult paradox - the gift that keeps on giving - it's doing something crazy there!!
|
|
@@ -37,7 +45,7 @@ const result = await repo.batch(x=>({
|
|
|
37
45
|
//p1 - return error on connection error
|
|
38
46
|
//p1 - article on displayValue including it's definition for entities that is used in relations
|
|
39
47
|
//p1 - article auth.js with express - played with it, requires type="module" and a few more configurations - https://github.com/noam-honig/express-auth
|
|
40
|
-
//p2 -fix remult admin not to load the html into memory until used
|
|
48
|
+
//p2 - fix remult admin not to load the html into memory until used
|
|
41
49
|
//y2 - currently for string fields we default for 255 in knex (which is their default) why not just use text (varchar max) - and only use exact length when one is provided?
|
|
42
50
|
//p2 - create foreign key constraints in user code - https://codesandbox.io/p/devbox/fk-validator-tdshcs
|
|
43
51
|
//p2 - admin url1 - pocketbase use /_ for the admin //{allowed?:Allowed,url?:string} also checkout the admin* as it should probably be something else and didn't work in hono
|
|
@@ -74,22 +82,6 @@ const result = await repo.batch(x=>({
|
|
|
74
82
|
Description = ""*/
|
|
75
83
|
//y2 - get backend methods to work when specifying types for date, and entities as poco's
|
|
76
84
|
//y2 - constraints (@JY)
|
|
77
|
-
/*p2 remult admin
|
|
78
|
-
- when making a change and canceling - the changed value still appears
|
|
79
|
-
- Small thing, I get SvelteKitError: Not found: /vite.svg
|
|
80
|
-
- understand the to many relation for the admin, based on the to one
|
|
81
|
-
- relation from order details to order gave a compound id info - and it is not true - same for the relation to product
|
|
82
|
-
- new row when there are relations, looks funny (see product)
|
|
83
|
-
- the + row in the bottom should extend to the full width
|
|
84
|
-
- need a way to extract the fields from the relation - for generating relation based sql
|
|
85
|
-
- allow conditional admin - like allowed
|
|
86
|
-
- remult-admin doesn't handle primary key that has compound column
|
|
87
|
-
- remult-admin didn't show a update for a table with a uniqua that is numeric
|
|
88
|
-
- for literal fields, allow selection from list
|
|
89
|
-
- for many to one fields - allow search field selection by developer
|
|
90
|
-
- for toOne relations, show the "one" row and allow its edit.
|
|
91
|
-
*/
|
|
92
|
-
//remult
|
|
93
85
|
//p1 - when a tasks table exists in a different schema - we get many errors
|
|
94
86
|
//p1 - live query with include
|
|
95
87
|
//p1 - adjust angular tutorial starter kit for latest angular (as is in tutorial)
|