diff --git a/config.codekit3 b/config.codekit3 index 5d0e9c6..dd9af72 100644 --- a/config.codekit3 +++ b/config.codekit3 @@ -7,7 +7,7 @@ "uuidString": "ECE3F09A-2816-43C6-9715-3F4A30BD28C5" } ], -"creatorBuild": "31934", +"creatorBuild": "32137", "files": { "/.github/ISSUE_TEMPLATE": { "cB": 0, @@ -363,14 +363,14 @@ "aP": 1, "bl": 0, "dP": 10, - "dS": 0, + "ec": 1, "ft": 4, "ma": 0, "oA": 0, "oAP": "/src/resources/dist/css/field-manager.css", "oF": 0, "oS": 3, - "uL": 1 + "sct": 1 }, "/src/services": { "ft": 65536, @@ -998,6 +998,10 @@ "active": 0, "optionString": "" }, + "grouped-accessor-pairs": { + "active": 0, + "optionString": "'anyOrder'" + }, "guard-for-in": { "active": 0, "optionString": "" @@ -1174,6 +1178,10 @@ "active": 1, "optionString": "{'checkLoops': true}" }, + "no-constructor-return": { + "active": 0, + "optionString": "" + }, "no-continue": { "active": 0, "optionString": "" @@ -1202,6 +1210,10 @@ "active": 1, "optionString": "" }, + "no-dupe-else-if": { + "active": 1, + "optionString": "" + }, "no-dupe-keys": { "active": 1, "optionString": "" @@ -1502,6 +1514,10 @@ "active": 0, "optionString": "" }, + "no-setter-return": { + "active": 1, + "optionString": "" + }, "no-shadow": { "active": 0, "optionString": "{'builtinGlobals': false, 'hoist': 'functions', 'allow': []}" @@ -1706,6 +1722,10 @@ "active": 0, "optionString": "{'array': true, 'object': true}, {'enforceForRenamedProperties': false}" }, + "prefer-exponentiation-operator": { + "active": 0, + "optionString": "" + }, "prefer-named-capture-group": { "active": 0, "optionString": "" @@ -2402,13 +2422,13 @@ "autoOutputPathReplace1": "sass", "autoOutputPathReplace2": "css", "autoOutputPathStyle": 2, + "compilerType": 1, "createSourceMap": 0, - "debugStyle": 0, "decimalPrecision": 10, + "emitCharset": 1, "outputStyle": 3, "shouldRunAutoprefixer": 1, - "shouldRunBless": 0, - "useLibsass": 1 + "shouldRunBless": 0 }, "languageDefaultsSLIM": { "autoOutputAction": 0, diff --git a/src/services/Export.php b/src/services/Export.php index 8c1a3bd..1803e92 100644 --- a/src/services/Export.php +++ b/src/services/Export.php @@ -27,6 +27,7 @@ public function export(array $fieldIds) 'handle' => $field->handle, 'instructions' => $field->instructions, 'required' => $field->required, + 'searchable' => $field->searchable, 'translationMethod' => $field->translationMethod, 'translationKeyFormat' => $field->translationKeyFormat, 'type' => \get_class($field), @@ -80,8 +81,9 @@ public function processMatrix($field) 'handle' => $blockField->handle, 'required' => $blockField->required, 'instructions' => $blockField->instructions, - 'translationMethod' => $field->translationMethod, - 'translationKeyFormat' => $field->translationKeyFormat, + 'searchable' => $blockField->searchable, + 'translationMethod' => $blockField->translationMethod, + 'translationKeyFormat' => $blockField->translationKeyFormat, 'type' => \get_class($blockField), 'typesettings' => $settings, ); @@ -165,8 +167,9 @@ public function processSuperTable($field) 'handle' => $blockField->handle, 'required' => $blockField->required, 'instructions' => $blockField->instructions, - 'translationMethod' => $field->translationMethod, - 'translationKeyFormat' => $field->translationKeyFormat, + 'searchable' => $blockField->searchable, + 'translationMethod' => $blockField->translationMethod, + 'translationKeyFormat' => $blockField->translationKeyFormat, 'type' => \get_class($blockField), 'typesettings' => $settings, ); diff --git a/src/services/Import.php b/src/services/Import.php index 08d9585..9dc8ef1 100644 --- a/src/services/Import.php +++ b/src/services/Import.php @@ -163,15 +163,16 @@ public function import(array $fields): array } $field = Craft::$app->fields->createField([ - 'groupId' => $fieldInfo['groupId'], - 'name' => $fieldInfo['name'], - 'handle' => $fieldInfo['handle'], - 'instructions' => $fieldInfo['instructions'], - 'translationMethod' => $fieldInfo['translationMethod'] ?? '', + 'groupId' => $fieldInfo['groupId'], + 'name' => $fieldInfo['name'], + 'handle' => $fieldInfo['handle'], + 'instructions' => $fieldInfo['instructions'], + 'searchable' => $fieldInfo['searchable'], + 'translationMethod' => $fieldInfo['translationMethod'] ?? '', 'translationKeyFormat' => $fieldInfo['translationKeyFormat'] ?? '', - 'required' => $fieldInfo['required'], - 'type' => $fieldInfo['type'], - 'settings' => $fieldInfo['settings'], + 'required' => $fieldInfo['required'], + 'type' => $fieldInfo['type'], + 'settings' => $fieldInfo['settings'], ]); // Send off to Craft's native fieldSave service for heavy lifting. diff --git a/src/services/Service.php b/src/services/Service.php index b2cc623..e9e9265 100644 --- a/src/services/Service.php +++ b/src/services/Service.php @@ -62,14 +62,15 @@ public function cloneGroup(FieldGroup $group, $prefix, FieldGroup $originGroup): foreach (Craft::$app->fields->getFieldsByGroupId($originGroup->id) as $originField) { $field = Craft::$app->fields->createField([ - 'type' => \get_class($originField), - 'groupId' => $group->id, - 'name' => $originField->name, - 'handle' => $prefix . $originField->handle, - 'instructions' => $originField->instructions, - 'translationMethod' => $originField->translationMethod, + 'type' => \get_class($originField), + 'groupId' => $group->id, + 'name' => $originField->name, + 'handle' => $prefix . $originField->handle, + 'instructions' => $originField->instructions, + 'searchable' => $originField->searchable, + 'translationMethod' => $originField->translationMethod, 'translationKeyFormat' => $originField->translationKeyFormat, - 'settings' => $originField->settings, + 'settings' => $originField->settings, ]); if (get_class($field) == 'craft\fields\Matrix') { @@ -128,19 +129,20 @@ public function processCloneMatrix(FieldInterface $originField) $fields = []; foreach ($blockType->getFields() as $j => $blockField) { - $fields['new' . $j] = [ + $fields['new' . ($j + 1)] = [ 'type' => get_class($blockField), 'name' => $blockField['name'], 'handle' => $blockField['handle'], 'instructions' => $blockField['instructions'], 'required' => (bool)$blockField['required'], + 'searchable' => (bool)$blockField['searchable'], 'translationMethod' => $blockField['translationMethod'], 'translationKeyFormat' => $blockField['translationKeyFormat'], 'typesettings' => $blockField['settings'], ]; } - $blockTypes['new' . $i] = [ + $blockTypes['new' . ($i + 1)] = [ 'name' => $blockType->name, 'handle' => $blockType->handle, 'sortOrder' => $blockType->sortOrder, @@ -193,6 +195,7 @@ public function processCloneSuperTable(FieldInterface $originField) 'handle' => $blockField['handle'], 'instructions' => $blockField['instructions'], 'required' => (bool)$blockField['required'], + 'searchable' => (bool)$blockField['searchable'], 'translationMethod' => $blockField['translationMethod'], 'translationKeyFormat' => $blockField['translationKeyFormat'], 'typesettings' => $blockField['settings'],