Skip to content

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
Tropicalista committed Dec 7, 2023
1 parent 0238b46 commit ed61513
Show file tree
Hide file tree
Showing 20 changed files with 81 additions and 76 deletions.
2 changes: 1 addition & 1 deletion assets/templates/templates.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/admin.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blob', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => 'a339aab71a12d7ab5b5d');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blob', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => 'b57de25f0f19d555cfc7');
11 changes: 5 additions & 6 deletions build/admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '6fac6b0f7f4e39ac0f74');
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'b13329298ae63819af9e');
8 changes: 4 additions & 4 deletions build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/style-index.css

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

2 changes: 1 addition & 1 deletion formello.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Formello
* Plugin URI: https://formello.net/
* Description: Lightweight Gutenberg contact form builder, blazingly fast with no external dependencies and ReCaptcha support.
* Version: 2.2.2
* Version: 2.3.0
* Author: Formello
* Author URI: https://formello.net
* License: GPL2
Expand Down
1 change: 0 additions & 1 deletion includes/Rest/Controllers/Submissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public function get_submissions( $request ) {

$submission_data = '';
foreach ( $columns as $column ) {
//$submission_data .= ", data->>'$." . $column . "' AS $column";
$submission_data .= ", JSON_UNQUOTE( JSON_EXTRACT( data, '$." . $column . "' ) ) AS $column";
}

Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: Formello, tropicalista
Donate link: https://formello.net
Tags: contact form, form builder, form block, gutenberg form, forms, gutenberg block, contact form plugin, forms, form builder, custom form, contact button, contact me, custom contact form, form manager, form, forms builder, forms creator, captcha, recaptcha, email form, web form, feedback form, email submit form, message form, contact form block, wordpress form plugin
Requires at least: 6.2.2
Requires at least: 6.4.2
Tested up to: 6.3
Stable tag: 2.2.2
Stable tag: 2.3.0
Requires PHP: 5.6
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -128,6 +128,11 @@ Yes, you can insert Formello forms using a shortcode.

== Changelog ==

= 2.3.0 =
* New datatable to manage submissions
* Code reduction and improvements
* Better handling of form submission

= 2.2.2 =
* Fix wrong CSS

Expand Down
30 changes: 16 additions & 14 deletions src/admin/pages/settings/components/integrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import {
Button,
} from '@wordpress/components';

import { RawHTML, Fragment, createInterpolateElement } from '@wordpress/element';
import {
RawHTML,
Fragment,
createInterpolateElement,
} from '@wordpress/element';

import { __, sprintf } from '@wordpress/i18n';

Expand All @@ -18,9 +22,14 @@ const IntegrationsTab = () => {
a: (
<Button
text={ __( 'addons page', 'search-console' ) }
onClick={ () =>
navigator.goTo( '/formello-addons/general' )
}
onClick={ () => {
window.dispatchEvent(
new CustomEvent( 'changePage', {
detail: '?page=formello-addons',
} )
);
navigator.goTo( '/formello-addons/general' );
} }
variant="link"
/>
),
Expand All @@ -35,19 +44,12 @@ const IntegrationsTab = () => {
<CardBody>
<p>
{ noticeString(
__( 'Go to <a /> to download your preferred integrations.', 'tropical-juice' )
) }
</p>
<RawHTML>
{ sprintf(
/* translators: Link to addons. */
__(
'<p>Go to %s to download your preferred integrations. We are working on other integrations.</p>',
'Go to <a /> to enable your preferred integrations.',
'formello'
),
`<a href="https://formello.net/addons/" target="_blank">addons page</a>`
)
) }
</RawHTML>
</p>
</CardBody>
</Card>
</Fragment>
Expand Down
11 changes: 3 additions & 8 deletions src/admin/pages/submissions/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ import {
*/
import { DataViews } from '../../components/dataviews';
import Header from '../../components/masthead.js';
import {
OPERATOR_IN,
ENUMERATION_TYPE,
} from '../../components/dataviews/constants';
import { OPERATOR_IN } from '../../components/dataviews/constants';

const EMPTY_ARRAY = [];
const defaultConfigPerViewType = {
Expand Down Expand Up @@ -186,8 +183,6 @@ export const Submissions = () => {
getValue: ( item ) => item[ key ],
filters: [ { id: 'search', type: 'search' } ],
render: ( { item } ) => {
console.log( typeof item.fields[ key ], item.fields[ key ] )

if ( 'submitted_at' === key ) {
const formattedDate = dateI18n(
getSettings().formats.datetimeAbbreviated,
Expand Down Expand Up @@ -250,7 +245,7 @@ export const Submissions = () => {
trashSubmissionAction,
{
id: 'mark-as-starred',
label: __( 'Mark as favorite' ),
label: __( 'Toggle favorite' ),
isPrimary: false,
isBulk: true,
isEligible: () => true,
Expand All @@ -264,7 +259,7 @@ export const Submissions = () => {
},
{
id: 'mark-as-new',
label: __( 'Mark as new' ),
label: __( 'Toggle new' ),
isPrimary: false,
isBulk: true,
icon: heading,
Expand Down
6 changes: 1 addition & 5 deletions src/admin/pages/tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@ export default function Tools() {
// Filter to add a tab
applyFilters( 'formello.ToolsTabs', '', toolsTabs );

const { goTo, params } = useNavigator();
const { params } = useNavigator();
const initialTab = params.tab || 'general';

const updateUrl = ( tabName ) => {
goTo( '/' + tabName );
};

return (
<Fragment>
<Header title={ __( 'Tools', 'formello' ) } />
Expand Down
10 changes: 2 additions & 8 deletions src/blocks/form/actions/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ import { __ } from '@wordpress/i18n';
import ClassicEdit from '../../../components/editor.js';
import MergeTags from '../../../components/merge-tags';

export default function Email(
content,
props,
action,
handleUpdate,
settingsUrl
) {
export default function Email( content, props, action, handleUpdate ) {
const { clientId } = props;

const id = `editor-${ clientId }`;
Expand Down Expand Up @@ -91,7 +85,7 @@ export default function Email(
} }
/>

<BaseControl label={ __( 'Message', 'formello' ) }>
<BaseControl label={ __( 'Message', 'formello' ) } id={ id }>
<ClassicEdit
id={ id }
value={ action.message }
Expand Down
20 changes: 7 additions & 13 deletions src/blocks/input/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ import Toolbar from '../../components/field-options/toolbar';

import { SUPPORTED_ATTRIBUTES } from '../../components/field-options/constants';

const getNameFromLabel = ( content ) => {
return (
content
// Convert anything that's not a letter or number to a hyphen.
.replace( /[^\p{L}\p{N}]+/gu, '_' )
// Convert to lowercase
.toLowerCase()
// Remove any remaining leading or trailing hyphens.
.replace( /(^-+)|(-+$)/g, '' )
);
};

export default function Edit( props ) {
const { attributes, setAttributes, clientId } = props;
const {
Expand All @@ -59,13 +47,19 @@ export default function Edit( props ) {
const idx = clientId.substr( 2, 6 ).replace( '-', '' ).replace( /-/g, '' );

useEffect( () => {
const idx = clientId
.substr( 2, 6 )
.replace( '-', '' )
.replace( /-/g, '' );
if ( ! id ) {
setAttributes( {
id: 'field_' + idx,
} );
}
if ( ! name ) {
setAttributes( { name: getNameFromLabel( label ) } );
setAttributes( {
name: 'field_' + idx,
} );
}
}, [] );

Expand Down
7 changes: 0 additions & 7 deletions src/blocks/input/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@ const variations = [
attributes: { type: 'tel' },
scope: [ 'inserter', 'transform' ],
},
{
name: 'textarea',
title: __( 'Textarea' ),
icon: Textarea,
attributes: { type: 'textarea' },
scope: [ 'inserter' ],
},
{
name: 'url',
title: __( 'Url' ),
Expand Down
1 change: 1 addition & 0 deletions src/components/field-options/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export const SUPPORTED_ATTRIBUTES = {
'id',
'required',
'value',
'type', // hack to use one component
'readonly',
'disabled',
'placeholder',
Expand Down
Loading

0 comments on commit ed61513

Please sign in to comment.