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"?>
<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>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</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>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -45,5 +45,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</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>

View File

@ -1,5 +1,5 @@
<?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="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>

View File

@ -1,4 +1,8 @@
<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"
date="2018-12-28">
<Change>Added scope selection [Ticket #10188]</Change>

View File

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

View File

@ -8,11 +8,11 @@
<!-- <inherits name='com.extjs.gxt.ui.GXT' /> -->
<inherits name='com.sencha.gxt.ui.GXT' />
<!-- Add this for using GXT charts -->
<inherits name='com.sencha.gxt.chart.Chart' />
<!-- GXT Theme -->
<!-- <inherits name='com.sencha.gxt.theme.blue.Blue' /> -->
<!-- <inherits name='com.sencha.gxt.theme.gray.Gray' /> -->
@ -44,6 +44,8 @@
name="locale" values="es" /> <set-property name="locale" value="en, it, es"
/> <set-property-fallback name="locale" value="en" /> -->
<!-- <set-configuration-property name="CssResource.style" value="pretty"/> -->
<!-- <set-property name="log_DivLogger" value="ENABLED" /> <set-property
name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
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.GridDragSource;
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.TextButton;
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.VerticalLayoutContainer;
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.BeforeStartEditHandler;
import com.sencha.gxt.widget.core.client.event.CancelEditEvent;
@ -489,15 +491,17 @@ public class ActiveFiltersPanel extends SimpleContainer {
addHandlersForComboChartType(comboChartTypeLabelProvider);
comboChartTypeLabel = new FieldLabel(comboChartType, "Chart");
//TODO ScopeCombo for Top and Basic
// TODO ScopeCombo for Top and Basic
GenresDataPropertiesCombo genresDataPropertiesCombo = GWT.create(GenresDataPropertiesCombo.class);
storeComboScope = new ListStore<GenresData>(genresDataPropertiesCombo.id());
comboScope = new ComboBox<GenresData>(storeComboScope, genresDataPropertiesCombo.label());
comboScope.setClearValueOnParseError(false);
comboScope.setEditable(false);
comboScope.setTriggerAction(TriggerAction.ALL);
comboScope.getListView().addStyleName(AccountingManagerResources.INSTANCE.accountingManagerCSS().getScopeListView());
addHandlersForComboScope(genresDataPropertiesCombo.label());
comboScopeLabel = new FieldLabel(comboScope, "Scope");
@ -715,7 +719,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
storeComboTopFilterKey.addAll(accountingStateData.getAvailableFilterKeys());
storeComboTopFilterKey.commitChanges();
ChartType chartType = accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType();
switch (chartType) {
@ -746,23 +749,23 @@ public class ActiveFiltersPanel extends SimpleContainer {
AccountingFilterBasic accountingFilterBasic = (AccountingFilterBasic) accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition();
if(accountingStateData.getAvailableContext().getContexts()!=null&&
!accountingStateData.getAvailableContext().getContexts().isEmpty()){
if (accountingStateData.getAvailableContext().getContexts() != null
&& !accountingStateData.getAvailableContext().getContexts().isEmpty()) {
ArrayList<String> scopesAvailables=accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes=new ArrayList<>();
for(String scopeAvailable:scopesAvailables){
ArrayList<String> scopesAvailables = accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes = new ArrayList<>();
for (String scopeAvailable : scopesAvailables) {
scopes.add(new GenresData(scopeAvailable));
}
storeComboScope.clear();
storeComboScope.addAll(scopes);
storeComboScope.commitChanges();
if(accountingFilterBasic.getScope()!=null&&!accountingFilterBasic.getScope().isEmpty()){
if (accountingFilterBasic.getScope() != null && !accountingFilterBasic.getScope().isEmpty()) {
comboScope.setValue(new GenresData(accountingFilterBasic.getScope()));
} else {
comboScope.setValue(storeComboScope.get(0));
}
} else{
} else {
storeComboScope.clear();
storeComboScope.commitChanges();
}
@ -804,12 +807,12 @@ public class ActiveFiltersPanel extends SimpleContainer {
storeFilter.commitChanges();
seq = 0;
if(accountingStateData.getAvailableContext().getContexts()!=null&&
!accountingStateData.getAvailableContext().getContexts().isEmpty()){
if (accountingStateData.getAvailableContext().getContexts() != null
&& !accountingStateData.getAvailableContext().getContexts().isEmpty()) {
ArrayList<String> scopesAvailables=accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes=new ArrayList<>();
for(String scopeAvailable:scopesAvailables){
ArrayList<String> scopesAvailables = accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes = new ArrayList<>();
for (String scopeAvailable : scopesAvailables) {
scopes.add(new GenresData(scopeAvailable));
}
@ -818,7 +821,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
storeComboScope.commitChanges();
comboScope.setValue(storeComboScope.get(0));
} else{
} else {
storeComboScope.clear();
storeComboScope.commitChanges();
}
@ -836,7 +839,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
}
comboChartType.setValue(ChartType.Basic);
comboScopeLabel.setVisible(true);
gridGenres.setVisible(false);
@ -859,31 +861,28 @@ public class ActiveFiltersPanel extends SimpleContainer {
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition();
if(accountingStateData.getAvailableContext().getContexts()!=null&&
!accountingStateData.getAvailableContext().getContexts().isEmpty()){
if (accountingStateData.getAvailableContext().getContexts() != null
&& !accountingStateData.getAvailableContext().getContexts().isEmpty()) {
ArrayList<String> scopesAvailables=accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes=new ArrayList<>();
for(String scopeAvailable:scopesAvailables){
ArrayList<String> scopesAvailables = accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes = new ArrayList<>();
for (String scopeAvailable : scopesAvailables) {
scopes.add(new GenresData(scopeAvailable));
}
storeComboScope.clear();
storeComboScope.addAll(scopes);
storeComboScope.commitChanges();
if(accountingFilterTop.getScope()!=null&&!accountingFilterTop.getScope().isEmpty()){
if (accountingFilterTop.getScope() != null && !accountingFilterTop.getScope().isEmpty()) {
comboScope.setValue(new GenresData(accountingFilterTop.getScope()));
} else {
comboScope.setValue(storeComboScope.get(0));
}
} else{
} else {
storeComboScope.clear();
storeComboScope.commitChanges();
comboScope.reset();
}
if (accountingFilterTop.getFilterKey() != null) {
comboTopFilterKey.setValue(accountingFilterTop.getFilterKey());
topNumber.setValue(accountingFilterTop.getTopNumber());
@ -918,12 +917,12 @@ public class ActiveFiltersPanel extends SimpleContainer {
}
} else {
if(accountingStateData.getAvailableContext().getContexts()!=null&&
!accountingStateData.getAvailableContext().getContexts().isEmpty()){
if (accountingStateData.getAvailableContext().getContexts() != null
&& !accountingStateData.getAvailableContext().getContexts().isEmpty()) {
ArrayList<String> scopesAvailables=accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes=new ArrayList<>();
for(String scopeAvailable:scopesAvailables){
ArrayList<String> scopesAvailables = accountingStateData.getAvailableContext().getContexts();
ArrayList<GenresData> scopes = new ArrayList<>();
for (String scopeAvailable : scopesAvailables) {
scopes.add(new GenresData(scopeAvailable));
}
storeComboScope.clear();
@ -931,7 +930,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
storeComboScope.commitChanges();
comboScope.setValue(storeComboScope.get(0));
} else{
} else {
storeComboScope.clear();
storeComboScope.commitChanges();
comboScope.reset();
@ -1248,15 +1247,14 @@ public class ActiveFiltersPanel extends SimpleContainer {
// TODO
private AccountingFilterDefinition getActiveFiltersForBasic() {
String scope=null;
if(comboScopeLabel!=null&&comboScopeLabel.isVisible()){
GenresData genresData=comboScope.getCurrentValue();
if(genresData!=null){
scope=genresData.getLabel();
String scope = null;
if (comboScopeLabel != null && comboScopeLabel.isVisible()) {
GenresData genresData = comboScope.getCurrentValue();
if (genresData != null) {
scope = genresData.getLabel();
}
}
Log.debug("Scope selected: "+scope);
Log.debug("Scope selected: " + scope);
Boolean noContextValue = false;
if (noContextLabel != null && noContextLabel.isVisible()) {
@ -1266,8 +1264,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
}
Log.debug("noContextValue: " + noContextValue);
if (storeFilter == null || storeFilter.size() <= 0) {
return new AccountingFilterBasic(scope, noContextValue);
} else {
@ -1289,14 +1285,14 @@ public class ActiveFiltersPanel extends SimpleContainer {
}
private AccountingFilterDefinition getActiveFiltersForTop() {
String scope=null;
if(comboScopeLabel!=null&&comboScopeLabel.isVisible()){
GenresData genresData=comboScope.getCurrentValue();
if(genresData!=null){
scope=genresData.getLabel();
String scope = null;
if (comboScopeLabel != null && comboScopeLabel.isVisible()) {
GenresData genresData = comboScope.getCurrentValue();
if (genresData != null) {
scope = genresData.getLabel();
}
}
Log.debug("Scope selected: "+scope);
Log.debug("Scope selected: " + scope);
Boolean showOthersValue = showOthersYes.getValue();
Integer topN = topNumber.getCurrentValue();
@ -1685,7 +1681,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
seq = 0;
}
private void addHandlersForComboScope(final LabelProvider<GenresData> labelProvider) {
comboScope.addSelectionHandler(new SelectionHandler<GenresData>() {
public void onSelection(SelectionEvent<GenresData> event) {
@ -1700,5 +1695,4 @@ public class ActiveFiltersPanel extends SimpleContainer {
}
}

View File

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

View File

@ -16,5 +16,7 @@ public interface AccountingManagerCSS extends CssResource {
@ClassName("ribbon")
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"
/> <set-property-fallback name="locale" value="en" /> -->
<!-- <set-configuration-property name="CssResource.style" value="pretty"/> -->
<!--
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"

View File

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