Fixed initialization for any user role

This commit is contained in:
Francesco Mangiacrapa 2022-09-01 18:28:26 +02:00
parent 2bcd6db875
commit e350a4b9d8
3 changed files with 16 additions and 26 deletions

View File

@ -232,6 +232,12 @@ public class GeoPortalDataEntryApp implements EntryPoint {
@Override
public void onSuccess(GNADataEntryExtConfigProfile gNADataEntryConfig) {
GWT.log(GNADataEntryExtConfigProfile.class.getSimpleName() + " loaded: " + gNADataEntryConfig);
try {
RootPanel.get(DIV_PORTLET_ID).remove(loaderApplication);
} catch (Exception e) {
}
// PERMISSIONS
myRights = gNADataEntryConfig.getUserRights();
@ -255,16 +261,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
mainTabPanel.removeTab(0);
// activating Tab "List of Project"
mainTabPanel.setTabActive(0);
mainTabPanel.instanceAndShowListOfProjects();
return;
//mainTabPanel.instanceAndShowListOfProjects();
}
try {
RootPanel.get(DIV_PORTLET_ID).remove(loaderApplication);
} catch (Exception e) {
}
}
});
}
@ -318,6 +316,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
}
initDataEntryAppForListUseCaseDescriptors(result);
//After loading of UCD I can instance the "List of Project" view
mainTabPanel.instanceAndShowListOfProjects();
try {
RootPanel.get(DIV_PORTLET_ID).remove(loaderConfigurations);
} catch (Exception e) {
@ -709,12 +709,9 @@ public class GeoPortalDataEntryApp implements EntryPoint {
@Override
public void onClick(ClickEvent event) {
confirm.hide();
// TODO QUA
createNewDataEntyFor(newProjectEvent.getProfileID(), newProjectEvent.getHandler(),
newProjectEvent.getListGcubeProfiles());
// buildNewCards(orderedCards, OPERATION.NEW);
}
});
@ -723,11 +720,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
} else if (projectSavedWithSuccess) {
// means the project has been saved
// TODO HERE
createNewDataEntyFor(newProjectEvent.getProfileID(), newProjectEvent.getHandler(),
newProjectEvent.getListGcubeProfiles());
// buildNewCards(orderedCards, OPERATION.NEW);
} else {
ModalConfirm confirm = new ModalConfirm(null, "Creating New Project...",
@ -738,11 +732,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
@Override
public void onClick(ClickEvent event) {
confirm.hide();
// TODO HERE
// List<GeoNaFormCardModel> cardsPerIT =
// mapGcubeProfilePerItemType.get(newProjectEvent.getHandler().getItemType());
createNewDataEntyFor(newProjectEvent.getProfileID(), newProjectEvent.getHandler(),
newProjectEvent.getListGcubeProfiles());

View File

@ -328,7 +328,7 @@ public class GeonaMainTabPanel extends Composite {
@Override
public void onClick(ClickEvent event) {
instanceAndShowListOfProjects();
//instanceAndShowListOfProjects(false);
}
});
@ -596,9 +596,9 @@ public class GeonaMainTabPanel extends Composite {
*
*/
public void instanceAndShowListOfProjects() {
// If only one UCD is available for DATA_LIST_GUI.. FIRE THE EVENT OF SELECTION
if (ucdProjectTypesForListingDataView.size() == 1) {
GWT.log("instanceAndShowListOfProjects called");
// If the list of UCDProjectType for listing is not empty.. FIRE THE EVENT OF SELECTION on the first item
if (ucdProjectTypesForListingDataView.size() > 0) {
UseCaseDescriptorDV singleUCD = ucdProjectTypesForListingDataView.get(0);
alertProjectType.setText(singleUCD.getName());
// setFilteringParameters(displayFields, sortByFields, searchForFields,

View File

@ -746,7 +746,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
// DEV MODE
if (!SessionUtil.isIntoPortal()) {
LOG.warn("OUT OF PORTAL - DEV MODE detected");
GcubeUserRole myRole = GcubeUserRole.DATA_MANAGER;
GcubeUserRole myRole = GcubeUserRole.DATA_MEMBER;
for (RoleRights roleRight : listUserRightsForRole) {
if (roleRight.getUserRole().equals(myRole)) {