Skip to content

Commit 14db977

Browse files
committed
Update module configurations.
1 parent 04bf629 commit 14db977

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

ProcessGraphQLConfig.php

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ public function getInputFields()
181181
$inputfields = parent::getInputFields();
182182

183183
// legalTemplates
184-
$f = $this->modules->get('InputfieldCheckboxes');
184+
$f = $this->modules->get('InputfieldAsmSelect');
185185
$f->optionColumns = 4;
186186
$f->attr('name', 'legalTemplates');
187-
$f->label = 'Legal Templates';
188-
$f->description = 'Only the templates that are selected here and have Access Control enabled will be handled by this module.';
187+
$f->label = 'Templates';
188+
$f->description = 'Choose which page templates you want to be served via GraphQL api.';
189189
$gotDisabledFields = false;
190190
foreach (\ProcessWire\wire('templates') as $template) {
191191
// skip repeater templates
@@ -197,7 +197,7 @@ public function getInputFields()
197197
$attributes['disabled'] = true;
198198
$gotDisabledFields = true;
199199
}
200-
$label = $template->flags & Template::flagSystem ? "{$template->name} `(system)`" : $template->name;
200+
$label = $template->flags & Template::flagSystem ? "{$template->name} (system)" : $template->name;
201201
$f->addOption($template->name, $label, $attributes);
202202
}
203203
$notes = "Please be careful with what you are exposing to the public. Choosing templates marked as `system` can lead to security vulnerabilities.";
@@ -209,50 +209,50 @@ public function getInputFields()
209209
$inputfields->add($f);
210210

211211
// legalFields
212-
$f = $this->modules->get('InputfieldCheckboxes');
212+
$f = $this->modules->get('InputfieldAsmSelect');
213213
$f->optionColumns = 4;
214214
$f->attr('name', 'legalFields');
215-
$f->label = 'Legal Fields';
216-
$f->description = 'The fields that you select below will be available via your GraphQL api.';
215+
$f->label = 'Fields';
216+
$f->description = 'Choose which fields you want to be served via GraphQL api.';
217217
$f->notes = 'Please be careful with what you are exposing to the public. Choosing fields marked as `system` can to lead security vulnerabilities.';
218218
foreach (\ProcessWire\wire('fields')->find("name!=pass") as $field) {
219219
if ($field->type instanceof FieldtypeFieldsetOpen) continue;
220220
if ($field->type instanceof FieldtypeFieldsetClose) continue;
221221
if ($field->type instanceof FieldtypeFieldsetTabOpen) continue;
222-
$f->addOption($field->name, $field->flags & Field::flagSystem ? "{$field->name} `(system)`" : $field->name);
222+
$f->addOption($field->name, $field->flags & Field::flagSystem ? "{$field->name} (system)" : $field->name);
223223
}
224224
$inputfields->add($f);
225225

226226
// legalPageFields
227-
$f = $this->modules->get('InputfieldCheckboxes');
227+
$f = $this->modules->get('InputfieldAsmSelect');
228228
$f->optionColumns = 4;
229229
$f->attr('name', 'legalPageFields');
230-
$f->label = 'Legal Page Fields';
231-
$f->description = 'Choose which built in `Page` fields you wish to be available via GraphQL api.';
230+
$f->label = 'Page Fields';
231+
$f->description = 'Choose which built in `Page` fields you want to be served via GraphQL api.';
232232
$f->notes = 'Be careful with fields like `parents` & `children` that will allow user to construct deeply nested queries that might be very expensive for your server to fulfill.';
233233
foreach (PageType::getBuiltInFields() as $field) {
234234
$f->addOption($field['name']);
235235
}
236236
$inputfields->add($f);
237237

238238
// legalPageFileFields
239-
$f = $this->modules->get('InputfieldCheckboxes');
239+
$f = $this->modules->get('InputfieldAsmSelect');
240240
$f->optionColumns = 4;
241241
$f->attr('name', 'legalPageFileFields');
242-
$f->label = 'Legal PageFile Fields';
243-
$f->description = 'Choose which built in `PageFile` fields you wish to be available via GraphQL api.';
242+
$f->label = 'PageFile Fields';
243+
$f->description = 'Choose which built in `PageFile` fields you want to be served via GraphQL api.';
244244
$f->notes = 'These fields are also inherited by `PageImage`.';
245245
foreach (FileType::getBuiltInFields() as $field) {
246246
$f->addOption($field['name']);
247247
}
248248
$inputfields->add($f);
249249

250250
// legalPageImageFields
251-
$f = $this->modules->get('InputfieldCheckboxes');
251+
$f = $this->modules->get('InputfieldAsmSelect');
252252
$f->optionColumns = 4;
253253
$f->attr('name', 'legalPageImageFields');
254-
$f->label = 'Legal PageImage Fields';
255-
$f->description = 'Choose which built in `PageImage` fields you wish to be available via GraphQL api.';
254+
$f->label = 'PageImage Fields';
255+
$f->description = 'Choose which built in `PageImage` fields you want to be served via GraphQL api.';
256256
foreach (ImageType::getBuiltInFields() as $field) {
257257
$f->addOption($field['name']);
258258
}
@@ -279,32 +279,27 @@ public function getInputFields()
279279
$f = $this->modules->get('InputfieldInteger');
280280
$f->attr('name', 'maxLimit');
281281
$f->label = 'Max Limit';
282-
$f->description = 'Set the maximum value for `limit` selector field.';
282+
$f->description = 'Set the maximum value for `limit` selector field for GraphQL api.';
283283
$f->required = true;
284284
$inputfields->add($f);
285285

286-
// ADVANCED
287-
$fSet = $this->modules->get('InputfieldFieldset');
288-
$fSet->label = 'Advanced';
289-
$fSet->collapsed = Inputfield::collapsedYes;
290-
291286
// meQuery
292287
$f = $this->modules->get('InputfieldCheckbox');
293288
$f->attr('name', 'meQuery');
294289
$f->label = 'me Query';
295290
$f->columnWidth = 50;
296-
$desc = "Adds '`me`' query field. Allows user to query her credentials.";
291+
$desc = "Adds `me` query field. Allows user to query her credentials.";
297292
$f->description = $desc;
298-
$fSet->add($f);
293+
$inputfields->add($f);
299294

300295
// authQuery
301296
$f = $this->modules->get('InputfieldCheckbox');
302297
$f->attr('name', 'authQuery');
303298
$f->label = 'login/logout Query';
304299
$f->columnWidth = 50;
305-
$desc = "Adds '`login`' & '`logout`' fields. Allows users to authenticate via GraphQL API.";
300+
$desc = "Adds `login` & `logout` fields. Allows users to authenticate via GraphQL API.";
306301
$f->description = $desc;
307-
$fSet->add($f);
302+
$inputfields->add($f);
308303

309304
$inputfields->add($fSet);
310305

0 commit comments

Comments
 (0)