forms-angular 0.12.0-beta.32 → 0.12.0-beta.321
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/dist/client/forms-angular-bs-common.less +193 -2
- package/dist/client/forms-angular-bs2-specific.less +1 -1
- package/dist/client/forms-angular-bs3-specific.less +1 -1
- package/dist/client/forms-angular-with-bs2.css +2 -2
- package/dist/client/forms-angular-with-bs3.css +1 -1
- package/dist/client/forms-angular.js +2935 -1059
- package/dist/client/forms-angular.min.js +1 -1
- package/dist/client/index.d.ts +520 -117
- package/dist/server/data_form.js +1988 -933
- package/dist/server/index.d.ts +136 -0
- package/package.json +171 -52
- package/CHANGELOG.md +0 -256
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Error, FilterQuery, Model, Types } from "mongoose";
|
|
2
|
+
import {Express} from "express";
|
|
3
|
+
|
|
4
|
+
declare module fngServer {
|
|
5
|
+
export interface ISearchResult {
|
|
6
|
+
id: any,
|
|
7
|
+
text: string,
|
|
8
|
+
url?: string,
|
|
9
|
+
additional?: string,
|
|
10
|
+
resource?: string,
|
|
11
|
+
resourceText: string,
|
|
12
|
+
resourceTab?: string,
|
|
13
|
+
weighting: number,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface IInternalSearchResult extends ISearchResult {
|
|
17
|
+
// for use in internal find - handles search result ordering etc.
|
|
18
|
+
searchImportance? : number;
|
|
19
|
+
addHits?: number;
|
|
20
|
+
matched: number[];
|
|
21
|
+
resourceCollection: string;
|
|
22
|
+
// the next two are only set where the resource options includes disambiguation instructions and multiple search results with the same text value are found...:
|
|
23
|
+
disambiguationId?: any; // this will identify the record (from another resource) that will be used to disambiguate them
|
|
24
|
+
disambiguationResource?: string ;// ...and this will identify that resource
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface IIdIsList {
|
|
28
|
+
params: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface Path {
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Paths {
|
|
35
|
+
[pathName: string]: Path;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type ISearchResultFormatter = () => Promise<ISearchResult>;
|
|
39
|
+
|
|
40
|
+
export type Dependency = {
|
|
41
|
+
resource: Resource;
|
|
42
|
+
keys: string[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type DependencyList = Dependency[];
|
|
46
|
+
|
|
47
|
+
export type ForeignKeys = { resourceName: string, key: string, id: Types.ObjectId};
|
|
48
|
+
export type ForeignKeyList = ForeignKeys[];
|
|
49
|
+
|
|
50
|
+
export interface ResourceOptions {
|
|
51
|
+
suppressDeprecatedMessage?: boolean;
|
|
52
|
+
onRemove?: (doc, req, cb) => void;
|
|
53
|
+
handleRemove?: 'allow' | 'cascade'; // default behaviour is to prevent deletion if record is used as a foreign key
|
|
54
|
+
searchImportance?: boolean | number,
|
|
55
|
+
onSave?: (doc, req, cb) => void,
|
|
56
|
+
onSaveError?: (err:Error, req: Express.Request, res: Express.Response) => void,
|
|
57
|
+
findFunc?: (req: Express.Request, cb: (err:Error, criteria?: FilterQuery<any>) => void) => void,
|
|
58
|
+
getOrgCriteria?: (userOrganisation: string) => Promise<any>
|
|
59
|
+
idIsList?: IIdIsList,
|
|
60
|
+
searchResultFormat?: ISearchResultFormatter,
|
|
61
|
+
searchOrder?: any,
|
|
62
|
+
doNotCacheSchema?: boolean, // useful if bespoke fields can be added at runtime, for instance
|
|
63
|
+
listOrder?: any,
|
|
64
|
+
onAccess?: (req, cb) => void,
|
|
65
|
+
searchFunc?: SearchFunc;
|
|
66
|
+
synonyms? : {name: string, filter?: any}[], // name must be lower case
|
|
67
|
+
resourceName?: string, // allows a resource to have diference modelName specified
|
|
68
|
+
// when performing a search, two results from this resource with the same value for .text will be disambiguated by
|
|
69
|
+
// appending the description of the record from disambiguation.resource whose id matches result[disambiguation.field]
|
|
70
|
+
disambiguation?: {
|
|
71
|
+
field: string;
|
|
72
|
+
resource: string;
|
|
73
|
+
}
|
|
74
|
+
// below here are autogenerated
|
|
75
|
+
listFields?: ListField[]; // added after preprocess
|
|
76
|
+
dependents?: DependencyList; // can be added by generateDependencyList
|
|
77
|
+
hide? : string[]; // added after preprocess
|
|
78
|
+
searchFields? : string[]; // added after preprocess
|
|
79
|
+
paths?: Paths;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
type SearchFunc = (resource: Resource,
|
|
83
|
+
req: Express.Request,
|
|
84
|
+
aggregationParam: any,
|
|
85
|
+
findParam: any,
|
|
86
|
+
sortOrder: any,
|
|
87
|
+
limit: number | null,
|
|
88
|
+
skip: number | null,
|
|
89
|
+
callback: (err: Error, docs?: any[]) => void
|
|
90
|
+
) => void;
|
|
91
|
+
|
|
92
|
+
interface ResourceExport {
|
|
93
|
+
model?: Model<any>; // TODO TS Get rid of the ? here
|
|
94
|
+
options?: ResourceOptions;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface Resource extends ResourceExport {
|
|
98
|
+
resourceName: string;
|
|
99
|
+
resourceNameLower: string;
|
|
100
|
+
preprocessed?: {[formName: string] : any};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
interface ListParams {
|
|
104
|
+
ref: Boolean; // The object is this a lookup?
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
interface ListField {
|
|
108
|
+
field: string;
|
|
109
|
+
params?: ListParams;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
interface IFngPlugin {
|
|
113
|
+
plugin: (fng: any, processArgs: (options: FngOptions, array: any[]) => any[], options: any) => Partial<IFngPlugin>;
|
|
114
|
+
options: any;
|
|
115
|
+
dependencyChecks? : { [resourceName: string] : DependencyList; };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
interface IPluginMap {
|
|
119
|
+
[key: string]: IFngPlugin;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
interface FngOptions {
|
|
123
|
+
urlPrefix?: string,
|
|
124
|
+
plugins?: IPluginMap,
|
|
125
|
+
authentication?: (() => void)[];
|
|
126
|
+
modelFilter? : (p1: any, req: Request, resources: Resource[]) => Resource[]
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
type AmbiguousRecordStore<t> = { [resource: string]: t[] };
|
|
130
|
+
|
|
131
|
+
interface DisambiguatableLookupItem {
|
|
132
|
+
id: string;
|
|
133
|
+
text: string;
|
|
134
|
+
disambiguationId?: string;
|
|
135
|
+
}
|
|
136
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forms-angular",
|
|
3
|
-
"author":
|
|
3
|
+
"author": {
|
|
4
|
+
"name": "Mark Chapman",
|
|
5
|
+
"email": "support@forms-angular.org"
|
|
6
|
+
},
|
|
4
7
|
"description": "A form builder that sits on top of Angular.js, Twitter Bootstrap, jQuery UI, Angular-UI, Express and Mongoose. Opinionated or what?",
|
|
5
8
|
"homepage": "http://forms-angular.org",
|
|
6
|
-
"version": "0.12.0-beta.
|
|
9
|
+
"version": "0.12.0-beta.321",
|
|
10
|
+
"packageManager": "npm@10.2.4",
|
|
7
11
|
"engines": {
|
|
8
12
|
"node": ">=8.x",
|
|
9
13
|
"npm": ">=5.x"
|
|
@@ -12,10 +16,10 @@
|
|
|
12
16
|
"build": "If this is not a production install we need bootstrap less files for building, and use bower to load them. Couldn't figure out how to load two versions of same library with npm - PRs welcome."
|
|
13
17
|
},
|
|
14
18
|
"scripts": {
|
|
15
|
-
"pretest": "npm run build",
|
|
16
19
|
"test": "gulp test",
|
|
17
20
|
"tidy": "find . -name '*.js' -not -path '**/node_modules/**' -and -not -path '**/website/**' -and -not -path '**/test/**' -and -not -path '**/models/**' -and -not -name 'gulpfile.js' -and -not -name 'index.js' -and -not -name 'Gruntfile.js' -and -not -name '*.conf.js' -delete && find . -name '*.map' -not -path '**/node_modules/**' -delete",
|
|
18
|
-
"build": "if [ -d 'node_modules/bower' ]; then bower install --config.directory=node_modules --production jquery@2.0.3 bootstrap-2-3-2=git://github.com/twbs/bootstrap.git#v2.3.2 bootstrap-3-4-0=git://github.com/twbs/bootstrap.git#v3.4.0; fi && gulp build"
|
|
21
|
+
"build": "if [ -d 'node_modules/bower' ]; then npx bower install --config.directory=node_modules --production jquery@2.0.3 bootstrap-2-3-2=git://github.com/twbs/bootstrap.git#v2.3.2 bootstrap-3-4-0=git://github.com/twbs/bootstrap.git#v3.4.0; fi && gulp build",
|
|
22
|
+
"reset": "cd website && rm -rf node_modules && npm install && cd .. && rm -rf node_modules && npm install && npm run build"
|
|
19
23
|
},
|
|
20
24
|
"files": [
|
|
21
25
|
"dist"
|
|
@@ -24,7 +28,7 @@
|
|
|
24
28
|
"browser": "dist/client/index.js",
|
|
25
29
|
"repository": {
|
|
26
30
|
"type": "git",
|
|
27
|
-
"url": "git://github.com/forms-angular/forms-angular"
|
|
31
|
+
"url": "git://github.com/forms-angular/forms-angular.git"
|
|
28
32
|
},
|
|
29
33
|
"bugs": {
|
|
30
34
|
"url": "https://github.com/forms-angular/forms-angular/issues",
|
|
@@ -42,58 +46,173 @@
|
|
|
42
46
|
"RESTful API"
|
|
43
47
|
],
|
|
44
48
|
"dependencies": {
|
|
45
|
-
"angular": "1.
|
|
46
|
-
"angular-elastic": "2.5.1",
|
|
47
|
-
"angular-messages": "1.
|
|
48
|
-
"angular-sanitize": "1.
|
|
49
|
+
"angular": "^1.8.3",
|
|
50
|
+
"angular-elastic": "^2.5.1",
|
|
51
|
+
"angular-messages": "^1.8.3",
|
|
52
|
+
"angular-sanitize": "^1.8.3",
|
|
49
53
|
"angular-ui-bootstrap": "1.3.2 || 2.5.6",
|
|
50
|
-
"angular-ui-grid": "^4.7
|
|
51
|
-
"async": "2.
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
"angular-ui-grid": "^4.12.7",
|
|
55
|
+
"async": "^3.2.5",
|
|
56
|
+
"lodash": "^4.17.21",
|
|
57
|
+
"ng-infinite-scroll": "^1.3.0",
|
|
58
|
+
"node.extend": "^2.0.3"
|
|
59
|
+
},
|
|
60
|
+
"npmAuditMitigations": {
|
|
61
|
+
"angular": [
|
|
62
|
+
{
|
|
63
|
+
"https://github.com/advisories/GHSA-m2h2-264f-f486": {
|
|
64
|
+
"description": "angular vulnerable to regular expression denial of service (ReDoS)",
|
|
65
|
+
"mitigation": "Can't see an exploit in Plait. Can port fix from https://github.com/continu/angular.js/commit/77b7b0c3f02ebed1c7565dc4a63abc6d96065afa"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"https://github.com/advisories/GHSA-prc3-vjfx-vhm9": {
|
|
70
|
+
"description": "Angular (deprecated package) Cross-site Scripting",
|
|
71
|
+
"mitigation": "Only applies to IE which is obsolete"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"https://github.com/advisories/GHSA-j58c-ww9w-pwp5": {
|
|
76
|
+
"description": "AngularJS improperly sanitizes SVG elements",
|
|
77
|
+
"mitigation": "See angular-sanitize https://github.com/advisories/GHSA-4p4w-6hg8-63wx"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"https://github.com/advisories/GHSA-4w4v-5hc9-xrr2": {
|
|
82
|
+
"description": "angular vulnerable to super-linear runtime due to backtracking",
|
|
83
|
+
"mitigation": "We do not make any use of ng-srcset",
|
|
84
|
+
"nextReview": "2026-01-01T00:00:00Z",
|
|
85
|
+
"reviewBy": "Search plait and forms-angular looking for srcset"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"https://github.com/advisories/GHSA-m9gf-397r-hwpg": {
|
|
90
|
+
"description": "AngularJS allows attackers to bypass common image source restrictions",
|
|
91
|
+
"mitigation": "Duplicate of https://github.com/advisories/GHSA-4w4v-5hc9-xrr2"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"https://github.com/advisories/GHSA-mqm9-c95h-x2p6": {
|
|
96
|
+
"description": "AngularJS allows attackers to bypass common image source restrictions",
|
|
97
|
+
"mitigation": "Another duplicate of https://github.com/advisories/GHSA-4w4v-5hc9-xrr2"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"https://github.com/advisories/GHSA-2vrf-hf26-jrp5": {
|
|
102
|
+
"description": "angular vulnerable to regular expression denial of service via the angular.copy() utility",
|
|
103
|
+
"mitigation": "Should not be a problem as we restrict access behind a login."
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"https://github.com/advisories/GHSA-2qqx-w9hr-q5gx": {
|
|
108
|
+
"description": "angular vulnerable to regular expression denial of service via the $resource service",
|
|
109
|
+
"mitigation": "Should not be a problem as we restrict access behind a login."
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"https://github.com/advisories/GHSA-qwqh-hm9m-p5hr": {
|
|
114
|
+
"description": "angular vulnerable to regular expression denial of service via the <input type='url'> element",
|
|
115
|
+
"mitigation": "Should not be a problem as we restrict access behind a login."
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"angular-sanitize": [
|
|
120
|
+
{
|
|
121
|
+
"https://github.com/advisories/GHSA-4p4w-6hg8-63wx": {
|
|
122
|
+
"description": "Lack of sanitization for SVG images",
|
|
123
|
+
"mitigation": "Danger of a bad actor introducing large SVG through sigs or similar, but as we son't sanitize any image types (as it would limit use of the system) this is no additional problem for us"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
]
|
|
57
127
|
},
|
|
58
128
|
"peerDependencies": {
|
|
59
|
-
"express": "^4
|
|
60
|
-
"mongoose": "^
|
|
129
|
+
"express": "^4",
|
|
130
|
+
"mongoose": "^7.3.3 || ^8"
|
|
61
131
|
},
|
|
62
132
|
"devDependencies": {
|
|
63
|
-
"@types/angular": "1.
|
|
64
|
-
"@types/lodash": "4.
|
|
65
|
-
"@types/
|
|
66
|
-
"@types/node": "
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"gulp
|
|
75
|
-
"gulp-
|
|
76
|
-
"gulp-
|
|
77
|
-
"gulp-
|
|
78
|
-
"gulp-
|
|
79
|
-
"gulp-
|
|
80
|
-
"gulp-
|
|
81
|
-
"gulp-
|
|
82
|
-
"gulp-
|
|
83
|
-
"gulp-
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"karma
|
|
88
|
-
"karma-
|
|
89
|
-
"karma-
|
|
90
|
-
"karma-
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
133
|
+
"@types/angular": "^1.8.9",
|
|
134
|
+
"@types/lodash": "^4.17.5",
|
|
135
|
+
"@types/mocha": "^10.0.7",
|
|
136
|
+
"@types/node": "=20.0.0",
|
|
137
|
+
"@types/vinyl": "^2.0.12",
|
|
138
|
+
"angular-mocks": "^1.8.3",
|
|
139
|
+
"body-parser": "^1.20.2",
|
|
140
|
+
"bower": "^1.8.14",
|
|
141
|
+
"commander": "^14.0.2",
|
|
142
|
+
"del": "=6.1.1",
|
|
143
|
+
"express": "^4.19.2",
|
|
144
|
+
"gulp": "^4.0.2",
|
|
145
|
+
"gulp-angular-templatecache": "^3.0.1",
|
|
146
|
+
"gulp-clean-css": "^4.3.0",
|
|
147
|
+
"gulp-concat": "^2.6.1",
|
|
148
|
+
"gulp-less": "^5.0.0",
|
|
149
|
+
"gulp-mocha": "=9.0.0",
|
|
150
|
+
"gulp-ng-annotate": "^2.1.0",
|
|
151
|
+
"gulp-rename": "^2.0.0",
|
|
152
|
+
"gulp-replace": "^1.1.4",
|
|
153
|
+
"gulp-typescript": "6.0.0-alpha.1",
|
|
154
|
+
"gulp-uglify": "^3.0.2",
|
|
155
|
+
"gulp-umd": "^2.0.0",
|
|
156
|
+
"jasmine-core": "^5.1.2",
|
|
157
|
+
"karma": "^6.4.3",
|
|
158
|
+
"karma-chrome-launcher": "^3.2.0",
|
|
159
|
+
"karma-firefox-launcher": "^2.1.3",
|
|
160
|
+
"karma-jasmine": "^5.1.0",
|
|
161
|
+
"karma-junit-reporter": "^2.0.1",
|
|
162
|
+
"karma-ng-html2js-preprocessor": "^1.0.0",
|
|
163
|
+
"matchdep": "^2.0.0",
|
|
164
|
+
"mocha": "^10.4.0",
|
|
165
|
+
"mongodb": "=5.9.1",
|
|
166
|
+
"mongoose": "=7.6.8",
|
|
167
|
+
"prettier": "^3.3.2",
|
|
168
|
+
"pump": "^3.0.0",
|
|
169
|
+
"typescript": "=4.9.5"
|
|
170
|
+
},
|
|
171
|
+
"overrides": {
|
|
172
|
+
"aggregate-error": "npm:@socketregistry/aggregate-error@^1",
|
|
173
|
+
"array-flatten": "npm:@socketregistry/array-flatten@^1",
|
|
174
|
+
"define-properties": "npm:@socketregistry/define-properties@^1",
|
|
175
|
+
"es6-symbol": "npm:@socketregistry/es6-symbol@^1",
|
|
176
|
+
"function-bind": "npm:@socketregistry/function-bind@^1",
|
|
177
|
+
"has": "npm:@socketregistry/has@^1",
|
|
178
|
+
"has-symbols": "npm:@socketregistry/has-symbols@^1",
|
|
179
|
+
"hasown": "npm:@socketregistry/hasown@^1",
|
|
180
|
+
"indent-string": "npm:@socketregistry/indent-string@^1",
|
|
181
|
+
"is-core-module": "npm:@socketregistry/is-core-module@^1",
|
|
182
|
+
"is-unicode-supported": "npm:@socketregistry/is-unicode-supported@^1",
|
|
183
|
+
"isarray": "npm:@socketregistry/isarray@^1",
|
|
184
|
+
"number-is-nan": "npm:@socketregistry/number-is-nan@^1",
|
|
185
|
+
"object-assign": "npm:@socketregistry/object-assign@^1",
|
|
186
|
+
"object-keys": "npm:@socketregistry/object-keys@^1",
|
|
187
|
+
"object.assign": "npm:@socketregistry/object.assign@^1",
|
|
188
|
+
"path-parse": "npm:@socketregistry/path-parse@^1",
|
|
189
|
+
"safe-buffer": "npm:@socketregistry/safe-buffer@^1",
|
|
190
|
+
"safer-buffer": "npm:@socketregistry/safer-buffer@^1",
|
|
191
|
+
"side-channel": "npm:@socketregistry/side-channel@^1",
|
|
192
|
+
"typedarray": "npm:@socketregistry/typedarray@^1"
|
|
193
|
+
},
|
|
194
|
+
"resolutions": {
|
|
195
|
+
"aggregate-error": "npm:@socketregistry/aggregate-error@^1",
|
|
196
|
+
"array-flatten": "npm:@socketregistry/array-flatten@^1",
|
|
197
|
+
"define-properties": "npm:@socketregistry/define-properties@^1",
|
|
198
|
+
"es6-symbol": "npm:@socketregistry/es6-symbol@^1",
|
|
199
|
+
"function-bind": "npm:@socketregistry/function-bind@^1",
|
|
200
|
+
"has": "npm:@socketregistry/has@^1",
|
|
201
|
+
"has-symbols": "npm:@socketregistry/has-symbols@^1",
|
|
202
|
+
"hasown": "npm:@socketregistry/hasown@^1",
|
|
203
|
+
"indent-string": "npm:@socketregistry/indent-string@^1",
|
|
204
|
+
"is-core-module": "npm:@socketregistry/is-core-module@^1",
|
|
205
|
+
"is-unicode-supported": "npm:@socketregistry/is-unicode-supported@^1",
|
|
206
|
+
"isarray": "npm:@socketregistry/isarray@^1",
|
|
207
|
+
"number-is-nan": "npm:@socketregistry/number-is-nan@^1",
|
|
208
|
+
"object-assign": "npm:@socketregistry/object-assign@^1",
|
|
209
|
+
"object-keys": "npm:@socketregistry/object-keys@^1",
|
|
210
|
+
"object.assign": "npm:@socketregistry/object.assign@^1",
|
|
211
|
+
"path-parse": "npm:@socketregistry/path-parse@^1",
|
|
212
|
+
"safe-buffer": "npm:@socketregistry/safe-buffer@^1",
|
|
213
|
+
"safer-buffer": "npm:@socketregistry/safer-buffer@^1",
|
|
214
|
+
"side-channel": "npm:@socketregistry/side-channel@^1",
|
|
215
|
+
"typedarray": "npm:@socketregistry/typedarray@^1"
|
|
97
216
|
},
|
|
98
217
|
"license": "MIT"
|
|
99
218
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
# forms-angular
|
|
2
|
-
|
|
3
|
-
## 0.12.0
|
|
4
|
-
* Added $scope.prepareForSave API which enables easier persistence from forms not under the controller of baseCtrl (forms in modal dialogs, for example).
|
|
5
|
-
* Handle date fields properly without a plugin
|
|
6
|
-
* Fix duplicate ids in _select_ elements
|
|
7
|
-
### BREAKING CHANGES
|
|
8
|
-
* Removed $data service (global stash). In almost all places $data.xx can be replaced by $scope.sharedData.xx
|
|
9
|
-
* Deprecate dataEventFunctions.onInitialiseNewRecord(data) - a synchronous function in favour of dataEventFunctions.onInitialiseNewRecord(data, cb(err))
|
|
10
|
-
|
|
11
|
-
## 0.11.0 - 8 Dec 2017
|
|
12
|
-
* Menu options can now be added after a promise is resolved by creating a contextMenuPromise on the controller $scope which resolves to a contextMenu array.
|
|
13
|
-
* Added new registerAction method on the routing service (used by the fng-audit plugin)
|
|
14
|
-
* Replaced underscore with lodash
|
|
15
|
-
* Numerous small fixes (mostly to code that interacts with plugins)
|
|
16
|
-
* Improved styling of invalid fields
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## 0.10.x
|
|
20
|
-
Skipped to keep version numbers in sync with plugins
|
|
21
|
-
|
|
22
|
-
## 0.8.x to 0.9.0
|
|
23
|
-
* Remove support for (long deprecated) [fng-select2](https://github.com/forms-angular/fng-select2) in favour of (improved)
|
|
24
|
-
[fng-ui-select](https://github.com/forms-angular/fng-ui-select).
|
|
25
|
-
* Use [Angular UI Grid](http://ui-grid.info/) instead of older [ng-grid](https://github.com/angular-ui/ui-grid/tree/2.x)
|
|
26
|
-
in [fng-reports](https://github.com/forms-angular/fng-reports).
|
|
27
|
-
|
|
28
|
-
## 0.7.0 to 0.8.1
|
|
29
|
-
* Move to Angular 1.6.x
|
|
30
|
-
* Allow adding _id to list fields
|
|
31
|
-
* Fix bug with routing to specific tab (such as /#/collection/id/edit/tab1)
|
|
32
|
-
### BREAKING CHANGES
|
|
33
|
-
* The server side of forms angular is now passed a Mongoose instance:
|
|
34
|
-
```
|
|
35
|
-
var formsAngular = require('forms-angular');
|
|
36
|
-
var express = require('express');
|
|
37
|
-
var mongoose = require('mongoose');
|
|
38
|
-
|
|
39
|
-
var app = express();
|
|
40
|
-
var fng = new (formsAngular)(mongoose, app, {});
|
|
41
|
-
```
|
|
42
|
-
* If your application calls recordHandler.handleError (typically from a controller) then you will need
|
|
43
|
-
to pass a response object rather than (data:any, status: number)
|
|
44
|
-
|
|
45
|
-
## 0.6.0 to 0.7.0
|
|
46
|
-
* Removed support for Bootstrap 2 (just in time for Bootstrap 4?)
|
|
47
|
-
* Fixed bug with ui-router setup which meant that full routes were not parsed.
|
|
48
|
-
* Added internal templates for lists, edit forms and report forms (previously they were in the Yeoman generator).
|
|
49
|
-
* Internal templates can be over-ridden by specifying a templateFolder property in the routing config.
|
|
50
|
-
### BREAKING CHANGES
|
|
51
|
-
* To use the edit / list / report templates from a pre 0.7.0 application you must specify a templateFolder property of 'partials' when starting the routingService when configuring forms-angular
|
|
52
|
-
* Removed support for Bootstrap 2 (though your BS2 apps should still work - www.forms-angular.org is still BS2)
|
|
53
|
-
* Some changes required by updating angular-ui-bootstrap dependency. In particular drop down menus now need uib-dropdown-menu to be an attribute not a class
|
|
54
|
-
|
|
55
|
-
## 0.5.1 to 0.6.0
|
|
56
|
-
* Upgrade to angular-ui-bootstrap 0.14.x, which drops support for Bootstrap 2 (but seems to work fine for the forms-angular.org website, which is BS2)
|
|
57
|
-
* Start specifying versions in npm and bower.
|
|
58
|
-
* Several small fixes
|
|
59
|
-
|
|
60
|
-
## 0.5.0 to 0.5.1
|
|
61
|
-
* Fix stupid dependency error for Angular
|
|
62
|
-
|
|
63
|
-
## 0.4 to 0.5
|
|
64
|
-
### Summary
|
|
65
|
-
* Changed development language to typescript and added _some_ types
|
|
66
|
-
* Moved to gulp for build processing
|
|
67
|
-
* Added ng-messages for field level errors
|
|
68
|
-
* Required and readonly now work consistently across input types
|
|
69
|
-
* Added error-display directive for form level errors
|
|
70
|
-
* Some styling improvements for required fields and mobile
|
|
71
|
-
* Added support for ui-select plugin, and in so doing added new services (formMarkupHelper, pluginHelper) that make it
|
|
72
|
-
much easier to add new plugins.
|
|
73
|
-
|
|
74
|
-
### BREAKING CHANGES
|
|
75
|
-
* Changed id generation to remove . characters. This may break some tests (but the . characters themselves were upsetting
|
|
76
|
-
some testing software).
|
|
77
|
-
* Removed body padding from styling. If you use a navbar you should put body {padding-top: 40px} (or required navbar height) in your styling.
|
|
78
|
-
* Hidden fields that are also list fields are still not displayed on forms, but now _are_ added to the list schema (so appear in lookups etc).
|
|
79
|
-
|
|
80
|
-
## 0.3 to 0.4
|
|
81
|
-
### Summary
|
|
82
|
-
* Split the project into multiple repos and made a yeoman generator
|
|
83
|
-
* Removes dependence on jQuery
|
|
84
|
-
* ngRoute is no longer a dependency - either ngRoute or ui.router can be used, and a new provider allows the choice to be
|
|
85
|
-
set up as follows:
|
|
86
|
-
```
|
|
87
|
-
formsAngular.config(['routingServiceProvider', function (routingService) {
|
|
88
|
-
routingService.setOptions({html5Mode: true, routing: 'ngroute'});
|
|
89
|
-
}]);
|
|
90
|
-
```
|
|
91
|
-
This service incorporates some of the functionality of the old form routes provider and supersedes urlService and
|
|
92
|
-
locationParse.
|
|
93
|
-
|
|
94
|
-
For example in 0.3.x where you had something like:
|
|
95
|
-
```
|
|
96
|
-
plaitApp.config(['formRoutesProvider', function (formRoutes) {
|
|
97
|
-
formRoutes.setRoutes([
|
|
98
|
-
{route: '/index', options: {templateUrl: 'partials/menu.html'}},
|
|
99
|
-
{route: '/login', options: {templateUrl: 'partials/login.html' }},
|
|
100
|
-
{route: '/client/referral', options: {templateUrl: 'partials/upload', controller: 'ClientReferralCtrl'}}
|
|
101
|
-
], '/index');
|
|
102
|
-
```
|
|
103
|
-
you would have something like
|
|
104
|
-
```
|
|
105
|
-
formsAngular.config(['routingServiceProvider', function (routingService) {
|
|
106
|
-
routingService.start({
|
|
107
|
-
routing: 'ngroute',
|
|
108
|
-
fixedRoutes: [
|
|
109
|
-
{route: '/index', options: {templateUrl: 'partials/menu.html'}},
|
|
110
|
-
{route: '/login', options: {templateUrl: 'partials/login.html' }},
|
|
111
|
-
{route: '/404', options: {templateUrl: 'partials/404.html'}},
|
|
112
|
-
{route: '/client/referral', options: {templateUrl: 'partials/upload', controller: 'ClientReferralCtrl'}}
|
|
113
|
-
]
|
|
114
|
-
});
|
|
115
|
-
```
|
|
116
|
-
* The ability to add a routing prefix has been added
|
|
117
|
-
|
|
118
|
-
### BREAKING CHANGES
|
|
119
|
-
* List API returns only one field when no list fields defined (as happens on the client).
|
|
120
|
-
* Hidden list fields now appear on list API response.
|
|
121
|
-
* In BaseCtrl $scope.new() and $scope.delete() have been renamed ('Click' added)
|
|
122
|
-
*
|
|
123
|
-
|
|
124
|
-
## 0.2 to 0.3
|
|
125
|
-
### Summary
|
|
126
|
-
* Improvements to routing:
|
|
127
|
-
* Module specific routes are now specified with a call to the setRoutes(appRoutes, defaultRoute) method of an injected
|
|
128
|
-
formRoutesProvider - see the breaking changes section for an example and details.
|
|
129
|
-
* Support for HTML5Mode and hashPrefix, including a service to simplify use
|
|
130
|
-
* Support for Twitter Bootstrap 3, including a service to simplify use. To use Bootstrap 3 you need to upgrade a few of the
|
|
131
|
-
libraries that Bower installs. Change the following lines in bower.json:
|
|
132
|
-
```
|
|
133
|
-
"angular-ui-bootstrap-bower": "0.8.0",
|
|
134
|
-
"bootstrap": "2.3.2",
|
|
135
|
-
"select2-bootstrap-css": "~1.2",
|
|
136
|
-
```
|
|
137
|
-
to
|
|
138
|
-
```
|
|
139
|
-
"angular-ui-bootstrap-bower": "0.11.0",
|
|
140
|
-
"bootstrap": "3.1.1",
|
|
141
|
-
"select2-bootstrap-css": "~1.3",
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
### BREAKING CHANGES
|
|
146
|
-
* Routing has changed - replace
|
|
147
|
-
```
|
|
148
|
-
myModule.config(['$routeProvider', function ($routeProvider) {
|
|
149
|
-
$routeProvider.
|
|
150
|
-
when('/index', {templateUrl: 'partials/landing-page.html'}).
|
|
151
|
-
when('/someRoute', {templateUrl: 'partials/someTemplate.html'}).
|
|
152
|
-
... etc ...
|
|
153
|
-
when('/analyse/:model/:reportSchemaName', {templateUrl: 'partials/base-analysis.html'}).
|
|
154
|
-
when('/analyse/:model', {templateUrl: 'partials/base-analysis.html'}).
|
|
155
|
-
when('/:model/:id/edit', {templateUrl: 'partials/base-edit.html'}).
|
|
156
|
-
when('/:model/new', {templateUrl: 'partials/base-edit.html'}).
|
|
157
|
-
when('/:model', {templateUrl: 'partials/base-list.html'}).
|
|
158
|
-
when('/:model/:form/:id/edit', {templateUrl: 'partials/base-edit.html'}). // non default form (different fields etc)
|
|
159
|
-
when('/:model/:form/new', {templateUrl: 'partials/base-edit.html'}). // non default form (different fields etc)
|
|
160
|
-
when('/:model/:form', {templateUrl: 'partials/base-list.html'}). // list page with links to non default form
|
|
161
|
-
otherwise({redirectTo: '/index'});
|
|
162
|
-
}]);
|
|
163
|
-
```
|
|
164
|
-
with
|
|
165
|
-
```
|
|
166
|
-
myModule.config(['formRoutesProvider', function (formRoutes) {
|
|
167
|
-
formRoutes.setRoutes([
|
|
168
|
-
{route:'/index', options:{templateUrl: 'partials/landing-page.html'}},
|
|
169
|
-
{route:'/someRoute', options:{templateUrl: 'partials/someTemplate.html'}}
|
|
170
|
-
], '/index');
|
|
171
|
-
}]);
|
|
172
|
-
```
|
|
173
|
-
where the first parameter is an array of objects containing a route and a set of options (which are passed straight to
|
|
174
|
-
[$routeProvider](http://docs.angularjs.org/api/ngRoute/provider/$routeProvider) and the second parameter is the default route.
|
|
175
|
-
* Stylesheets have moved down into a ./css folder relative to where they were, and there
|
|
176
|
-
are now Bootstrap 2 and Bootstrap 3 versions.
|
|
177
|
-
* You should initialise formsAngular with something similar to:
|
|
178
|
-
```
|
|
179
|
-
formsAngular.config(['urlServiceProvider', 'cssFrameworkServiceProvider', function (urlService, cssFrameworkService) {
|
|
180
|
-
urlService.setOptions({html5Mode: false, hashPrefix: '!'});
|
|
181
|
-
cssFrameworkService.setOptions({framework: 'bs2'}); // bs2 and bs3 are supported
|
|
182
|
-
}]);
|
|
183
|
-
```
|
|
184
|
-
* Report drilldowns now start from the model
|
|
185
|
-
```
|
|
186
|
-
drilldown: '/#/g_conditional_fields/!_id!/edit'
|
|
187
|
-
drilldown: '/#!/g_conditional_fields/|_id|/edit'
|
|
188
|
-
```
|
|
189
|
-
both become
|
|
190
|
-
```
|
|
191
|
-
drilldown: 'g_conditional_fields/|_id|/edit'
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
## 0.1 to 0.2
|
|
195
|
-
### Summary
|
|
196
|
-
* Support for radio button groups, CKEditor
|
|
197
|
-
* Internal changes to make better use of Angular JS forms capabilities
|
|
198
|
-
* Added support for HTML5 input capabilities: pattern, min, max, step
|
|
199
|
-
* All lookups are now handled as {id:xxx, text:yyy} on the client
|
|
200
|
-
* default ids now generated by form directive (and no longer by BaseCtrl)
|
|
201
|
-
* Added customFooter and customSubDoc for sub docs
|
|
202
|
-
* Improvements to search: now a directive; makes use of arrow keys and escape; some bug fixes
|
|
203
|
-
* showWhen conditional field display introduced (showIf will probably be deprecated)
|
|
204
|
-
|
|
205
|
-
### BREAKING CHANGES
|
|
206
|
-
* Changed form-input directive so that it creates a form tag, and rather than creating a <form-input>
|
|
207
|
-
per sub document it now creates a <ng-form> and builds the sub-form in the same pass. Only when using
|
|
208
|
-
directives are multiple passes required.
|
|
209
|
-
* Bespoke directives that use schema need to be modified (changes will normally be from something like
|
|
210
|
-
```
|
|
211
|
-
var info = scope[attrs.schema][0];
|
|
212
|
-
```
|
|
213
|
-
to
|
|
214
|
-
```
|
|
215
|
-
var info = scope[attrs.schema];
|
|
216
|
-
```
|
|
217
|
-
* Password type is still used generated automatically if the label contains the string 'password', but the override
|
|
218
|
-
method is now to use the form type (password is it is a password, text if not).
|
|
219
|
-
* We have followed ui-bootstrap's renaming of tabs / panes to tabsets / tabs, so any use of "pane" in your form objects
|
|
220
|
-
needs to be changed to tab.
|
|
221
|
-
* Support for allowing crawling meant that !(shriek) had to be replaced with |(pipe) in report drill down urls replacement
|
|
222
|
-
* Some default id formats changed in subdocuments, which may affect tests etc
|
|
223
|
-
|
|
224
|
-
## 0.0.x to 0.1.0
|
|
225
|
-
### Summary
|
|
226
|
-
* Started CHANGELOG.md (but for now it is far from definitive, but is intended to include all breaking changes)
|
|
227
|
-
* Added support for containers (documented in Custom Form Schemas section of documentation)
|
|
228
|
-
* Added reporting capability
|
|
229
|
-
* New website
|
|
230
|
-
|
|
231
|
-
### BREAKING CHANGES
|
|
232
|
-
* Changes form-input directive so that it expects
|
|
233
|
-
```
|
|
234
|
-
<form-input schema="formSchema">
|
|
235
|
-
```
|
|
236
|
-
instead of
|
|
237
|
-
```
|
|
238
|
-
<form-input ng-repeat="field in formSchema" info={{field}}>
|
|
239
|
-
```
|
|
240
|
-
* findFunc option now returns a query object such as
|
|
241
|
-
```
|
|
242
|
-
{field:'value'}
|
|
243
|
-
```
|
|
244
|
-
rather than a MongooseJS Query such as
|
|
245
|
-
```
|
|
246
|
-
model.find().where('field', 'value')
|
|
247
|
-
```
|
|
248
|
-
* Bespoke directives that use schema need to be modified (changes will normally be from something like
|
|
249
|
-
```
|
|
250
|
-
var info = JSON.parse(attrs.info);
|
|
251
|
-
```
|
|
252
|
-
to
|
|
253
|
-
```
|
|
254
|
-
var info = scope[attrs.schema][0];
|
|
255
|
-
```
|
|
256
|
-
* One formInputDone is broadcast per form (instead of per field).
|