Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions 4 build/docma-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,15 @@
"web/client/plugins/ResourcesCatalog/EditContext.jsx",
"web/client/plugins/ResourcesCatalog/Favorites.jsx",
"web/client/plugins/ResourcesCatalog/Footer.jsx",
"web/client/plugins/ResourcesCatalog/GroupManager.jsx",
"web/client/plugins/ResourcesCatalog/HomeDescription.jsx",
"web/client/plugins/ResourcesCatalog/ResourceDetails.jsx",
"web/client/plugins/ResourcesCatalog/ResourcesFiltersForm.jsx",
"web/client/plugins/ResourcesCatalog/ResourcesGrid.jsx",
"web/client/plugins/ResourcesCatalog/Save.jsx",
"web/client/plugins/ResourcesCatalog/SaveAs.jsx",
"web/client/plugins/ResourcesCatalog/TagsManager.jsx",
"web/client/plugins/ResourcesCatalog/UserManager.jsx",
"web/client/plugins/RulesDataGrid.jsx",
"web/client/plugins/RulesEditor.jsx",
"web/client/plugins/RulesManagerFooter.jsx",
Expand Down Expand Up @@ -334,10 +336,8 @@
"web/client/plugins/containers/ToolsContainer.jsx",
"web/client/plugins/featuregrid/FeatureEditor.jsx",
"web/client/plugins/index.jsdoc",
"web/client/plugins/manager/GroupManager.jsx",
"web/client/plugins/manager/Manager.jsx",
"web/client/plugins/manager/ManagerMenu.jsx",
"web/client/plugins/manager/UserManager.jsx",
"web/client/plugins/print/Graticule.jsx",
"web/client/plugins/print/OutputFormat.jsx",
"web/client/plugins/print/Projection.jsx",
Expand Down
16 changes: 16 additions & 0 deletions 16 docs/developer-guide/mapstore-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ This is a list of things to check if you want to update from a previous version

## Migration from 2024.02.00 to 2025.01.00

### Removing Header from the Admin section and deprecating the old UserManager and GroupManagerPlugin

The old `UserManager` and `GroupManager` plugin has been removed and replace with new plugins under the `web/client/plugins/ResourcesCatalog/` folder. Also the `Header` plugin has been removed from Admin/Manager so the configuration in `localConfig.json` should be updated as follow:

```diff
{
"plugins": {
"manager": [
- "Header",
"Redirect",
...
]
}
}
```

### Changes in the Login plugin and deprecation of ManagerMenu

The `ManagerMenu` plugin has been deprecated. The manager menu items are now handled by the `Login` plugin. The `Login` plugin now includes the `ManagerMenu` functionality, so the `ManagerMenu` plugin should be removed from the `localConfig.json` configuration.
Expand Down
79 changes: 42 additions & 37 deletions 79 web/client/actions/__tests__/usergroups-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import expect from 'expect';
import assign from 'object-assign';

import {
GETGROUPS,
STATUS_SUCCESS,
STATUS_ERROR,
getUserGroups,
editGroup,
EDITGROUP,
changeGroupMetadata,
Expand All @@ -25,7 +21,17 @@ import {
DELETEGROUP,
STATUS_DELETED,
searchUsers,
SEARCHUSERS
SEARCHUSERS,
updateUserGroups,
UPDATE_USER_GROUPS,
updateUserGroupsMetadata,
UPDATE_USER_GROUPS_METADATA,
loadingUserGroups,
LOADING_USER_GROUPS,
searchUserGroups,
SEARCH_USER_GROUPS,
resetSearchUserGroups,
RESET_SEARCH_USER_GROUPS
} from '../usergroups';

import GeoStoreDAO from '../../api/GeoStoreDAO';
Expand All @@ -41,44 +47,43 @@ describe('Test correctness of the usergroups actions', () => {
afterEach(() => {
GeoStoreDAO.addBaseUrl = oldAddBaseUri;
});
it('get UserGroups', (done) => {
const retFun = getUserGroups('usergroups.json', {params: {start: 0, limit: 10}});
expect(retFun).toExist();
let count = 0;
retFun((action) => {
expect(action.type).toBe(GETGROUPS);
count++;
if (count === 2) {
expect(action.status).toBe(STATUS_SUCCESS);
expect(action.groups).toExist();
expect(action.groups[0]).toExist();
expect(action.groups[0].groupName).toExist();
done();
}

}, () => ({
userGroups: {
searchText: "*"
}
}));
it('updateUserGroups', () => {
const userGroups = [{ id: '01' }];
const action = updateUserGroups(userGroups);
expect(action.type).toBe(UPDATE_USER_GROUPS);
expect(action.userGroups).toBe(userGroups);
});

it('updateUserGroupsMetadata', () => {
const metadata = {};
const action = updateUserGroupsMetadata(metadata);
expect(action.type).toBe(UPDATE_USER_GROUPS_METADATA);
expect(action.metadata).toBe(metadata);
});
it('getUserGroups error', (done) => {
const retFun = getUserGroups('MISSING_LINK', {params: {start: 0, limit: 10}});
expect(retFun).toExist();
let count = 0;
retFun((action) => {
expect(action.type).toBe(GETGROUPS);
count++;
if (count === 2) {
expect(action.status).toBe(STATUS_ERROR);
expect(action.error).toExist();
done();
}

});
it('loadingUserGroups', () => {
const action = loadingUserGroups(true);
expect(action.type).toBe(LOADING_USER_GROUPS);
expect(action.loading).toBe(true);
});

it('searchUserGroups', () => {
const params = { q: '' };
let action = searchUserGroups({ params });
expect(action.type).toBe(SEARCH_USER_GROUPS);
expect(action.params).toBe(params);
action = searchUserGroups({ refresh: true });
expect(action.refresh).toBe(true);
action = searchUserGroups({ clear: true });
expect(action.clear).toBe(true);
});

it('resetSearchUserGroups', () => {
const action = resetSearchUserGroups();
expect(action.type).toBe(RESET_SEARCH_USER_GROUPS);
});

it('edit UserGroup', (done) => {
const retFun = editGroup({id: 1});
expect(retFun).toExist();
Expand Down
111 changes: 38 additions & 73 deletions 111 web/client/actions/__tests__/users-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,24 @@ import expect from 'expect';
import assign from 'object-assign';

import {
USERMANAGER_GETUSERS,
getUsers,
editUser,
USERMANAGER_EDIT_USER,
changeUserMetadata,
USERMANAGER_EDIT_USER_DATA,
saveUser,
USERMANAGER_UPDATE_USER,
deleteUser,
USERMANAGER_DELETE_USER
USERMANAGER_DELETE_USER,
updateUsers,
UPDATE_USERS,
updateUsersMetadata,
UPDATE_USERS_METADATA,
loadingUsers,
LOADING_USERS,
searchUsers,
SEARCH_USERS,
resetSearchUsers,
RESET_SEARCH_USERS
} from '../users';

import GeoStoreDAO from '../../api/GeoStoreDAO';
Expand All @@ -36,84 +44,41 @@ describe('Test correctness of the users actions', () => {
afterEach(() => {
GeoStoreDAO.addBaseUrl = oldAddBaseUri;
});
it('getUsers', (done) => {
const retFun = getUsers('users.json', {params: {start: 0, limit: 10}});
expect(retFun).toExist();
let count = 0;
retFun((action) => {
expect(action.type).toBe(USERMANAGER_GETUSERS);
count++;
// we check the second action because the first one is the "loading" one
if (count === 2) {
expect(action.users).toExist();
expect(action.users[0]).toExist();
expect(action.users[0].groups).toExist();
done();
}

});

});
it('getUsers with old search', (done) => {
const retFun = getUsers();
expect(retFun).toExist();
let count = 0;
retFun((action) => {
expect(action.type).toBe(USERMANAGER_GETUSERS);
count++;
if (count === 2) {
expect(action.users).toExist();
expect(action.users[0]).toExist();
expect(action.users[0].groups).toExist();
done();
}
}, () => ({users: { searchText: "users.json"}}));
it('updateUsers', () => {
const users = [{ id: '01' }];
const action = updateUsers(users);
expect(action.type).toBe(UPDATE_USERS);
expect(action.users).toBe(users);
});

it('getUsers with empty search', (done) => {
const retFun = getUsers(false, {params: {start: 5, limit: 10}});
expect(retFun).toExist();
let count = 0;
retFun((action) => {
expect(action.type).toBe(USERMANAGER_GETUSERS);
count++;
if (count === 2) {
expect(action.searchText).toBe("*");
expect(action.start).toBe(5);
expect(action.limit).toBe(10);
done();
}
}, () => ({}));
it('updateUsersMetadata', () => {
const metadata = {};
const action = updateUsersMetadata(metadata);
expect(action.type).toBe(UPDATE_USERS_METADATA);
expect(action.metadata).toBe(metadata);
});

it('getUsers error', (done) => {
const retFun = getUsers('MISSING_LINK', {params: {start: 0, limit: 10}});
expect(retFun).toExist();
let count = 0;
retFun((action) => {
expect(action.type).toBe(USERMANAGER_GETUSERS);
count++;
if (count === 2) {
expect(action.error).toExist();
done();
}
});
it('loadingUsers', () => {
const action = loadingUsers(true);
expect(action.type).toBe(LOADING_USERS);
expect(action.loading).toBe(true);
});

it('getUsers issue returning empty response', (done) => {
const retFun = getUsers('empty.json', {params: {start: 0, limit: 10}});
expect(retFun).toExist();
let count = 0;
retFun((action) => {
expect(action.type).toBe(USERMANAGER_GETUSERS);
count++;
if (count === 2) {
expect(action).toExist();
done();
}

});
it('searchUsers', () => {
const params = { q: '' };
let action = searchUsers({ params });
expect(action.type).toBe(SEARCH_USERS);
expect(action.params).toBe(params);
action = searchUsers({ refresh: true });
expect(action.refresh).toBe(true);
action = searchUsers({ clear: true });
expect(action.clear).toBe(true);
});

it('resetSearchUsers', () => {
const action = resetSearchUsers();
expect(action.type).toBe(RESET_SEARCH_USERS);
});

it('editUser', (done) => {
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.