Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.11 #1133

Merged
merged 107 commits into from
Oct 24, 2024
Merged

2.11 #1133

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
ae1aa22
Reapply "[ #1079 ] - class to handle uploads"
razvanaldea89 Sep 30, 2024
48df0aa
Reapply "[ #1060 ] - user rights check function"
razvanaldea89 Sep 30, 2024
adb013f
Reapply "[ #1065 ] - default location for media browser"
razvanaldea89 Sep 30, 2024
f41da47
version bump; changelog update;
razvanaldea89 Sep 30, 2024
6dd251d
version bump; [ #1048 ] - create Upload from folder button
razvanaldea89 Sep 30, 2024
54aa9aa
[ #1050 ] - folder browser implementation
razvanaldea89 Oct 1, 2024
d7a07cf
Merge branch '2.11' into 1050-task-32-browse-folder-functionality
razvanaldea89 Oct 1, 2024
31c5791
[ #1049 ] - folder browser modal
razvanaldea89 Oct 1, 2024
95c84be
[ #1050 ] - folder navigation
razvanaldea89 Oct 2, 2024
b1f8a4a
Merge pull request #1082 from WPChill/1049-task-24-folder-browse-modal
razvanaldea89 Oct 2, 2024
ff8da88
Merge branch '2.11' into 1050-task-32-browse-folder-functionality
razvanaldea89 Oct 2, 2024
e3541f5
Merge pull request #1081 from WPChill/1050-task-32-browse-folder-func…
razvanaldea89 Oct 2, 2024
a71b154
[ #1056 ] - folders validation
razvanaldea89 Oct 2, 2024
539d8fe
Merge pull request #1083 from WPChill/1056-task-33-implement-folder-v…
razvanaldea89 Oct 2, 2024
64950e0
[ #1057 ] - files validation
razvanaldea89 Oct 3, 2024
7af9a75
[ #1051 ] - import files to media library
razvanaldea89 Oct 3, 2024
faf326e
[ #1058 ] - update gallery post meta
razvanaldea89 Oct 3, 2024
af8a746
[ #1074 ] - import progress
razvanaldea89 Oct 4, 2024
9c4ac9b
Merge pull request #1084 from WPChill/1057-task-34-implement-file-sel…
razvanaldea89 Oct 7, 2024
31d71eb
[ #1055 ] - error messages in case files did not import
razvanaldea89 Oct 7, 2024
9876570
[ #1059 ] - refresh gallery view
razvanaldea89 Oct 7, 2024
9d7931a
Merge pull request #1085 from WPChill/1051-task-35-import-selected-im…
razvanaldea89 Oct 7, 2024
682050e
Merge pull request #1086 from WPChill/1058-task-36-update-postmeta-wi…
razvanaldea89 Oct 7, 2024
2992f4f
Merge pull request #1091 from WPChill/1074-task-25-create-upload-proc…
razvanaldea89 Oct 7, 2024
bccb492
Merge pull request #1092 from WPChill/1055-task-23-add-error-messages…
razvanaldea89 Oct 7, 2024
bf535f4
Merge pull request #1093 from WPChill/1059-task-37-refresh-backbone-g…
razvanaldea89 Oct 7, 2024
0367a0e
[ #1054 ] - add success notice on folder import done
razvanaldea89 Oct 7, 2024
c26c736
[ #1088 ] - keep/delete original files
razvanaldea89 Oct 8, 2024
e187f1c
[ #1049 ] - modal design
razvanaldea89 Oct 8, 2024
25b9407
enqueue common css
razvanaldea89 Oct 8, 2024
a78468d
minor design update
razvanaldea89 Oct 8, 2024
d549ca6
[ #1066 ] - add upload zip button
razvanaldea89 Oct 8, 2024
a94e9eb
[ #1066 ] - minor update
razvanaldea89 Oct 8, 2024
c0578a9
[ #1070 ] - create folder for zip uploads
razvanaldea89 Oct 9, 2024
9dc5ed0
[ #1078 ] - check if zip file
razvanaldea89 Oct 9, 2024
811f267
[ #1053 ] - file upload process
razvanaldea89 Oct 9, 2024
2eb126c
[ #1069 ] - unzip the uploaded file
razvanaldea89 Oct 10, 2024
a93589b
[ #1073 ] - add images to gallery - follow folder upload
razvanaldea89 Oct 10, 2024
fac2ba2
non-generic query selector
razvanaldea89 Oct 10, 2024
94ff4ac
error handler
razvanaldea89 Oct 10, 2024
b59988a
re-do send folders button state
razvanaldea89 Oct 10, 2024
78e0145
[ #1103 ]
TeoAlex Oct 10, 2024
0e95f99
[ #1104 ]
TeoAlex Oct 10, 2024
94002fa
version bump; minified files; initialize uploaders only in edit screen
razvanaldea89 Oct 10, 2024
04704f7
Merge pull request #1094 from WPChill/1054-task-22-add-success-messag…
razvanaldea89 Oct 10, 2024
be193fe
Merge pull request #1095 from WPChill/1088-add-a-deletekeep-original-…
razvanaldea89 Oct 10, 2024
9c8d4ec
Merge pull request #1096 from WPChill/folder-browse-modal
razvanaldea89 Oct 10, 2024
f54d13e
Merge pull request #1098 from WPChill/1066-task-21-create-upload-zip-…
razvanaldea89 Oct 10, 2024
c57d3f7
filename + timestamp instead of file name for unzipped folder
razvanaldea89 Oct 10, 2024
be9c4b1
[ #1072 ] - upload process for zip files
razvanaldea89 Oct 11, 2024
df7faf0
[ #1105 ]
TeoAlex Oct 11, 2024
d23ff5d
[ #1114 ] - recursive folder scan
razvanaldea89 Oct 11, 2024
5f0f275
remove global var
razvanaldea89 Oct 11, 2024
32059b1
Merge pull request #1100 from WPChill/1070-task-31-create-temp-folder…
razvanaldea89 Oct 11, 2024
9fa7e17
Merge pull request #1101 from WPChill/1078-task-32-zip-file-validation
razvanaldea89 Oct 11, 2024
0b5d7b6
Merge pull request #1102 from WPChill/1053-task-33-upload-zip-file-in…
razvanaldea89 Oct 11, 2024
110bb4c
Merge pull request #1109 from WPChill/1069-task-34-unzip-uploaded-file
razvanaldea89 Oct 11, 2024
1ac53ba
Merge pull request #1110 from WPChill/1073-task-35-follow-fast-upload…
razvanaldea89 Oct 11, 2024
e7202bb
rename class
razvanaldea89 Oct 11, 2024
59eba05
Merge pull request #1111 from WPChill/pr-requests-fixes
razvanaldea89 Oct 11, 2024
d2a1100
[ #1071 ] - notice dismiss function
razvanaldea89 Oct 11, 2024
5b4e2a3
[ #1106 ]
TeoAlex Oct 11, 2024
355df8d
[ #1106 ]
TeoAlex Oct 11, 2024
2abfce7
individual class scripts
razvanaldea89 Oct 11, 2024
66aeb96
Merge pull request #1112 from WPChill/1103-notifications-processing
TeoAlex Oct 11, 2024
d718d8c
recursive folders listing fix; folder import progress fix; progress c…
razvanaldea89 Oct 14, 2024
cde4e0f
[ #1107 ]
TeoAlex Oct 14, 2024
e12d672
non-delete import still deleted the files fix
razvanaldea89 Oct 14, 2024
6a970c8
lint apps
TeoAlex Oct 14, 2024
f26854d
Revert "lint apps"
TeoAlex Oct 14, 2024
7a8c960
[ #1122 ]
TeoAlex Oct 14, 2024
3d1c039
minified css
razvanaldea89 Oct 14, 2024
354b03f
Merge pull request #1123 from WPChill/1107-notification-buttons
TeoAlex Oct 15, 2024
edf9db2
Merge pull request #1120 from WPChill/1106-notification-modal
TeoAlex Oct 15, 2024
673101d
Merge pull request #1119 from WPChill/1105-notification-icons
TeoAlex Oct 15, 2024
f3a7fa8
Merge pull request #1113 from WPChill/1104-notifications-rest-api
TeoAlex Oct 15, 2024
d0e2532
[ #1108 ] lite notifications & small fixes
TeoAlex Oct 15, 2024
be4b6fa
[ #1108 ] show count & refetch
TeoAlex Oct 16, 2024
d59e321
small changes
TeoAlex Oct 16, 2024
f65f0f0
lista de erori nu se actualiza in 'real time'
TeoAlex Oct 16, 2024
c526b08
undefined function fix
razvanaldea89 Oct 18, 2024
8dcfdf9
text, logo changes & removed close button
TeoAlex Oct 21, 2024
ffd14df
upsells instagram & content galleries & positioning
TeoAlex Oct 23, 2024
a6877be
Merge pull request #1128 from WPChill/2.11.1
razvanaldea89 Oct 23, 2024
214c0d7
naming change
razvanaldea89 Oct 23, 2024
4e0984e
Merge pull request #1116 from WPChill/1072-task-24-create-upload-proc…
razvanaldea89 Oct 23, 2024
3850fd5
remove commented lines
razvanaldea89 Oct 23, 2024
47c5e2e
[ #1108 ]
TeoAlex Oct 23, 2024
2681428
Merge pull request #1117 from WPChill/1114-upload-zipped-folders-is-n…
razvanaldea89 Oct 23, 2024
9b5efe4
Merge pull request #1118 from WPChill/1071-task-23-create-error-messa…
razvanaldea89 Oct 23, 2024
cc08431
Merge pull request #1121 from WPChill/individual-class-scripts
razvanaldea89 Oct 23, 2024
66450ac
Merge pull request #1124 from WPChill/bug-fixes
razvanaldea89 Oct 23, 2024
79d838b
Merge pull request #1125 from WPChill/1108-change-lite-notifications-…
TeoAlex Oct 23, 2024
d446265
Merge branch '2.11' into pr-fixes-2
razvanaldea89 Oct 23, 2024
3951ed6
Merge pull request #1129 from WPChill/pr-fixes-2
razvanaldea89 Oct 23, 2024
feef99a
Merge branch '2.11' into 2.11.1
razvanaldea89 Oct 23, 2024
c05c9ce
Merge pull request #1130 from WPChill/2.11.1
razvanaldea89 Oct 23, 2024
73a8929
he package; built files
razvanaldea89 Oct 23, 2024
4703e3a
Import process completed notification
TeoAlex Oct 24, 2024
c0e1d32
notification for upload errors
razvanaldea89 Oct 24, 2024
7279e2f
enqueue notifications only on modula admin pages
razvanaldea89 Oct 24, 2024
755e8fd
small fix for error files check
razvanaldea89 Oct 24, 2024
18b1215
Merge pull request #1131 from WPChill/fast-uploading-notifications
razvanaldea89 Oct 24, 2024
2e5425c
Merge pull request #1132 from WPChill/notice-button-everywhere
razvanaldea89 Oct 24, 2024
aa42729
update changelog
razvanaldea89 Oct 24, 2024
64aceee
Merge branch 'master' into 2.11
razvanaldea89 Oct 24, 2024
ddf5a4c
updated notifications REST url
TeoAlex Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ node_modules/*
vendor
assets/.DS_Store
.php-cs-fixer.cache
.wp-env.json
.wp-env.json
assets/js/admin/notification-system/*
5 changes: 3 additions & 2 deletions Modula.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://wp-modula.com/
* Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
* Author: WPChill
* Version: 2.10.3
* Version: 2.11.0
* Author URI: https://www.wpchill.com/
* License: GPLv3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -47,11 +47,12 @@
* @since 2.0.2
*/

define( 'MODULA_LITE_VERSION', '2.10.3' );
define( 'MODULA_LITE_VERSION', '2.11.0' );
define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) );
define( 'MODULA_URL', plugin_dir_url( __FILE__ ) );
defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL', 'https://wp-modula.com' );
defined( 'MODULA_PRO_STORE_UPGRADE_URL' ) || define( 'MODULA_PRO_STORE_UPGRADE_URL', 'https://wp-modula.com/pricing' );
define( 'MODULA_REMOTE_NOTIFICATIONS_URL', 'https://wp-modula.com/wp-json/notifications/v1/get' );
define( 'MODULA_FILE', plugin_basename( __FILE__ ) );

define( 'MODULA_LITE_TRANSLATE', dirname( plugin_basename( __FILE__ ) ) . '/languages' );
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions apps/notification-system/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import './index.scss';
import { QueryClientProvider } from '@tanstack/react-query';
import { queryClient } from './query/client';
import { Notifications } from './notifications';
import { StateProvider } from './state/state';
import { createRoot } from '@wordpress/element';

document.addEventListener('DOMContentLoaded', () => {
const postsContainer = document.getElementById('wpwrap');
if (postsContainer) {
const div = document.createElement('div');
const wrapper = document.createElement('div');
wrapper.setAttribute('id', 'modula-notifications-wrapper');
wrapper.classList.add('modula-best-grid-gallery');
div.setAttribute('id', 'modula-notifications-root');

postsContainer.prepend(wrapper);
wrapper.appendChild(div);
const root = createRoot(
document.getElementById('modula-notifications-root')
);

root.render(
<QueryClientProvider client={queryClient}>
<StateProvider>
<Notifications />
</StateProvider>
</QueryClientProvider>
);
}
});
109 changes: 109 additions & 0 deletions apps/notification-system/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#modula-notifications-root {
position: fixed;
right: 20px;
bottom: 25px;
z-index: 9999;
padding: 10px;
.notification-log-empty{
padding: 5px;
}
.notification-container {
position: absolute;
width: 500px;
right: 0;
bottom: 80px;
background: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
.notification-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px;
background-color: #f9f9f9;
border-bottom: 0;
h2 {
font-size: 1.1em;
margin: 8px;
}
button{
.dashicons{
margin: 0;
}
}
}
.notification-footer {
display: flex;
align-items: center;
justify-content: center;
background-color: #f9f9f9;
}
.notification-state {
width: 10px;
height: 10px;
margin-right: 10px;
border-radius: 50%;
position: relative;
top: 1px;

}
.notification-state.error{
background-color: #d63638;
}
.notification-state.warning{
background-color: #dba617;
}
.notification-state.info{
background-color: #2271b1;
}
.notification-state.success{
background-color: #00a32a;
}
.notification_dismiss_button{
margin-left: auto;
padding: 0;
height: auto;
}
.components-panel {
max-height: 250px;
overflow: auto;
.notification-row{
.notification-actions-wrapp{
a, button{
margin-right: 10px;
}
}
}
}
}
.notification-icon {
width: 45px;
height: 45px;
border-radius: 50%;
border: 1px solid #222222;
box-shadow: 0 0 5px #222222 ;
background: #fff;
display: flex;
justify-content: center;
align-items: center;
position: relative;
cursor: pointer;
padding: 4px;
.warn-icon {
position: absolute;
top: -6px;
left: -8px;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #d63638;
}

.notification-icon-img {
width: 100%;
}
}
}
20 changes: 20 additions & 0 deletions apps/notification-system/notification-icon.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import modulaIcon from './images/modula-logo-black.png';
import { useModulaState } from './state/use-modula-state';
import { setShowContainer } from './state/actions';

export function NotificationIcon( { notifications } ) {
const { state, dispatch } = useModulaState();
const { showContainer, visibleNotifications } = state;
const handleClick = () => {
dispatch( setShowContainer( showContainer? false: true ) );
};

return (
<div className="notification-icon" onClick={handleClick}>
<img src={modulaIcon} className="notification-icon-img"/>
<span className="warn-icon">
{visibleNotifications.length}
</span>
</div>
);
}
34 changes: 34 additions & 0 deletions apps/notification-system/notification/notification-actions.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { __ } from '@wordpress/i18n';
import { Button } from '@wordpress/components';
import he from 'he';

export function NotificationActions( { actions, id, onDismiss } ) {

const handleClick = (action, id) => {
if (action.callback && typeof window[action.callback] === 'function') {
window[action.callback](action, id);
}

if (action.dismiss) {
onDismiss(id);
}
};

return (
<div className="notification-actions-wrapp">
{actions.map((action, index) => (
<Button
key={index}
className={action.class || 'notification-action'}
{...(action.url ? { href: action.url } : {})}
{...(action.id ? { id: action.id } : {})}
target={action.target || ''}
text={he.decode(action.label || __('Action', 'modula-best-grid-gallery'))}
variant={action.variant || 'secondary'}
size={action.size || 'small'}
onClick={() => handleClick(action, id)}
/>
))}
</div>
);
}
19 changes: 19 additions & 0 deletions apps/notification-system/notification/notifications-footer.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { __ } from '@wordpress/i18n';
import { useModulaState } from '../state/use-modula-state';
import { setClosedBubble } from '../state/actions';
import { Button } from '@wordpress/components';
import { useNotificationsDismiss } from '../query/useNotificationsDismiss';
export function NotificationsFooter() {
const { dispatch } = useModulaState();
const mutation = useNotificationsDismiss();
const closePanel = () => {
dispatch( setClosedBubble( true ) );
mutation.mutate();
};

return(
<Button className="dismiss_all_notifications" onClick={closePanel}>
{__(' Dismiss All Notifications', 'modula-best-grid-gallery')}
</Button>
);
}
19 changes: 19 additions & 0 deletions apps/notification-system/notification/notifications-head.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { __ } from '@wordpress/i18n';
import { useModulaState } from '../state/use-modula-state';
import { setShowContainer } from '../state/actions';
import { Button } from '@wordpress/components';

export function NotificationsHead() {
const { dispatch } = useModulaState();

const closePanel = () => {
dispatch( setShowContainer( false ) );
};

return <>
<h2>{__('Modula Notification Center', 'modula-best-grid-gallery')}</h2>
<Button onClick={closePanel}>
<span className="dashicons dashicons-no-alt" ></span>
</Button>
</>;
}
82 changes: 82 additions & 0 deletions apps/notification-system/notification/notifications-list.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { useEffect } from '@wordpress/element';
import { Panel, PanelBody, PanelRow, __experimentalText as Text, Button } from '@wordpress/components';
import { Markup } from 'interweave';
import { __ } from '@wordpress/i18n';
import { useNotificationDismiss } from '../query/useNotificationDismiss';
import { useQueryClient } from '@tanstack/react-query';
import { NotificationActions } from './notification-actions';
import { useModulaState } from '../state/use-modula-state';
import { setOpenPanels, setVisibleNotifications } from '../state/actions';

export function NotificationsList() {
const mutation = useNotificationDismiss();
const queryClient = useQueryClient();
const { state, dispatch } = useModulaState();
const {visibleNotifications, openPanels} = state;

const dismissNotification = (id) => {
mutation.mutate( id, {
onSettled: () => {
queryClient.invalidateQueries(['notifications']);
},
} );
setVisibleNotifications(prevNotifications =>
prevNotifications.filter(notification => notification.id !== id)
);
};

useEffect(() => {

visibleNotifications.forEach( (notification) => {
if (notification.timed && openPanels.includes( notification.id ) ) {
setTimeout(() => {
dismissNotification(notification.id);
}, notification.timed);
}
});

}, [visibleNotifications, openPanels] );

const handleTogglePanel = (id) => {
dispatch(setOpenPanels( [ ...openPanels, id ]));
};

return (
<Panel>
{visibleNotifications?.length === 0 && (
<div className="notification-log-empty">
<Text>{__('No notifications!', 'modula-best-grid-gallery')}</Text>
</div>
)}
{visibleNotifications?.length > 0 &&
visibleNotifications?.map((notification) => (
<PanelBody
title={
<>
<span className={`notification-state ${notification?.status}`}></span>
<span className="notification-title">{notification?.title}</span>
</>
}
key={notification?.id}
initialOpen={false}
isOpen={openPanels.includes( notification.id )}
onToggle={() => handleTogglePanel(notification.id)}
>
<PanelRow className='notification-row'>
<Text variant="muted">
<Markup content={notification.message} />
</Text>
{ (notification?.dismissible === undefined || notification.dismissible) &&
<Button className="notification_dismiss_button" onClick={() => dismissNotification(notification.id)}>
{__('Dismiss', 'modula-best-grid-gallery')}
</Button>}
</PanelRow>
{(notification?.actions !== undefined && notification.actions.length > 0) &&
<PanelRow className='notification-row'>
<NotificationActions actions={notification.actions} id={notification.id} onDismiss={dismissNotification} />
</PanelRow>}
</PanelBody>
))}
</Panel>
);
}
19 changes: 19 additions & 0 deletions apps/notification-system/notifications-container.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { __ } from '@wordpress/i18n';
import { NotificationsList } from './notification/notifications-list';
import { NotificationsHead } from './notification/notifications-head';
import { NotificationsFooter } from './notification/notifications-footer';

export function NotificationsContainer() {

return (
<div className="notification-container">
<div className="notification-header">
<NotificationsHead />
</div>
<NotificationsList />
<div className="notification-footer">
<NotificationsFooter />
</div>
</div>
);
}
Loading
Loading