Skip to content

Commit

Permalink
update release
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed Oct 31, 2024
1 parent 145865e commit 73487eb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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.1.7]

### Fixed

- TalentLyft integration custom fields not being saved correctly.

## [5.1.6]

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

- Initial production release.

[5.1.6]: https://github.com/infinum/eightshift-forms/compare/5.1.6...5.1.7
[5.1.6]: https://github.com/infinum/eightshift-forms/compare/5.1.5...5.1.6
[5.1.5]: https://github.com/infinum/eightshift-forms/compare/5.1.4...5.1.5
[5.1.4]: https://github.com/infinum/eightshift-forms/compare/5.1.3...5.1.4
Expand Down
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.1.6
* Version: 5.1.7
* Text Domain: eightshift-forms
*
* @package EightshiftForms
Expand Down
19 changes: 14 additions & 5 deletions src/Integrations/Talentlyft/Talentlyft.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,34 @@ private function getFields(array $data, string $formId): array

$output = [];

dump($data['fields']);

foreach ($data['fields'] as $item) {
if (!$item) {
continue;
}

$customType = $item['FieldLocationType'] ?? '';
$key = $item['Key'] ?? '';

$type = $item['Type'] ?? '';
$name = isset($item['Key']) ? "q_{$item['Key']}" : '';
$tracking = $item['Key'] ?? '';
$name = !empty($key) ? "q_{$key}" : '';
$tracking = $key;
$label = $item['DisplayName'] ?? '';
$fields = $item['Choices'] ?? [];
$internalType = ($item['FieldLocationType'] ?? '') === 'ScreeningQuestions' ? 'answers' : $type;
$internalType = $type;
$required = isset($item['Required']) ? (bool) $item['Required'] : false;

if (!$name) {
$name = isset($item['Id']) ? "q_{$item['Id']}" : '';
}

if ($customType === 'ScreeningQuestions') {
$internalType = 'Answers';
}

if (empty($key)) {
$internalType = 'CustomFieldAnswers';
}

if (!$name) {
continue;
}
Expand Down
9 changes: 5 additions & 4 deletions src/Integrations/Talentlyft/TalentlyftClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public function getTestApi(): array
*/
private function getTalentlyftItems()
{
$url = "{$this->getBaseUrl()}jobs?perPage=100";
$url = "{$this->getBaseUrl()}jobs?perPage=100&status=internal";

$response = \wp_remote_get(
$url,
Expand Down Expand Up @@ -407,14 +407,15 @@ private function prepareParams(array $params, string $formId): array
$name = \preg_replace('/^q_/', '', $name);

switch ($typeCustom) {
case 'answers':
case 'Answers':
case 'CustomFieldAnswers':
if (\in_array($type, ['radio', 'select', 'checkbox'], true)) {
$output['Answers'][] = [
$output[$typeCustom][] = [
'Id' => (int) $name,
'Choices' => \explode(UtilsConfig::DELIMITER, $value),
];
} else {
$output['Answers'][] = [
$output[$typeCustom][] = [
'Id' => (int) $name,
'Body' => $value,
];
Expand Down

0 comments on commit 73487eb

Please sign in to comment.