diff --git a/Admin/Install/db.json b/Admin/Install/db.json index d3a22e6..2850506 100755 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -46,13 +46,13 @@ "null": false }, "attribute_attr_type_required": { - "description": "Every element must have this attribute type if set to true.", + "comment": "Every element must have this attribute type if set to true.", "name": "attribute_attr_type_required", "type": "TINYINT(1)", "null": false }, "attribute_attr_type_pattern": { - "description": "This is a regex validation pattern.", + "comment": "This is a regex validation pattern.", "name": "attribute_attr_type_pattern", "type": "VARCHAR(255)", "null": false diff --git a/Controller/ApiAttributeTraitController.php b/Controller/ApiAttributeTraitController.php index 86312dc..9ae871a 100644 --- a/Controller/ApiAttributeTraitController.php +++ b/Controller/ApiAttributeTraitController.php @@ -153,7 +153,7 @@ trait ApiAttributeTraitController $attrType = new AttributeType($request->getDataString('name') ?? ''); $attrType->datatype = AttributeValueType::tryFromValue($request->getDataInt('datatype')) ?? AttributeValueType::_STRING; $attrType->custom = $request->getDataBool('custom') ?? false; - $attrType->isRepeatable = $request->getDataBool('is_repeatable') ?? false; + $attrType->isRepeatable = $request->getDataBool('is_repeatable') ?? false; $attrType->isInternal = $request->getDataBool('internal') ?? false; $attrType->isRequired = $request->getDataBool('is_required') ?? false; $attrType->validationPattern = $request->getDataString('validation_pattern') ?? ''; diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 084eace..286155d 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -246,7 +246,7 @@ final class ApiController extends Controller $attrType->datatype = AttributeValueType::tryFromValue($request->getDataInt('datatype')) ?? AttributeValueType::_STRING; $attrType->custom = $request->getDataBool('custom') ?? false; $attrType->isRequired = $request->getDataBool('is_required') ?? false; - $attrType->isRepeatable = $request->getDataBool('is_repeatable') ?? false; + $attrType->isRepeatable = $request->getDataBool('is_repeatable') ?? false; $attrType->validationPattern = $request->getDataString('validation_pattern') ?? ''; $attrType->setL11n( $request->getDataString('title') ?? '', diff --git a/Docs/Dev/en/structure.md b/Docs/Dev/en/structure.md deleted file mode 100755 index 73451c0..0000000 --- a/Docs/Dev/en/structure.md +++ /dev/null @@ -1,5 +0,0 @@ -# Structure - -## ER - -![ER](Modules/News/Docs/Dev/img/er.png) \ No newline at end of file diff --git a/Docs/Dev/img/er.png b/Docs/Dev/img/er.png deleted file mode 100644 index 3829d64..0000000 Binary files a/Docs/Dev/img/er.png and /dev/null differ diff --git a/Models/AttributeType.php b/Models/AttributeType.php index 33ba733..c80985e 100755 --- a/Models/AttributeType.php +++ b/Models/AttributeType.php @@ -240,7 +240,7 @@ class AttributeType implements \JsonSerializable 'custom' => $this->custom, 'isRequired' => $this->isRequired, 'isInternal' => $this->isInternal, - 'isRepeatable' => $this->isRepeatable, + 'isRepeatable' => $this->isRepeatable, ]; } diff --git a/Models/AttributeTypeMapper.php b/Models/AttributeTypeMapper.php index 875d05e..e2a3f92 100755 --- a/Models/AttributeTypeMapper.php +++ b/Models/AttributeTypeMapper.php @@ -36,13 +36,13 @@ final class AttributeTypeMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'attribute_attr_type_id' => ['name' => 'attribute_attr_type_id', 'type' => 'int', 'internal' => 'id'], - 'attribute_attr_type_name' => ['name' => 'attribute_attr_type_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], - 'attribute_attr_type_datatype' => ['name' => 'attribute_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'], - 'attribute_attr_type_fields' => ['name' => 'attribute_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], - 'attribute_attr_type_custom' => ['name' => 'attribute_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], - 'attribute_attr_type_pattern' => ['name' => 'attribute_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], - 'attribute_attr_type_required' => ['name' => 'attribute_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], + 'attribute_attr_type_id' => ['name' => 'attribute_attr_type_id', 'type' => 'int', 'internal' => 'id'], + 'attribute_attr_type_name' => ['name' => 'attribute_attr_type_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], + 'attribute_attr_type_datatype' => ['name' => 'attribute_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'], + 'attribute_attr_type_fields' => ['name' => 'attribute_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], + 'attribute_attr_type_custom' => ['name' => 'attribute_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], + 'attribute_attr_type_pattern' => ['name' => 'attribute_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], + 'attribute_attr_type_required' => ['name' => 'attribute_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], 'attribute_attr_type_repeatable' => ['name' => 'attribute_attr_type_repeatable', 'type' => 'bool', 'internal' => 'isRepeatable'], ]; diff --git a/Theme/Backend/Components/AttributeView.php b/Theme/Backend/Components/AttributeView.php index 72fc909..9180bcf 100644 --- a/Theme/Backend/Components/AttributeView.php +++ b/Theme/Backend/Components/AttributeView.php @@ -85,11 +85,11 @@ class AttributeView extends View public function render(mixed ...$data) : string { /** @var array{0:\Modules\Attribute\Models\Attribute[]} $data */ - $this->attributes = $data[0]; - $this->attributeTypes = $data[1]; - $this->units = $data[2]; - $this->apiUri = $data[3]; - $this->refId = $data[4]; + $this->attributes = $data[0] ?? []; + $this->attributeTypes = $data[1] ?? []; + $this->units = $data[2] ?? []; + $this->apiUri = $data[3] ?? ''; + $this->refId = $data[4] ?? 0; return parent::render(); } diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index 21ed518..c0f2d9c 100644 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -20,7 +20,7 @@ return ['Attribute' => [ 'Datatype' => 'Datatype', 'DefaultValues' => 'Default Values', 'IsRequired' => 'Is required?', - 'IsRepeatable' => 'Is repeatable?', + 'IsRepeatable' => 'Is repeatable?', 'Name' => 'Name', 'Pattern' => 'Pattern', 'Status' => 'Status', diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index d3e11fa..ce80c0f 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -20,7 +20,7 @@ return ['Attribute' => [ 'Datatype' => 'Datatype', 'DefaultValues' => 'Default Values', 'IsRequired' => 'Is required?', - 'IsRepeatable' => 'Is repeatable?', + 'IsRepeatable' => 'Is repeatable?', 'Name' => 'Name', 'Pattern' => 'Pattern', 'Status' => 'Status', diff --git a/info.json b/info.json index 99e377d..dca85fa 100755 --- a/info.json +++ b/info.json @@ -12,7 +12,7 @@ }, "creator": { "name": "Jingga", - "website": "jingga.app" + "website": "https://jingga.app" }, "description": "Attribute module.", "directory": "Attribute", diff --git a/tests/Models/AttributeTypeTest.php b/tests/Models/AttributeTypeTest.php index 78a30f6..48d29d5 100644 --- a/tests/Models/AttributeTypeTest.php +++ b/tests/Models/AttributeTypeTest.php @@ -35,7 +35,7 @@ final class AttributeTypeTest extends \PHPUnit\Framework\TestCase public function testGetDefaultInt() : void { - $type = new AttributeType(); + $type = new AttributeType(); $type->datatype = AttributeValueType::_INT; $type->defaults[] = new AttributeValue(); @@ -46,7 +46,7 @@ final class AttributeTypeTest extends \PHPUnit\Framework\TestCase public function testGetDefaultFloatInt() : void { - $type = new AttributeType(); + $type = new AttributeType(); $type->datatype = AttributeValueType::_FLOAT_INT; $type->defaults[] = new AttributeValue(); @@ -57,7 +57,7 @@ final class AttributeTypeTest extends \PHPUnit\Framework\TestCase public function testGetDefaultBool() : void { - $type = new AttributeType(); + $type = new AttributeType(); $type->datatype = AttributeValueType::_BOOL; $type->defaults[] = new AttributeValue(); @@ -79,7 +79,7 @@ final class AttributeTypeTest extends \PHPUnit\Framework\TestCase public function testGetDefaultDateTime() : void { - $type = new AttributeType(); + $type = new AttributeType(); $type->datatype = AttributeValueType::_DATETIME; $type->defaults[] = new AttributeValue();