Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package creating #1

Merged
merged 20 commits into from
Apr 20, 2023
Merged

Package creating #1

merged 20 commits into from
Apr 20, 2023

Conversation

Igor-Tkachenko
Copy link
Contributor

No description provided.

composer.json Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
gf-giftaid-field.php Outdated Show resolved Hide resolved
gf-giftaid-field.php Outdated Show resolved Hide resolved
gf-giftaid-field.php Outdated Show resolved Hide resolved
src/GfGiftAid.php Outdated Show resolved Hide resolved
src/GfGiftAid.php Outdated Show resolved Hide resolved
src/GfGiftAid.php Outdated Show resolved Hide resolved
src/GiftAidField.php Outdated Show resolved Hide resolved
Copy link
Member

@codepuncher codepuncher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run composer require --dev itinerisltd/itineris-wp-coding-standards:dev-2023-02-01

@private-packagist
Copy link

private-packagist bot commented Apr 14, 2023

composer.lock

Dev Package changes

Package Operation From To Changes
dealerdirect/phpcodesniffer-composer-installer add - v1.0.0 view code
itinerisltd/itineris-wp-coding-standards add - 1.0.0 view code
phpstan/phpdoc-parser add - 1.18.1 view code
roave/security-advisories add - dev-master 9edb62e view code
slevomat/coding-standard add - 8.10.0 view code
squizlabs/php_codesniffer add - 3.7.2 view code
wp-coding-standards/wpcs add - 2.3.0 view code

Settings · Docs · Powered by Private Packagist

gf-giftaid-field.php Outdated Show resolved Hide resolved
public/js/gift-aid.js Outdated Show resolved Hide resolved
src/GiftAidField.php Outdated Show resolved Hide resolved
src/GiftAidField.php Outdated Show resolved Hide resolved
Copy link
Member

@codepuncher codepuncher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every echo needs escape

gf-giftaid-field.php Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
public/js/gift-aid.js Outdated Show resolved Hide resolved
codepuncher
codepuncher previously approved these changes Apr 19, 2023
Copy link
Member

@codepuncher codepuncher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!
Can you add screenshot of frontend and backend to README?

Comment on lines +49 to +85
public function get_field_input($form, $value = '', $entry = null): string
{
$id = (int) $this->id;
$giftaidImage = ITINERIS_GF_GIFT_AID_FIELD_URI . '/assets/giftaid.svg';

ob_start();
?>
<div class="gift-box-wrapper bg-gray-50 rounded-br-4 p-7.5">
<div class="gift-aid-logo mb-2">
<img src="<?php echo esc_url($giftaidImage); ?>" alt="GiftAid logo">
</div>
<div class="description text-primary font-medium text-xl mb-2">
<?php //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php echo wpautop(wp_kses_post($this->get_calculated_gift())); ?>
</div>
<div class="gift-box-form-wrapper my-6 pb-6 border-b border-b-gray-200">
<div class="ginput_container ginput_container_checkbox mb-6">
<div class="gfield_checkbox" id="input_<?php echo esc_attr($id); ?>">
<div class="gchoice gchoice_<?php echo esc_attr($id); ?>">
<input
class="gfield-choice-input"
id="gift-check-<?php echo esc_attr($id); ?>"
name="gift-check-<?php echo esc_attr($id); ?>"
type="checkbox"
value="1"
>
<label for="gift-check-<?php echo esc_attr($id); ?>">
<?php echo esc_html($this->label); ?>
</label>
</div>
</div>
</div>
</div>
<div class="details-description"><?php echo esc_html($this->description); ?></div>
</div>
<?php
return ob_get_clean();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exists a way to not mix PHP and HTML ? I suggest to export this is another file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that will be fine for next version/release. Now should be fine.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't do that from the start then we will do never. Trust me, I know.


public function get_calculated_gift(): string
{
$calculationText = 'With Gift Aid, your donation of {{ donation }} would be worth {{ calculated_gift_aid }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$calculationText = 'With Gift Aid, your donation of {{ donation }} would be worth {{ calculated_gift_aid }}
$calculationText = 'With Gift Aid, your donation of {{ donation }} would be worth {{ calculated_gift_aid }}

Client should be able to edit this text from admin panel

public/js/gift-aid.js Outdated Show resolved Hide resolved
public/js/gift-aid.js Outdated Show resolved Hide resolved
public/js/gift-aid.js Outdated Show resolved Hide resolved
public/js/gift-aid.js Outdated Show resolved Hide resolved
public/js/gift-aid.js Outdated Show resolved Hide resolved
public/js/gift-aid.js Outdated Show resolved Hide resolved
public/js/gift-aid.js Outdated Show resolved Hide resolved
src/GiftAidField.php Outdated Show resolved Hide resolved
src/GiftAidField.php Outdated Show resolved Hide resolved
$totalAmt = $donation + $amount;
$displayNum = number_format((float) $totalAmt, 2, '.', '');
$searchReplace = [
'{{ donation }}' => "<span class=\"gform_donation_total\">£{$donation}</span>",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if its okay to hardcode the currency £

@private-packagist
Copy link

The composer.lock diff comment has been updated to reflect new changes in this PR.

@private-packagist
Copy link

The composer.lock diff comment has been updated to reflect new changes in this PR.

@Igor-Tkachenko Igor-Tkachenko merged commit ee6eb99 into main Apr 20, 2023
@Igor-Tkachenko Igor-Tkachenko deleted the package-creating branch April 20, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants