Skip to content

Commit

Permalink
Release 5.5.0 (#467)
Browse files Browse the repository at this point in the history
* Adding corrections for the new HubSpot API v3

* updating locaitons and integration issues

* Adding date and range field fixes

* Writing changelog

* updating utils

* fixing corvus pay option

* Update src/Blocks/components/form/assets-admin/transfer.js

Co-authored-by: Ivan Ramljak <[email protected]>

* Update src/Rest/Routes/Settings/TransferRoute.php

Co-authored-by: Ivan Ramljak <[email protected]>

* adding corvus IBAN pay

* Adding additional statuses for integration

* Update src/Integrations/Corvus/SettingsCorvus.php

Co-authored-by: Ivan Ramljak <[email protected]>

* Updating changelog

---------

Co-authored-by: Ivan Ramljak <[email protected]>
  • Loading branch information
iruzevic and piqusy authored Dec 5, 2024
1 parent 737ecc0 commit b658944
Show file tree
Hide file tree
Showing 34 changed files with 674 additions and 611 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file.

This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/).

## [5.5.0]

### Added

- Locations ajax for results output listing.
- Option to customize Date and Time fields Preview and Output format.
- Result Outputs can now be exported and imported using settings.
- Settings entries list now has better UX in settings.
- `getFormUsageLocation` helper now supports custom post type.
- HubSpot integration now works using `v3` API for all data except form submission as it is not supported.
- Corvus Pay integration now supports IBAN payments.
- TalentLyft integration now supports additional statuses.

### Fixed

- Input Range status variable will output max 2 decimals.
- Input Range settings pickers broken up/down buttons.
- Corvus Pay integration fix with `Require complete` option.

### Removed

- Any Server Side Render for the forms and results output.
- Result Output global settings option to setup custom frontend URL.

## [5.4.2]

### Updated
Expand Down Expand Up @@ -796,6 +820,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a

- Initial production release.

[5.5.0]: https://github.com/infinum/eightshift-forms/compare/5.4.2...5.5.0
[5.4.2]: https://github.com/infinum/eightshift-forms/compare/5.4.1...5.4.2
[5.4.1]: https://github.com/infinum/eightshift-forms/compare/5.4.0...5.4.1
[5.4.0]: https://github.com/infinum/eightshift-forms/compare/5.3.2...5.4.0
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"require": {
"php": ">=8.3",
"erusev/parsedown": "^1.7.4",
"infinum/eightshift-forms-utils": "^3.0.7"
"infinum/eightshift-forms-utils": "^3.0.9"
},
"autoload": {
"psr-4": {
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

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

2 changes: 1 addition & 1 deletion eightshift-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: Eightshift Forms is a complete form builder plugin that utilizes modern Block editor features with multiple third-party integrations, bringing your project to a new level.
* Author: WordPress team @Infinum
* Author URI: https://eightshift.com/
* Version: 5.4.2
* Version: 5.5.0
* Text Domain: eightshift-forms
*
* @package EightshiftForms
Expand Down
24 changes: 12 additions & 12 deletions src/AdminMenus/FormAdminMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use EightshiftFormsVendor\EightshiftLibs\Helpers\Helpers;
use EightshiftForms\Misc\SettingsWpml;
use EightshiftForms\Listing\FormListingInterface;
use EightshiftForms\ResultOutput\SettingsResultOutput;
use EightshiftFormsVendor\EightshiftFormsUtils\Config\UtilsConfig;
use EightshiftFormsVendor\EightshiftFormsUtils\Helpers\UtilsDeveloperHelper;
use EightshiftFormsVendor\EightshiftFormsUtils\Helpers\UtilsGeneralHelper;
Expand Down Expand Up @@ -196,7 +195,7 @@ protected function processAttributes($attr): array

switch ($type) {
case UtilsConfig::SLUG_ADMIN_LISTING_LOCATIONS:
$items = UtilsGeneralHelper::getBlockLocations($formId);
$items = UtilsGeneralHelper::getBlockLocations($formId, '');
$count = \count($items);
$formTitle = \get_the_title((int) $formId);

Expand Down Expand Up @@ -967,22 +966,22 @@ private function getRightContent(array $item, string $type, string $parent): arr
break;
case UtilsConfig::SLUG_ADMIN_LISTING_RESULTS:
$output = [
Helpers::render('submit', [
'submitVariant' => 'ghost',
'submitValue' => \__('Locations', 'eightshift-forms'),
'submitAttrs' => [
UtilsHelper::getStateAttribute('locationsId') => $formId,
UtilsHelper::getStateAttribute('locationsType') => Result::POST_TYPE_SLUG,
],
'additionalClass' => UtilsHelper::getStateSelectorAdmin('listingLocations'),
]),
Helpers::render('submit', [
'submitVariant' => 'ghost',
'submitButtonAsLink' => true,
'submitButtonAsLinkUrl' => $item['editLink'] ?? '',
'submitValue' => \__('Edit', 'eightshift-forms'),
]),
];

if (\apply_filters(SettingsResultOutput::FILTER_SETTINGS_GLOBAL_IS_VALID_NAME, false)) {
$output[] = Helpers::render('submit', [
'submitVariant' => 'ghost',
'submitButtonAsLink' => true,
'submitButtonAsLinkUrl' => \get_permalink($formId),
'submitValue' => \__('View', 'eightshift-forms'),
]);
}
break;
case UtilsConfig::SLUG_ADMIN_LISTING_ENTRIES:
$output = [];
Expand All @@ -996,7 +995,8 @@ private function getRightContent(array $item, string $type, string $parent): arr
'submitVariant' => 'ghost',
'submitValue' => \__('Locations', 'eightshift-forms'),
'submitAttrs' => [
UtilsHelper::getStateAttribute('locationsId') => $formId
UtilsHelper::getStateAttribute('locationsId') => $formId,
UtilsHelper::getStateAttribute('locationsType') => Forms::POST_TYPE_SLUG,
],
'additionalClass' => UtilsHelper::getStateSelectorAdmin('listingLocations'),
]),
Expand Down
43 changes: 41 additions & 2 deletions src/Blocks/components/date/components/date-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import React from 'react';
import { isArray } from 'lodash';
import { select } from '@wordpress/data';
import { useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { TextControl, PanelBody } from '@wordpress/components';
import { __, sprintf } from '@wordpress/i18n';
import { TextControl, PanelBody, Button } from '@wordpress/components';
import {
icons,
checkAttr,
Expand Down Expand Up @@ -43,6 +43,8 @@ export const DateOptions = (attributes) => {
const dateDisabledOptions = checkAttr('dateDisabledOptions', attributes, manifest);
const dateType = checkAttr('dateType', attributes, manifest);
const dateUseLabelAsPlaceholder = checkAttr('dateUseLabelAsPlaceholder', attributes, manifest);
const datePreviewFormat = checkAttr('datePreviewFormat', attributes, manifest);
const dateOutputFormat = checkAttr('dateOutputFormat', attributes, manifest);

let dateValidationPatternOptions = [];

Expand Down Expand Up @@ -134,6 +136,43 @@ export const DateOptions = (attributes) => {
/>
</Section>

<Section
icon={icons.tools}
label={__('Formats', 'eightshift-forms')}
>
{__('You can use any valid formats by visiting the following button.', 'eightshift-forms')}

<br/><br/>

<Button
href={`https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format`}
className='es-rounded-1 es-border-cool-gray-300 es-hover-border-cool-gray-400 es-transition'
target='_blank'
>
{__('View valid formats', 'eightshift-forms')}
</Button>

<br/><br/>

<TextControl
label={<IconLabel icon={icons.dateTime} label={__('Preview format', 'eightshift-forms')} />}
value={datePreviewFormat}
placeholder={manifest.formats[dateType].preview}
help={__('Define format of date/time the user will see', 'eightshift-forms')}
onChange={(value) => setAttributes({ [getAttrKey('datePreviewFormat', attributes, manifest)]: value })}
disabled={isOptionDisabled(getAttrKey('datePreviewFormat', attributes, manifest), dateDisabledOptions)}
/>

<TextControl
label={<IconLabel icon={icons.dateTime} label={__('Output format', 'eightshift-forms')} />}
value={dateOutputFormat}
placeholder={manifest.formats[dateType].output}
help={__('Define format of date/time that will be sent when form is processed', 'eightshift-forms')}
onChange={(value) => setAttributes({ [getAttrKey('dateOutputFormat', attributes, manifest)]: value })}
disabled={isOptionDisabled(getAttrKey('dateOutputFormat', attributes, manifest), dateDisabledOptions)}
/>
</Section>

<Section icon={icons.tools} label={__('Advanced', 'eightshift-forms')}>
<TextControl
label={<IconLabel icon={icons.fieldValue} label={__('Initial value', 'eightshift-forms')} />}
Expand Down
9 changes: 2 additions & 7 deletions src/Blocks/components/date/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@
$dateAttrs['placeholder'] = esc_attr($datePlaceholder);
}

if ($datePreviewFormat) {
$dateAttrs[UtilsHelper::getStateAttribute('datePreviewFormat')] = esc_attr($datePreviewFormat);
}

if ($dateOutputFormat) {
$dateAttrs[UtilsHelper::getStateAttribute('dateOutputFormat')] = esc_attr($dateOutputFormat);
}
$dateAttrs[UtilsHelper::getStateAttribute('datePreviewFormat')] = $datePreviewFormat ? esc_attr($datePreviewFormat) : $manifest['formats'][$dateType]['preview'];
$dateAttrs[UtilsHelper::getStateAttribute('dateOutputFormat')] = $dateOutputFormat ? esc_attr($dateOutputFormat) : $manifest['formats'][$dateType]['output'];

if ($dateUseLabelAsPlaceholder) {
$dateAttrs['placeholder'] = esc_attr($dateFieldLabel);
Expand Down
16 changes: 12 additions & 4 deletions src/Blocks/components/date/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@
"type": "array"
},
"datePreviewFormat": {
"type": "string",
"default": "F j, Y H:i"
"type": "string"
},
"dateOutputFormat": {
"type": "string",
"default": "Y-m-d H:i"
"type": "string"
},
"dateTwSelectorsData": {
"type": "array"
Expand All @@ -91,5 +89,15 @@
"value": "datetime-local"
}
]
},
"formats": {
"date": {
"preview": "F j, Y",
"output": "Y-m-d"
},
"datetime-local": {
"preview": "F j, Y H:i",
"output": "Y-m-d H:i"
}
}
}
2 changes: 2 additions & 0 deletions src/Blocks/components/form/assets-admin/locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class Locations {
const formData = new FormData();

formData.append('id', field.getAttribute(this.state.getStateAttribute('locationsId')));
formData.append('type', field.getAttribute(this.state.getStateAttribute('locationsType')));
this.utils.showLoader(this.FORM_ID);

// Populate body data.
Expand Down Expand Up @@ -56,6 +57,7 @@ export class Locations {
if (response.status === 'success') {
item.classList.add(this.state.getStateSelector('isHidden'));
item.closest(this.itemSelector).insertAdjacentHTML('afterend', response.data.output);
item.remove();
}
});
};
Expand Down
11 changes: 6 additions & 5 deletions src/Blocks/components/form/assets-admin/transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,17 @@ export class Transfer {
};

onClickItem = (event) => {
const button = document.querySelector(`${this.state.getStateSelector('field', true)}[${this.state.getStateAttribute('migrationType')}='export-forms']`);
const items = button.getAttribute(this.state.getStateAttribute('migrationExportItems'));

let output = items ? items.split(",") : [];

const {
value,
checked,
name,
} = event.target;

const button = document.querySelector(`${this.state.getStateSelector('field', true)}[${this.state.getStateAttribute('migrationType')}='${name}']`);
const items = button?.getAttribute(this.state.getStateAttribute('migrationExportItems'));

let output = items ? items.split(",") : [];

if (checked) {
output.push(value);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/Blocks/components/form/assets/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1229,8 +1229,8 @@ export class Utils {
if (input) {
const min = input.min || 0;
const max = input.max || 100;
const parsedProgress = Number(((input.value - min) * 100) / (max - min));
const parsedProgress = (Number(((input.value - min) * 100) / (max - min))).toFixed(2);

input.style.setProperty('--es-form-range-progress', `${parsedProgress}%`);
}

Expand Down
17 changes: 11 additions & 6 deletions src/Blocks/components/input/components/input-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,11 @@ export const InputOptions = (attributes) => {
value={inputMinLength}
onChange={(value) => setAttributes({ [getAttrKey('inputMinLength', attributes, manifest)]: value })}
min={options.inputMinLength.min}
max={options.inputMinLength.max}
step={options.inputMinLength.step}
disabled={isOptionDisabled(getAttrKey('inputMinLength', attributes, manifest), inputDisabledOptions)}
placeholder='–'
fixedWidth={4}
fixedWidth={5}
noBottomSpacing
/>

Expand All @@ -267,10 +268,11 @@ export const InputOptions = (attributes) => {
value={inputMaxLength}
onChange={(value) => setAttributes({ [getAttrKey('inputMaxLength', attributes, manifest)]: value })}
min={options.inputMaxLength.min}
max={options.inputMaxLength.max}
step={options.inputMaxLength.step}
disabled={isOptionDisabled(getAttrKey('inputMaxLength', attributes, manifest), inputDisabledOptions)}
placeholder='–'
fixedWidth={4}
fixedWidth={5}
noBottomSpacing
/>

Expand Down Expand Up @@ -400,10 +402,11 @@ export const InputOptions = (attributes) => {
value={inputMin}
onChange={(value) => setAttributes({ [getAttrKey('inputMin', attributes, manifest)]: formatNumber(value) })}
min={options.inputMin.min}
max={options.inputMin.max}
step={options.inputMin.step}
disabled={isOptionDisabled(getAttrKey('inputMin', attributes, manifest), inputDisabledOptions)}
placeholder='–'
fixedWidth={4}
fixedWidth={5}
noBottomSpacing
/>

Expand All @@ -426,10 +429,11 @@ export const InputOptions = (attributes) => {
value={inputMax}
onChange={(value) => setAttributes({ [getAttrKey('inputMax', attributes, manifest)]: formatNumber(value) })}
min={options.inputMax.min}
max={options.inputMax.max}
step={options.inputMax.step}
disabled={isOptionDisabled(getAttrKey('inputMax', attributes, manifest), inputDisabledOptions)}
placeholder='–'
fixedWidth={4}
fixedWidth={5}
noBottomSpacing
/>

Expand All @@ -453,11 +457,12 @@ export const InputOptions = (attributes) => {
<div className='es-display-flex es-items-end es-gap-2'>
<NumberPicker
value={inputStep}
onChange={(value) => setAttributes({ [getAttrKey('inputStep', attributes, manifest)]: formatNumber(value) })}
onChange={(value) => setAttributes({ [getAttrKey('inputStep', attributes, manifest)]: value })}
min={options.inputStep.min}
max={options.inputStep.max}
step={options.inputStep.step}
disabled={isOptionDisabled(getAttrKey('inputStep', attributes, manifest), inputDisabledOptions)}
fixedWidth={4}
fixedWidth={5}
noBottomSpacing
/>

Expand Down
Loading

0 comments on commit b658944

Please sign in to comment.