Refs #10188:AccountingManager - Add a way to esplicitly set the scope in accounting-analytics

https://support.d4science.org/issues/10188

Fixed list view width

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/accounting-manager@179232 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2019-05-02 17:46:56 +00:00
parent 9ee552d5e2
commit d7c79991a0
10 changed files with 93 additions and 78 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/accounting-manager-1.11.0-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/accounting-manager-1.12.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/accounting-manager-1.11.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/accounting-manager-1.12.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
@ -45,5 +45,5 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/accounting-manager-1.11.0-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/accounting-manager-1.12.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="accounting-manager-1.11.0-SNAPSHOT"> <wb-module deploy-name="accounting-manager-1.12.0-SNAPSHOT">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>

View File

@ -1,4 +1,8 @@
<ReleaseNotes> <ReleaseNotes>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-12-0"
date="2019-05-02">
<Change>Fixed scope list view width</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-11-0" <Changeset component="org.gcube.portlets.admin.accounting-manager.1-11-0"
date="2018-12-28"> date="2018-12-28">
<Change>Added scope selection [Ticket #10188]</Change> <Change>Added scope selection [Ticket #10188]</Change>

View File

@ -13,7 +13,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.admin</groupId> <groupId>org.gcube.portlets.admin</groupId>
<artifactId>accounting-manager</artifactId> <artifactId>accounting-manager</artifactId>
<version>1.11.0-SNAPSHOT</version> <version>1.12.0-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>

View File

@ -8,11 +8,11 @@
<!-- <inherits name='com.extjs.gxt.ui.GXT' /> --> <!-- <inherits name='com.extjs.gxt.ui.GXT' /> -->
<inherits name='com.sencha.gxt.ui.GXT' /> <inherits name='com.sencha.gxt.ui.GXT' />
<!-- Add this for using GXT charts --> <!-- Add this for using GXT charts -->
<inherits name='com.sencha.gxt.chart.Chart' /> <inherits name='com.sencha.gxt.chart.Chart' />
<!-- GXT Theme --> <!-- GXT Theme -->
<!-- <inherits name='com.sencha.gxt.theme.blue.Blue' /> --> <!-- <inherits name='com.sencha.gxt.theme.blue.Blue' /> -->
<!-- <inherits name='com.sencha.gxt.theme.gray.Gray' /> --> <!-- <inherits name='com.sencha.gxt.theme.gray.Gray' /> -->
@ -44,6 +44,8 @@
name="locale" values="es" /> <set-property name="locale" value="en, it, es" name="locale" values="es" /> <set-property name="locale" value="en, it, es"
/> <set-property-fallback name="locale" value="en" /> --> /> <set-property-fallback name="locale" value="en" /> -->
<!-- <set-configuration-property name="CssResource.style" value="pretty"/> -->
<!-- <set-property name="log_DivLogger" value="ENABLED" /> <set-property <!-- <set-property name="log_DivLogger" value="ENABLED" /> <set-property
name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_GWTLogger" name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED" value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"

View File

@ -63,6 +63,7 @@ import com.sencha.gxt.dnd.core.client.DndDragStartEvent;
import com.sencha.gxt.dnd.core.client.DndDragStartEvent.DndDragStartHandler; import com.sencha.gxt.dnd.core.client.DndDragStartEvent.DndDragStartHandler;
import com.sencha.gxt.dnd.core.client.GridDragSource; import com.sencha.gxt.dnd.core.client.GridDragSource;
import com.sencha.gxt.dnd.core.client.GridDropTarget; import com.sencha.gxt.dnd.core.client.GridDropTarget;
import com.sencha.gxt.widget.core.client.ListView;
import com.sencha.gxt.widget.core.client.button.ButtonBar; import com.sencha.gxt.widget.core.client.button.ButtonBar;
import com.sencha.gxt.widget.core.client.button.TextButton; import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
@ -73,6 +74,7 @@ import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.SimpleContainer; import com.sencha.gxt.widget.core.client.container.SimpleContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.BeforeShowEvent;
import com.sencha.gxt.widget.core.client.event.BeforeStartEditEvent; import com.sencha.gxt.widget.core.client.event.BeforeStartEditEvent;
import com.sencha.gxt.widget.core.client.event.BeforeStartEditEvent.BeforeStartEditHandler; import com.sencha.gxt.widget.core.client.event.BeforeStartEditEvent.BeforeStartEditHandler;
import com.sencha.gxt.widget.core.client.event.CancelEditEvent; import com.sencha.gxt.widget.core.client.event.CancelEditEvent;
@ -489,15 +491,17 @@ public class ActiveFiltersPanel extends SimpleContainer {
addHandlersForComboChartType(comboChartTypeLabelProvider); addHandlersForComboChartType(comboChartTypeLabelProvider);
comboChartTypeLabel = new FieldLabel(comboChartType, "Chart"); comboChartTypeLabel = new FieldLabel(comboChartType, "Chart");
//TODO ScopeCombo for Top and Basic // TODO ScopeCombo for Top and Basic
GenresDataPropertiesCombo genresDataPropertiesCombo = GWT.create(GenresDataPropertiesCombo.class); GenresDataPropertiesCombo genresDataPropertiesCombo = GWT.create(GenresDataPropertiesCombo.class);
storeComboScope = new ListStore<GenresData>(genresDataPropertiesCombo.id()); storeComboScope = new ListStore<GenresData>(genresDataPropertiesCombo.id());
comboScope = new ComboBox<GenresData>(storeComboScope, genresDataPropertiesCombo.label()); comboScope = new ComboBox<GenresData>(storeComboScope, genresDataPropertiesCombo.label());
comboScope.setClearValueOnParseError(false); comboScope.setClearValueOnParseError(false);
comboScope.setEditable(false); comboScope.setEditable(false);
comboScope.setTriggerAction(TriggerAction.ALL); comboScope.setTriggerAction(TriggerAction.ALL);
comboScope.getListView().addStyleName(AccountingManagerResources.INSTANCE.accountingManagerCSS().getScopeListView());
addHandlersForComboScope(genresDataPropertiesCombo.label()); addHandlersForComboScope(genresDataPropertiesCombo.label());
comboScopeLabel = new FieldLabel(comboScope, "Scope"); comboScopeLabel = new FieldLabel(comboScope, "Scope");
@ -714,7 +718,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
storeComboTopFilterKey.clear(); storeComboTopFilterKey.clear();
storeComboTopFilterKey.addAll(accountingStateData.getAvailableFilterKeys()); storeComboTopFilterKey.addAll(accountingStateData.getAvailableFilterKeys());
storeComboTopFilterKey.commitChanges(); storeComboTopFilterKey.commitChanges();
ChartType chartType = accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType(); ChartType chartType = accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType();
@ -745,29 +748,29 @@ public class ActiveFiltersPanel extends SimpleContainer {
.getSeriesRequest().getAccountingFilterDefinition() instanceof AccountingFilterBasic) { .getSeriesRequest().getAccountingFilterDefinition() instanceof AccountingFilterBasic) {
AccountingFilterBasic accountingFilterBasic = (AccountingFilterBasic) accountingStateData.getSeriesRequest() AccountingFilterBasic accountingFilterBasic = (AccountingFilterBasic) accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition(); .getAccountingFilterDefinition();
if(accountingStateData.getAvailableContext().getContexts()!=null&& if (accountingStateData.getAvailableContext().getContexts() != null
!accountingStateData.getAvailableContext().getContexts().isEmpty()){ && !accountingStateData.getAvailableContext().getContexts().isEmpty()) {
ArrayList<String> scopesAvailables=accountingStateData.getAvailableContext().getContexts(); ArrayList<String> scopesAvailables = accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes=new ArrayList<>(); ArrayList<GenresData> scopes = new ArrayList<>();
for(String scopeAvailable:scopesAvailables){ for (String scopeAvailable : scopesAvailables) {
scopes.add(new GenresData(scopeAvailable)); scopes.add(new GenresData(scopeAvailable));
} }
storeComboScope.clear(); storeComboScope.clear();
storeComboScope.addAll(scopes); storeComboScope.addAll(scopes);
storeComboScope.commitChanges(); storeComboScope.commitChanges();
if(accountingFilterBasic.getScope()!=null&&!accountingFilterBasic.getScope().isEmpty()){ if (accountingFilterBasic.getScope() != null && !accountingFilterBasic.getScope().isEmpty()) {
comboScope.setValue(new GenresData(accountingFilterBasic.getScope())); comboScope.setValue(new GenresData(accountingFilterBasic.getScope()));
} else { } else {
comboScope.setValue(storeComboScope.get(0)); comboScope.setValue(storeComboScope.get(0));
} }
} else{ } else {
storeComboScope.clear(); storeComboScope.clear();
storeComboScope.commitChanges(); storeComboScope.commitChanges();
} }
if (accountingFilterBasic.getFilters() != null) { if (accountingFilterBasic.getFilters() != null) {
List<AccountingFilter> filters = accountingFilterBasic.getFilters(); List<AccountingFilter> filters = accountingFilterBasic.getFilters();
storeFilter.clear(); storeFilter.clear();
@ -804,26 +807,26 @@ public class ActiveFiltersPanel extends SimpleContainer {
storeFilter.commitChanges(); storeFilter.commitChanges();
seq = 0; seq = 0;
if(accountingStateData.getAvailableContext().getContexts()!=null&& if (accountingStateData.getAvailableContext().getContexts() != null
!accountingStateData.getAvailableContext().getContexts().isEmpty()){ && !accountingStateData.getAvailableContext().getContexts().isEmpty()) {
ArrayList<String> scopesAvailables=accountingStateData.getAvailableContext().getContexts(); ArrayList<String> scopesAvailables = accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes=new ArrayList<>(); ArrayList<GenresData> scopes = new ArrayList<>();
for(String scopeAvailable:scopesAvailables){ for (String scopeAvailable : scopesAvailables) {
scopes.add(new GenresData(scopeAvailable)); scopes.add(new GenresData(scopeAvailable));
} }
storeComboScope.clear(); storeComboScope.clear();
storeComboScope.addAll(scopes); storeComboScope.addAll(scopes);
storeComboScope.commitChanges(); storeComboScope.commitChanges();
comboScope.setValue(storeComboScope.get(0)); comboScope.setValue(storeComboScope.get(0));
} else{ } else {
storeComboScope.clear(); storeComboScope.clear();
storeComboScope.commitChanges(); storeComboScope.commitChanges();
} }
if (accountingStateData.getRootScope()) { if (accountingStateData.getRootScope()) {
noContextToggle.reset(); noContextToggle.reset();
noContextNo.setValue(true); noContextNo.setValue(true);
@ -835,8 +838,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
} }
} }
comboChartType.setValue(ChartType.Basic); comboChartType.setValue(ChartType.Basic);
comboScopeLabel.setVisible(true); comboScopeLabel.setVisible(true);
gridGenres.setVisible(false); gridGenres.setVisible(false);
@ -858,32 +860,29 @@ public class ActiveFiltersPanel extends SimpleContainer {
.getSeriesRequest().getAccountingFilterDefinition() instanceof AccountingFilterTop) { .getSeriesRequest().getAccountingFilterDefinition() instanceof AccountingFilterTop) {
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) accountingStateData.getSeriesRequest() AccountingFilterTop accountingFilterTop = (AccountingFilterTop) accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition(); .getAccountingFilterDefinition();
if(accountingStateData.getAvailableContext().getContexts()!=null&& if (accountingStateData.getAvailableContext().getContexts() != null
!accountingStateData.getAvailableContext().getContexts().isEmpty()){ && !accountingStateData.getAvailableContext().getContexts().isEmpty()) {
ArrayList<String> scopesAvailables=accountingStateData.getAvailableContext().getContexts(); ArrayList<String> scopesAvailables = accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes=new ArrayList<>(); ArrayList<GenresData> scopes = new ArrayList<>();
for(String scopeAvailable:scopesAvailables){ for (String scopeAvailable : scopesAvailables) {
scopes.add(new GenresData(scopeAvailable)); scopes.add(new GenresData(scopeAvailable));
} }
storeComboScope.clear(); storeComboScope.clear();
storeComboScope.addAll(scopes); storeComboScope.addAll(scopes);
storeComboScope.commitChanges(); storeComboScope.commitChanges();
if(accountingFilterTop.getScope()!=null&&!accountingFilterTop.getScope().isEmpty()){ if (accountingFilterTop.getScope() != null && !accountingFilterTop.getScope().isEmpty()) {
comboScope.setValue(new GenresData(accountingFilterTop.getScope())); comboScope.setValue(new GenresData(accountingFilterTop.getScope()));
} else { } else {
comboScope.setValue(storeComboScope.get(0)); comboScope.setValue(storeComboScope.get(0));
} }
} else{ } else {
storeComboScope.clear(); storeComboScope.clear();
storeComboScope.commitChanges(); storeComboScope.commitChanges();
comboScope.reset(); comboScope.reset();
} }
if (accountingFilterTop.getFilterKey() != null) { if (accountingFilterTop.getFilterKey() != null) {
comboTopFilterKey.setValue(accountingFilterTop.getFilterKey()); comboTopFilterKey.setValue(accountingFilterTop.getFilterKey());
topNumber.setValue(accountingFilterTop.getTopNumber()); topNumber.setValue(accountingFilterTop.getTopNumber());
@ -917,26 +916,26 @@ public class ActiveFiltersPanel extends SimpleContainer {
seq = 0; seq = 0;
} }
} else { } else {
if(accountingStateData.getAvailableContext().getContexts()!=null&& if (accountingStateData.getAvailableContext().getContexts() != null
!accountingStateData.getAvailableContext().getContexts().isEmpty()){ && !accountingStateData.getAvailableContext().getContexts().isEmpty()) {
ArrayList<String> scopesAvailables=accountingStateData.getAvailableContext().getContexts(); ArrayList<String> scopesAvailables = accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes=new ArrayList<>(); ArrayList<GenresData> scopes = new ArrayList<>();
for(String scopeAvailable:scopesAvailables){ for (String scopeAvailable : scopesAvailables) {
scopes.add(new GenresData(scopeAvailable)); scopes.add(new GenresData(scopeAvailable));
} }
storeComboScope.clear(); storeComboScope.clear();
storeComboScope.addAll(scopes); storeComboScope.addAll(scopes);
storeComboScope.commitChanges(); storeComboScope.commitChanges();
comboScope.setValue(storeComboScope.get(0)); comboScope.setValue(storeComboScope.get(0));
} else{ } else {
storeComboScope.clear(); storeComboScope.clear();
storeComboScope.commitChanges(); storeComboScope.commitChanges();
comboScope.reset(); comboScope.reset();
} }
comboScopeLabel.setVisible(true); comboScopeLabel.setVisible(true);
comboTopFilterKey.reset(); comboTopFilterKey.reset();
showOthersToggle.reset(); showOthersToggle.reset();
@ -1248,16 +1247,15 @@ public class ActiveFiltersPanel extends SimpleContainer {
// TODO // TODO
private AccountingFilterDefinition getActiveFiltersForBasic() { private AccountingFilterDefinition getActiveFiltersForBasic() {
String scope=null; String scope = null;
if(comboScopeLabel!=null&&comboScopeLabel.isVisible()){ if (comboScopeLabel != null && comboScopeLabel.isVisible()) {
GenresData genresData=comboScope.getCurrentValue(); GenresData genresData = comboScope.getCurrentValue();
if(genresData!=null){ if (genresData != null) {
scope=genresData.getLabel(); scope = genresData.getLabel();
} }
} }
Log.debug("Scope selected: "+scope); Log.debug("Scope selected: " + scope);
Boolean noContextValue = false; Boolean noContextValue = false;
if (noContextLabel != null && noContextLabel.isVisible()) { if (noContextLabel != null && noContextLabel.isVisible()) {
noContextValue = noContextYes.getValue(); noContextValue = noContextYes.getValue();
@ -1266,8 +1264,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
} }
Log.debug("noContextValue: " + noContextValue); Log.debug("noContextValue: " + noContextValue);
if (storeFilter == null || storeFilter.size() <= 0) { if (storeFilter == null || storeFilter.size() <= 0) {
return new AccountingFilterBasic(scope, noContextValue); return new AccountingFilterBasic(scope, noContextValue);
} else { } else {
@ -1289,15 +1285,15 @@ public class ActiveFiltersPanel extends SimpleContainer {
} }
private AccountingFilterDefinition getActiveFiltersForTop() { private AccountingFilterDefinition getActiveFiltersForTop() {
String scope=null; String scope = null;
if(comboScopeLabel!=null&&comboScopeLabel.isVisible()){ if (comboScopeLabel != null && comboScopeLabel.isVisible()) {
GenresData genresData=comboScope.getCurrentValue(); GenresData genresData = comboScope.getCurrentValue();
if(genresData!=null){ if (genresData != null) {
scope=genresData.getLabel(); scope = genresData.getLabel();
} }
} }
Log.debug("Scope selected: "+scope); Log.debug("Scope selected: " + scope);
Boolean showOthersValue = showOthersYes.getValue(); Boolean showOthersValue = showOthersYes.getValue();
Integer topN = topNumber.getCurrentValue(); Integer topN = topNumber.getCurrentValue();
FilterKey filterKey = comboTopFilterKey.getCurrentValue(); FilterKey filterKey = comboTopFilterKey.getCurrentValue();
@ -1685,7 +1681,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
seq = 0; seq = 0;
} }
private void addHandlersForComboScope(final LabelProvider<GenresData> labelProvider) { private void addHandlersForComboScope(final LabelProvider<GenresData> labelProvider) {
comboScope.addSelectionHandler(new SelectionHandler<GenresData>() { comboScope.addSelectionHandler(new SelectionHandler<GenresData>() {
public void onSelection(SelectionEvent<GenresData> event) { public void onSelection(SelectionEvent<GenresData> event) {
@ -1697,8 +1692,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
} }
private void updateScope(GenresData selectedFilterKey) { private void updateScope(GenresData selectedFilterKey) {
} }
} }

View File

@ -5,3 +5,8 @@
line-height: 13px; line-height: 13px;
font-size: 11px; font-size: 11px;
} }
.scopeListView {
overflow-x: auto!important;
width: 580px!important;
}

View File

@ -16,5 +16,7 @@ public interface AccountingManagerCSS extends CssResource {
@ClassName("ribbon") @ClassName("ribbon")
public String getRibbon(); public String getRibbon();
@ClassName("scopeListView")
public String getScopeListView();
} }

View File

@ -49,6 +49,8 @@
name="locale" values="es" /> <set-property name="locale" value="en, it, es" name="locale" values="es" /> <set-property name="locale" value="en, it, es"
/> <set-property-fallback name="locale" value="en" /> --> /> <set-property-fallback name="locale" value="en" /> -->
<!-- <set-configuration-property name="CssResource.style" value="pretty"/> -->
<!-- <!--
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property <set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger" name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"

View File

@ -5,3 +5,9 @@
line-height: 13px; line-height: 13px;
font-size: 11px; font-size: 11px;
} }
.scopeListView {
overflow-x: auto!important;
width: 580px!important;
}