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

Feature - User Roles and Permission #1385

Merged
merged 36 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c4f697e
Added - Setup for User roles and permission
NirajChaudhary143 Dec 9, 2024
a4b7804
Added - APi Setup for User roles and permission tool
NirajChaudhary143 Dec 9, 2024
25affc9
Added - user model display Popup
NirajChaudhary143 Dec 9, 2024
cfe5ceb
Added - Add user permission form
NirajChaudhary143 Dec 9, 2024
eb3c00f
Adde - API code to add manager
NirajChaudhary143 Dec 9, 2024
bc91eca
Added - Form validation in Roles and permission
NirajChaudhary143 Dec 9, 2024
be30b0c
Added - User role permission added to perticular user
NirajChaudhary143 Dec 10, 2024
bc57a7e
Added - User role table
NirajChaudhary143 Dec 11, 2024
371fd2d
Added - User Edit permission
NirajChaudhary143 Dec 11, 2024
2c63f3c
Fix - Add permission select issue
NirajChaudhary143 Dec 11, 2024
a3dc72c
Added - User permission delete done
NirajChaudhary143 Dec 11, 2024
88857be
Added - Bulk assign permission based on Role
NirajChaudhary143 Dec 11, 2024
366c173
Added - remove permissions when unchecked
NirajChaudhary143 Dec 12, 2024
4d974dc
Added - Bulk delete user roles and permission
NirajChaudhary143 Dec 12, 2024
bbc063e
Added - Pagination in user roles and permission
NirajChaudhary143 Dec 12, 2024
a7e0b14
Fix - Role select on load issue
NirajChaudhary143 Dec 13, 2024
0126ba0
Added - grunt file of roles and permission
NirajChaudhary143 Dec 13, 2024
fd3f308
HTml Structure changed
deepench Dec 17, 2024
d07e027
tools class added
ayushstha1443 Dec 17, 2024
d93462a
tools design fix
ayushstha1443 Dec 17, 2024
7d2d62e
Added - Tab in tools
deepench Dec 18, 2024
45bf93f
Logs deisgn revamp
deepench Dec 18, 2024
dd2f9fd
icons fixed
ayushstha1443 Dec 18, 2024
587cd2c
Merge branch 'EVF-1316-tools-design-revamp' of github.com:wpeverest/e…
ayushstha1443 Dec 18, 2024
1193dc6
tools settings design fixed
ayushstha1443 Dec 19, 2024
1445569
tools design fixed
ayushstha1443 Dec 23, 2024
84a1b69
Added - Search manager by name and email
NirajChaudhary143 Jan 3, 2025
db6d89f
Fix - Search by display name issue
NirajChaudhary143 Jan 3, 2025
8682c3e
Added - Multiple manager at once
NirajChaudhary143 Jan 3, 2025
1acb57f
Fix - PHPCS issue in roles and permission
NirajChaudhary143 Jan 3, 2025
162b132
Fix - Design issue in pagination
NirajChaudhary143 Jan 6, 2025
46351e7
Fix - Design issue for no data found
NirajChaudhary143 Jan 6, 2025
7d7ee1b
Fix - Update table on user added
NirajChaudhary143 Jan 6, 2025
5d1ba95
Fix - Table re-render on delete manager
NirajChaudhary143 Jan 7, 2025
ce68452
Fix - Delete popup design issue
NirajChaudhary143 Jan 7, 2025
c2a9896
Merge branch 'pre-develop' into EVF-1210-feature/roles-and-permission
NirajChaudhary143 Jan 7, 2025
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
21,042 changes: 10,769 additions & 10,273 deletions assets/css/admin.scss

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions assets/images/tools-icons/api_logs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/images/tools-icons/collapse-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/images/tools-icons/export.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/images/tools-icons/form_migrator.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/images/tools-icons/import.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/images/tools-icons/logs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/images/tools-icons/open.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/images/tools-icons/payment_log.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/images/tools-icons/roles_and_permission.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions assets/images/tools-icons/system_info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions assets/js/admin/tools.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,81 @@
/* global everest_forms_admin_tools */
jQuery(function ($) {

$(document).ready(function () {
const tabs = $('.everest-forms-tabs li');
const contents = $('.everest-forms-tab-content');

tabs.on('click', function () {
tabs.removeClass('active');
contents.removeClass('active');

$(this).addClass('active');
$('#' + $(this).data('tab')).addClass('active');
});
});

// collapse

// Handles collapse of side menu.
$("#evf-settings-collapse").on("click", function (e) {
e.preventDefault();
if ($(this).hasClass("close")) {
$(this).closest("header").addClass("collapsed");
$(this).removeClass("close").addClass("open");
setStorageValue("evf-settings-navCollapsed", true); // set to localStorage
} else {
$(this).closest("header").removeClass("collapsed");
$(this).removeClass("open").addClass("close");
localStorage.removeItem("evf-settings-navCollapsed"); // remove from localStorage
}
});

// Persist the collapsable state through page reload

var isNavCollapsed =
getStorageValue("evf-settings-navCollapsed") === true
? "collapsed"
: "not-collapsed";
getStorageValue("evf-settings-navCollapsed");
if (isNavCollapsed == "collapsed") {
$(".everest-forms-header").addClass("collapsed");
$("#evf-settings-collapse").removeClass("close").addClass("open");
} else {
$(".everest-forms-header").removeClass("collapsed");
$("#evf-settings-collapse").removeClass("open").addClass("close");
}

// Set localStorage with expiry
function setStorageValue(key, value) {
var current = new Date();

var data = {
value: value,
expiry: current.getTime() + 86400000, // 1day of expiry time
};

localStorage.setItem(key, JSON.stringify(data));
}

// Get localStorage with expiry
function getStorageValue(key) {
var item = localStorage.getItem(key);

if (!item) {
return false;
}

var data = JSON.parse(item);
var current = new Date();

if (current.getTime() > data.expiry) {
localStorage.removeItem(key);
return false;
}
return true;
}


// Delete All Logs.
$("#log-viewer-select").on(
"click",
Expand Down
560 changes: 560 additions & 0 deletions dist/rolesandpermission.min.js

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions dist/rolesandpermission.min.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/

/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
14 changes: 8 additions & 6 deletions includes/RestApi/class-evf-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static function init() {
include __DIR__ . '/controllers/version1/class-evf-gutenberg-blocks.php';
include __DIR__ . '/controllers/version1/class-evf-templates.php';
include __DIR__ . '/controllers/version1/class-evf-plugin-status.php';
include __DIR__ . '/controllers/version1/class-evf-role-and-permission.php';
// For external.
include __DIR__ . '/controllers/version1/class-evf-entry-submission.php';

Expand Down Expand Up @@ -92,12 +93,13 @@ protected static function get_rest_classes() {
*/
protected static function get_v1_rest_classes() {
return array(
'modules' => 'EVF_Modules',
'changelog' => 'EVF_Changelog',
'gutenberg-blocks' => 'EVF_Gutenberg_Blocks',
'templates' => 'Everest_Forms_Template_Section_Data',
'plugin' => 'Everest_Forms_Plugin_Status',
'entry-submission' => 'EVF_Entry_Submission',
'modules' => 'EVF_Modules',
'changelog' => 'EVF_Changelog',
'gutenberg-blocks' => 'EVF_Gutenberg_Blocks',
'templates' => 'Everest_Forms_Template_Section_Data',
'plugin' => 'Everest_Forms_Plugin_Status',
'entry-submission' => 'EVF_Entry_Submission',
'roels_and_permission' => 'EVF_Roles_And_Permission',
);
}
}
Expand Down
Loading
Loading