Skip to content

Commit

Permalink
Release 3.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
andergmartins committed Aug 22, 2024
1 parent 07255aa commit 8d9d436
Show file tree
Hide file tree
Showing 67 changed files with 1,801 additions and 1,333 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/release-free-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ To release the Free plugin, ensure you complete all the tasks below.
- [ ] Review updated packages and mention any production library updates in the changelog.
- [ ] Inspect GitHub’s Dependabot warnings or Pull Requests. Resolve any false positives, then fix and commit the remaining issues.
- [ ] If needed, build JS files for production using `composer build:js` and commit changes.
- [ ] Run `composer build:dir` to prepare the plugin for quality checks.
- [ ] Run a WP VIP scan with `composer check:phpcs` to ensure no warnings or errors greater than 5 exist.
- [ ] Run a code quality check with `composer check` and fix the highlighted issues.
- [ ] Update the language files with `composer gen:lang` and note this in the changelog.
- [ ] For minor and patch releases, maintain backward compatibility (e.g., renamed or moved classes, namespaces, functions). Include deprecation comments and note this in the changelog. Major releases may remove deprecated code; always note this in the changelog.
- [ ] Update the changelog in `/CHANGELOG.md` with a user-friendly description and correct release date.
Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/release-pro-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ To release the Pro plugin, ensure you complete all the tasks below.
- [ ] Check if the free plugin uses Composer's autoload and copy the autoload definition from the free plugin to the pro plugin refactoring the relative paths, on `/lib/composer.json`. Execute `composer dumpautoload` to update the autoload files. Commit the changes.
- [ ] Inspect GitHub’s Dependabot warnings or Pull Requests. Resolve any false positives, then fix and commit the remaining issues.
- [ ] If needed, build JS files for production using `composer build:js` and commit changes.
- [ ] Run `composer build:dir` to prepare the plugin for quality checks.
- [ ] Run a WP VIP scan with `composer check:phpcs` to ensure no warnings or errors greater than 5 exist.
- [ ] Run a code quality check with `composer check` and fix the highlighted issues.
- [ ] Update the language files with `composer gen:lang` and note this in the changelog.
- [ ] For minor and patch releases, maintain backward compatibility (e.g., renamed or moved classes, namespaces, functions). Include deprecation comments and note this in the changelog. Major releases may remove deprecated code; always note this in the changelog.
- [ ] Update the changelog in `/CHANGELOG.md` with a user-friendly description and correct release date.
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [3.4.4] - 21 Aug, 2024

### Fixed

- Improve notice message when scheduled action runs after pressing "run" (PR #896).
- Fixed support for the Event Espresso plugin (PR #900).
- Fixed React warning about createRoot being deprecated.
- Fixed empty fieldset displayed when the bos is disabled for the post type (Issue #792).
- Update language files.

### Changed

- Add tabs for post types in the post types settings page (PR #895).

### Added

- Added computed date preview to the general settings page (PR #897).
- Added option to hide the calendar by default in the future action panel (PR #899).
- Added new filter `publishpressfuture_posts_future_action_column_output` to the Future Action column.

## [3.4.3] - 06 Aug, 2024

### Changed
Expand Down
13 changes: 13 additions & 0 deletions assets/css/edit.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,16 @@ body.branch-6-6.edit-php .components-checkbox-control__input-container {
padding-top: 9px;
line-height: 2.2em;
}

/* Fix style on Event Espresso plugin */
body.espresso-admin #publishpress-future-classic-editor .components-checkbox-control__input-container svg,
body.espresso-admin #publishpress-future-classic-editor .components-input-control__suffix
{
visibility: hidden;
}

body.espresso-admin #publishpress-future-classic-editor .components-input-control__container .components-input-control__input {
border: 0;
min-width: 30px;
padding: 0 4px;
}
2 changes: 1 addition & 1 deletion assets/js/block-editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/block-editor.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/bulk-edit.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/bulk-edit.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/classic-editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/classic-editor.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/quick-edit.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/quick-edit.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions assets/js/settings-general.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/js/settings-general.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/settings-post-types.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/settings-post-types.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions assets/jsx/block-editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
taxonomyName,
postTypeDefaultConfig,
defaultDate,
statusesSelectOptions
statusesSelectOptions,
hideCalendarByDefault
} from "&config.block-editor";

const storeName = 'publishpress-future/future-action';
Expand Down Expand Up @@ -41,7 +42,9 @@ const BlockEditorFutureActionPlugin = () => {
storeName={storeName}
strings={strings}
taxonomyName={taxonomyName}
postTypeDefaultConfig={postTypeDefaultConfig} />
postTypeDefaultConfig={postTypeDefaultConfig}
hideCalendarByDefault={hideCalendarByDefault}
/>
);
}

Expand Down
6 changes: 4 additions & 2 deletions assets/jsx/bulk-edit.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FutureActionPanelBulkEdit } from './components';
import { createStore } from './data';
import { createRoot } from '@wordpress/element';
import { createRoot } from 'react-dom/client';
import { select, dispatch } from '@wordpress/data';
import { inlineEditPost } from "&window";
import {
Expand All @@ -15,7 +15,8 @@ import {
strings,
taxonomyName,
nonce,
statusesSelectOptions
statusesSelectOptions,
hideCalendarByDefault
} from "&config.bulk-edit";

const storeName = 'publishpress-future/future-action-bulk-edit';
Expand Down Expand Up @@ -92,6 +93,7 @@ inlineEditPost.setBulk = function (id) {
strings={strings}
taxonomyName={taxonomyName}
nonce={nonce}
hideCalendarByDefault={hideCalendarByDefault}
/>
);

Expand Down
7 changes: 4 additions & 3 deletions assets/jsx/classic-editor.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FutureActionPanelClassicEditor } from './components';
import { createStore } from './data';
import { isGutenbergEnabled } from './utils';
import { createRoot } from '@wordpress/element';
import { select } from '@wordpress/data';
import { createRoot } from 'react-dom/client';
import {
postType,
isNewPost,
Expand All @@ -14,9 +14,9 @@ import {
taxonomyName,
postTypeDefaultConfig,
defaultDate,
statusesSelectOptions
statusesSelectOptions,
hideCalendarByDefault
} from "&config.classic-editor";
import { render } from "react-dom";

if (! isGutenbergEnabled()) {
const storeName = 'publishpress-future/future-action';
Expand Down Expand Up @@ -48,6 +48,7 @@ if (! isGutenbergEnabled()) {
startOfWeek={startOfWeek}
strings={strings}
taxonomyName={taxonomyName}
hideCalendarByDefault={hideCalendarByDefault}
/>
);

Expand Down
99 changes: 99 additions & 0 deletions assets/jsx/components/DateOffsetPreview.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import {
useState,
useEffect,
useRef,
Fragment
} from '@wordpress/element';
import { addQueryArgs } from '@wordpress/url';
import { apiFetch } from '&wp';

require('./css/dateOffsetPreview.css');

export const DateOffsetPreview = ({
offset,
label,
labelDatePreview,
labelOffsetPreview,
setValidationErrorCallback,
setHasPendingValidationCallback,
setHasValidDataCallback,
compactView = false
}) => {
const [offsetPreview, setOffsetPreview] = useState('');
const [currentTime, setCurrentTime] = useState();

const apiRequestControllerRef = useRef(new AbortController());

const validateDateOffset = () => {
if (offset) {
const controller = apiRequestControllerRef.current;

if (controller) {
controller.abort();
}

apiRequestControllerRef.current = new AbortController();
const { signal } = apiRequestControllerRef.current;

setHasPendingValidationCallback(true);

apiFetch({
path: addQueryArgs(`publishpress-future/v1/settings/validate-expire-offset`),
method: 'POST',
data: {
offset
},
signal,
}).then((result) => {
setHasPendingValidationCallback(false);

setHasValidDataCallback(result.isValid);
setValidationErrorCallback(result.message);

if (result.isValid) {
setOffsetPreview(result.preview);
setCurrentTime(result.currentTime);
} else {
setOffsetPreview('');
}
}).catch((error) => {
if (error.name === 'AbortError') {
return;
}

setHasPendingValidationCallback(false);
setHasValidDataCallback(false);
setValidationErrorCallback(error.message);
setOffsetPreview('');
});
}
}

useEffect(() => {
validateDateOffset();
}, [offset]);

const compactClass = compactView ? ' compact' : '';

return (
<Fragment>
{ offset && (
<div className={'publishpress-future-date-preview' + compactClass}>
<h4>{ label }</h4>
<div className="publishpress-future-date-preview-body">
<div>
<span className="publishpress-future-date-preview-label">{ labelDatePreview }: </span>
<span className="publishpress-future-date-preview-value">{currentTime}</span>
</div>
<div>
<span className="publishpress-future-date-preview-label">{ labelOffsetPreview }: </span>
<span className="publishpress-future-date-preview-value">{offsetPreview}</span>
</div>
</div>
</div>
)}
</Fragment>
)
}

export default DateOffsetPreview;
47 changes: 34 additions & 13 deletions assets/jsx/components/FutureActionPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,35 @@ const {
const { apiFetch } = wp;

export const FutureActionPanel = (props) => {
const action = useSelect((select) => select(props.storeName).getAction(), []);
const date = useSelect((select) => select(props.storeName).getDate(), []);
const enabled = useSelect((select) => select(props.storeName).getEnabled(), []);
const terms = useSelect((select) => select(props.storeName).getTerms(), []);
const taxonomy = useSelect((select) => select(props.storeName).getTaxonomy(), []);
const taxonomyName = useSelect((select) => select(props.storeName).getTaxonomyName(), []);
const termsListByName = useSelect((select) => select(props.storeName).getTermsListByName(), []);
const termsListById = useSelect((select) => select(props.storeName).getTermsListById(), []);
const isFetchingTerms = useSelect((select) => select(props.storeName).getIsFetchingTerms(), []);
const calendarIsVisible = useSelect((select) => select(props.storeName).getCalendarIsVisible(), []);
const hasValidData = useSelect((select) => select(props.storeName).getHasValidData(), []);
const newStatus = useSelect((select) => select(props.storeName).getNewStatus(), []);
const {
action,
date,
enabled,
terms,
taxonomy,
taxonomyName,
termsListByName,
termsListById,
isFetchingTerms,
calendarIsVisible,
hasValidData,
newStatus,
} = useSelect((select) => {
return {
action: select(props.storeName).getAction(),
date: select(props.storeName).getDate(),
enabled: select(props.storeName).getEnabled(),
terms: select(props.storeName).getTerms(),
taxonomy: select(props.storeName).getTaxonomy(),
taxonomyName: select(props.storeName).getTaxonomyName(),
termsListByName: select(props.storeName).getTermsListByName(),
termsListById: select(props.storeName).getTermsListById(),
isFetchingTerms: select(props.storeName).getIsFetchingTerms(),
calendarIsVisible: select(props.storeName).getCalendarIsVisible(),
hasValidData: select(props.storeName).getHasValidData(),
newStatus: select(props.storeName).getNewStatus(),
};
});

const [validationError, setValidationError] = useState('');

Expand Down Expand Up @@ -178,7 +195,7 @@ export const FutureActionPanel = (props) => {
if (getCalendarIsVisibleFromStorage() === null) {
setCalendarIsVisible(props.calendarIsVisible);
} else {
setCalendarIsVisible(getCalendarIsVisibleFromStorage() === '1');
setCalendarIsVisible(getCalendarIsVisibleFromStorage() === '1' && ! props.hideCalendarByDefault);
}

// We need to get the value directly from the props because the value from the store is not updated yet
Expand Down Expand Up @@ -347,6 +364,7 @@ export const FutureActionPanel = (props) => {
label={props.strings.enablePostExpiration}
checked={enabled || false}
onChange={handleEnabledChange}
className="future-action-enable-checkbox"
/>
</PanelRow>
)}
Expand All @@ -359,6 +377,7 @@ export const FutureActionPanel = (props) => {
value={action}
options={actionsSelectOptions}
onChange={handleActionChange}
className="future-action-select-action"
/>
</PanelRow>

Expand All @@ -371,6 +390,7 @@ export const FutureActionPanel = (props) => {
options={props.statusesSelectOptions}
value={newStatus}
onChange={handleNewStatusChange}
className="future-action-select-new-status"
/>
</PanelRow>
}
Expand Down Expand Up @@ -413,6 +433,7 @@ export const FutureActionPanel = (props) => {
suggestions={termsListByNameKeys}
onChange={handleTermsChange}
placeholder={props.strings.addTermsPlaceholder}
className="future-action-terms"
maxSuggestions={1000}
onFocus={forceIgnoreAutoSubmitOnEnter}
__experimentalExpandOnFocus={true}
Expand Down
1 change: 1 addition & 0 deletions assets/jsx/components/FutureActionPanelBlockEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const FutureActionPanelBlockEditor = (props) => {
storeName={props.storeName}
strings={props.strings}
onDataIsValid={onDataIsValid}
hideCalendarByDefault={props.hideCalendarByDefault}
onDataIsInvalid={onDataIsInvalid} />
</div>
</PluginDocumentSettingPanel>
Expand Down
1 change: 1 addition & 0 deletions assets/jsx/components/FutureActionPanelBulkEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const FutureActionPanelBulkEdit = (props) => {
timeFormat={props.timeFormat}
startOfWeek={props.startOfWeek}
storeName={props.storeName}
hideCalendarByDefault={props.hideCalendarByDefault}
strings={props.strings} />
)}

Expand Down
1 change: 1 addition & 0 deletions assets/jsx/components/FutureActionPanelClassicEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const FutureActionPanelClassicEditor = (props) => {
storeName={props.storeName}
strings={props.strings}
onDataIsValid={onDataIsValid}
hideCalendarByDefault={props.hideCalendarByDefault}
onDataIsInvalid={onDataIsInvalid} />
</div>
);
Expand Down
1 change: 1 addition & 0 deletions assets/jsx/components/FutureActionPanelQuickEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const FutureActionPanelQuickEdit = (props) => {
storeName={props.storeName}
strings={props.strings}
onDataIsValid={onDataIsValid}
hideCalendarByDefault={props.hideCalendarByDefault}
onDataIsInvalid={onDataIsInvalid} />

{/* Quick edit JS code will save only fields with name inside the edit row */}
Expand Down
Loading

0 comments on commit 8d9d436

Please sign in to comment.