File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -759,6 +759,7 @@ declare module fng {
759
759
readRecord : ( modelName : string , id : string , formName ?: string ) => angular . IHttpPromise < any > ;
760
760
getAll : ( modelName : string , _options : any ) => angular . IHttpPromise < any [ ] > ;
761
761
getAllListAttributes : ( ref : string ) => angular . IHttpPromise < ILookupItem [ ] > ;
762
+ getAllPickListAttributes : ( ref : string ) => angular . IHttpPromise < ILookupItem [ ] > ;
762
763
getPagedAndFilteredList : (
763
764
modelName : string ,
764
765
options : IListQueryOptions
Original file line number Diff line number Diff line change @@ -130,9 +130,14 @@ module fng.services {
130
130
} ,
131
131
132
132
// return only the list attributes for ALL records in the given collection, returning ILookupItem[]
133
+ // getAllPickListAttributes() is intended to be used to retrieve records for display in a picklist;
134
+ // getAllListAttributes() for all other use cases
133
135
getAllListAttributes : function ( ref : string ) : angular . IHttpPromise < ILookupItem [ ] > {
134
136
return $http . get ( `/api/${ ref } /listAll` , { cache : expCache } ) ;
135
137
} ,
138
+ getAllPickListAttributes : function ( ref : string ) : angular . IHttpPromise < ILookupItem [ ] > {
139
+ return $http . get ( `/api/${ ref } /picklistAll` , { cache : expCache } ) ;
140
+ } ,
136
141
137
142
// return only the list attributes for records in the given collection that satisfy the given query conditions (filter, limit etc.)
138
143
// return ILookupItem[] if options.concatenate is true, else the raw documents
Original file line number Diff line number Diff line change @@ -150,7 +150,9 @@ export class FormsAngular {
150
150
processArgs ( this . options , [ resourceName , this . collectionGet ( ) ] )
151
151
) ;
152
152
153
- // return the List attributes for all records - used by record-handler's setUpLookupOptions() method, for cases
153
+ // return the List attributes for all records. two endpoints that go through the same handler so permissions
154
+ // can be applied differently for the two use cases. /listAll is intended for listing records on a page;
155
+ // /picklistAll for listing them in a <select> or similar - used by record-handler's setUpLookupOptions() method, for cases
154
156
// where there's a lookup that doesn't use the fngajax option
155
157
this . app . get . apply (
156
158
this . app ,
@@ -159,6 +161,13 @@ export class FormsAngular {
159
161
this . entityListAll ( ) ,
160
162
] )
161
163
) ;
164
+ this . app . get . apply (
165
+ this . app ,
166
+ processArgs ( this . options , [
167
+ resourceName + "/picklistAll" ,
168
+ this . entityListAll ( ) ,
169
+ ] )
170
+ ) ;
162
171
163
172
// return the List attributes for a record - used by fng-ui-select
164
173
this . app . get . apply (
You can’t perform that action at this time.
0 commit comments