Skip to content

Commit

Permalink
(feat): personal data blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonvanWijhe committed Jan 9, 2024
1 parent d5970f5 commit 1883bec
Show file tree
Hide file tree
Showing 32 changed files with 14,302 additions and 186 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

- Tested up to: WordPress 6.3.2

## v1.2.0

### Feat

- Personal data blocks

## v1.1

### Feat
Expand Down
6 changes: 0 additions & 6 deletions TODO.md

This file was deleted.

16 changes: 16 additions & 0 deletions build/personal-data-table/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "prefill-gravity-forms/personal-data-table",
"version": "0.1.0",
"title": "Profielpagina",
"category": "embed",
"icon": "list-view",
"description": "Maak een profielpagina met persoonsgegevens van de ingelogde gebruiker.",
"example": {},
"supports": {
"html": false
},
"textdomain": "prefill-gravity-forms",
"editorScript": "file:./index.js"
}
1 change: 1 addition & 0 deletions build/personal-data-table/index.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks'), 'version' => '33a4b45f8eec02c31038');
1 change: 1 addition & 0 deletions build/personal-data-table/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions build/personal-data-table/personal-data-row/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "prefill-gravity-forms/personal-data-row",
"version": "0.1.0",
"title": "Persoonsgegevens",
"category": "embed",
"icon": "id",
"description": "Toon persoonsgegevens van de ingelogde gebruiker.",
"example": {},
"supports": {
"html": false
},
"attributes": {
"selectedOption": {
"type": "object",
"default": {
"value": "",
"label": ""
}
},
"isChildOfTable": {
"type": "boolean",
"default": false
},
"htmlElement": {
"type": "string",
"default": "p"
}
},
"textdomain": "prefill-gravity-forms",
"editorScript": "file:./index.js",
"render": "file:./render.php"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '010cb8fb1bb4a49a86fa');
1 change: 1 addition & 0 deletions build/personal-data-table/personal-data-row/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions build/personal-data-table/personal-data-row/render.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

use OWC\PrefillGravityForms\Services\PersonalDataService;

if ($attributes['isChildOfTable']) : ?>
<tr>
<th><?php echo $attributes['selectedOption']['label'] ?></th>
<td><?php echo (new PersonalDataService())->get($attributes['selectedOption']['value'])?></td>
</tr>
<?php else :
echo sprintf(
"<%s>%s</%s>",
$attributes['htmlElement'] ?? 'p',
(new PersonalDataService())->get($attributes['selectedOption']['value']),
$attributes['htmlElement'] ?? 'p'
);
endif;
1 change: 1 addition & 0 deletions config/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'providers' => [
// Global providers.
OWC\PrefillGravityForms\GravityForms\GravityFormsServiceProvider::class,
OWC\PrefillGravityForms\Blocks\BlockServiceProvider::class,
],

/**
Expand Down
Loading

0 comments on commit 1883bec

Please sign in to comment.