Skip to content

Commit

Permalink
[SFT-1701]: adding more features to lite and express (#1708)
Browse files Browse the repository at this point in the history
* feat(SFT-1701): adding more features to lite and express
* feat(SFT-1701): updating translations

---------

Co-authored-by: kjmartens <[email protected]>
  • Loading branch information
gustavs-gutmanis and kjmartens authored Jan 13, 2025
1 parent c79932d commit 3f13285
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "solspace/craft-freeform",
"description": "The most reliable form builder that's ready for wherever your project takes you.",
"version": "5.8.6",
"version": "5.8.6.1",
"type": "craft-plugin",
"authors": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use GuzzleHttp\Client;
use Solspace\Freeform\Attributes\Integration\Type;
use Solspace\Freeform\Attributes\Property\Edition;
use Solspace\Freeform\Attributes\Property\Flag;
use Solspace\Freeform\Attributes\Property\Input;
use Solspace\Freeform\Attributes\Property\Middleware;
Expand Down Expand Up @@ -35,8 +34,6 @@ class ReCaptcha extends BaseIntegration implements CaptchaIntegrationInterface
public const BEHAVIOR_DISPLAY_ERROR = 'display-error';
public const BEHAVIOR_SEND_TO_SPAM = 'send-to-spam';

#[Edition(Edition::PRO)]
#[Edition(Edition::LITE)]
#[Flag(self::FLAG_AS_HIDDEN_IN_INSTANCE)]
#[Input\Select(
label: 'Captcha Type',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use GuzzleHttp\Client;
use Solspace\Freeform\Attributes\Integration\Type;
use Solspace\Freeform\Attributes\Property\Edition;
use Solspace\Freeform\Attributes\Property\Flag;
use Solspace\Freeform\Attributes\Property\Input;
use Solspace\Freeform\Attributes\Property\Middleware;
Expand All @@ -17,8 +16,6 @@
use Solspace\Freeform\Library\Integrations\EnabledByDefault\EnabledByDefaultTrait;
use Solspace\Freeform\Library\Integrations\Types\Captchas\CaptchaIntegrationInterface;

#[Edition(Edition::PRO)]
#[Edition(Edition::LITE)]
#[Type(
name: 'Turnstile',
type: Type::TYPE_CAPTCHAS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use GuzzleHttp\Client;
use Solspace\Freeform\Attributes\Integration\Type;
use Solspace\Freeform\Attributes\Property\Edition;
use Solspace\Freeform\Attributes\Property\Flag;
use Solspace\Freeform\Attributes\Property\Input;
use Solspace\Freeform\Attributes\Property\Validators\Required;
Expand All @@ -17,8 +16,6 @@
use Solspace\Freeform\Library\Integrations\EnabledByDefault\EnabledByDefaultTrait;
use Solspace\Freeform\Library\Integrations\Types\Captchas\CaptchaIntegrationInterface;

#[Edition(Edition::PRO)]
#[Edition(Edition::LITE)]
#[Type(
name: 'hCaptcha',
type: Type::TYPE_CAPTCHAS,
Expand Down
6 changes: 2 additions & 4 deletions packages/plugin/src/controllers/SubmissionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ public function actionIndex(?string $formHandle = null): Response
$registerAssetsEvent = new RegisterEvent(\Craft::$app->view);
$this->trigger(self::EVENT_REGISTER_INDEX_ASSETS, $registerAssetsEvent);

if (Freeform::getInstance()->isPro()) {
if (PermissionHelper::checkPermission(Freeform::PERMISSION_ACCESS_QUICK_EXPORT)) {
\Craft::$app->view->registerAssetBundle(ExportButtonBundle::class);
}
if (PermissionHelper::checkPermission(Freeform::PERMISSION_ACCESS_QUICK_EXPORT)) {
\Craft::$app->view->registerAssetBundle(ExportButtonBundle::class);
}

$forms = $this->getFormsService()->getAllForms();
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin/src/templates/export/profiles/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{% block actionButton %}

{% if craft.freeform.pro and currentUser.can("freeform-pro-exportProfilesManage") %}
{% if freeform.edition.atLeast('lite') and currentUser.can("freeform-pro-exportProfilesManage") %}

<div class="buttons">
{% if forms|length %}
Expand Down Expand Up @@ -108,10 +108,10 @@
</table>
{% else %}
<div class="zilch">
{% if freeform.pro %}
{% if freeform.edition.atLeast('lite') %}
{{ "No export profiles exist yet."|t("freeform") }}
{% else %}
{{ "Upgrade to the Pro edition of Freeform to get access to Export Profiles."|t('freeform') }}
{{ "Upgrade to the Lite or Pro edition of Freeform to get access to Export Profiles."|t('freeform') }}
{% endif %}
</div>
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions packages/plugin/src/translations/de/freeform.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@
'Profiles' => 'Profile',
'Export Profiles' => 'Export-Profile',
'No export profiles found' => 'Keine Export-Profile gefunden',
'Upgrade to the Lite or Pro edition of Freeform to get access to Export Profiles.' => 'Führen Sie ein Upgrade auf die Lite- oder Pro-Edition von Freeform durch, um Zugriff auf Exportprofile zu erhalten.',
'Export' => 'Exportieren',
'New Export Profile' => 'Neues Export-Profil',
'Create a new Export Profile' => 'Ein neues Export-Profil erstellen',
Expand Down
1 change: 1 addition & 0 deletions packages/plugin/src/translations/en/freeform.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@
'Profiles' => 'Profiles',
'Export Profiles' => 'Export Profiles',
'No export profiles found' => 'No export profiles found',
'Upgrade to the Lite or Pro edition of Freeform to get access to Export Profiles.' => 'Upgrade to the Lite or Pro edition of Freeform to get access to Export Profiles.',
'Export' => 'Export',
'New Export Profile' => 'New Export Profile',
'Create a new Export Profile' => 'Create a new Export Profile',
Expand Down
1 change: 1 addition & 0 deletions packages/plugin/src/translations/fr/freeform.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@
'Profiles' => 'Profils',
'Export Profiles' => 'Profils d’exportation',
'No export profiles found' => 'Aucun profil d’exportation trouvé',
'Upgrade to the Lite or Pro edition of Freeform to get access to Export Profiles.' => 'Passez à l’édition Lite ou Pro de Freeform pour accéder aux profils d’exportation.',
'Export' => 'Exporter',
'New Export Profile' => 'Nouveau profil d’exportation',
'Create a new Export Profile' => 'Créer un nouveau profil d’exportation',
Expand Down
1 change: 1 addition & 0 deletions packages/plugin/src/translations/it/freeform.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@
'Profiles' => 'Profili',
'Export Profiles' => 'Esporta Profili',
'No export profiles found' => 'Nessun profilo di esportazione trovato',
'Upgrade to the Lite or Pro edition of Freeform to get access to Export Profiles.' => 'Esegui l’upgrade all’edizione Lite o Pro di Freeform per ottenere l’accesso ai profili di esportazione.',
'Export' => 'Esporta',
'New Export Profile' => 'Nuovo Profilo di Esportazione',
'Create a new Export Profile' => 'Crea un nuovo Profilo di Esportazione',
Expand Down
1 change: 1 addition & 0 deletions packages/plugin/src/translations/nl/freeform.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@
'Profiles' => 'Profielen',
'Export Profiles' => 'Profielen exporteren',
'No export profiles found' => 'Geen exportprofielen gevonden',
'Upgrade to the Lite or Pro edition of Freeform to get access to Export Profiles.' => 'Upgrade naar de Lite- of Pro-editie van Freeform om toegang te krijgen tot exportprofielen.',
'Export' => 'Exporteren',
'New Export Profile' => 'Nieuw exportprofiel',
'Create a new Export Profile' => 'Maak een nieuw exportprofiel',
Expand Down

0 comments on commit 3f13285

Please sign in to comment.