Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #375 from ggalmazor/issue_371_remove_missing_odk_t…
Browse files Browse the repository at this point in the history
…ables_pref

Issue 371 remove missing odk tables pref
  • Loading branch information
ggalmazor authored Jan 14, 2019
2 parents 43987fe + 0f411da commit 6f6b9eb
Show file tree
Hide file tree
Showing 17 changed files with 636 additions and 826 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.opendatakit.aggregate.buildconfig.BuildConfig;
import org.opendatakit.aggregate.client.preferences.Preferences;
import org.opendatakit.aggregate.client.preferences.Preferences.PreferencesCompletionCallback;
import org.opendatakit.aggregate.client.widgets.DisableFasterBackgroundActionsCheckbox;
import org.opendatakit.aggregate.client.widgets.ServletPopupButton;
import org.opendatakit.aggregate.client.widgets.SkipMalformedSubmissionsCheckbox;
import org.opendatakit.aggregate.constants.common.HelpSliderConsts;
Expand Down Expand Up @@ -77,14 +76,12 @@ public class PreferencesSubTab extends AggregateSubTabBase {

private Label enketoApiUrl;
private Label enketoApiToken;
private DisableFasterBackgroundActionsCheckbox disableFasterBackgroundActions;
private SkipMalformedSubmissionsCheckbox skipMalformedSubmissions;

private PreferencesCompletionCallback settingsChange = new PreferencesCompletionCallback() {
@Override
public void refreshFromUpdatedPreferences() {
setCredentialValues();
disableFasterBackgroundActions.updateValue(Preferences.getFasterBackgroundActionsDisabled());
skipMalformedSubmissions.updateValue(Preferences.getSkipMalformedSubmissions());
}

Expand Down Expand Up @@ -188,13 +185,6 @@ public PreferencesSubTab() {
HTML features = new HTML(FEATURES_LABEL);
add(features);

disableFasterBackgroundActions = new DisableFasterBackgroundActionsCheckbox(
Preferences.getFasterBackgroundActionsDisabled(), settingsChange);
add(disableFasterBackgroundActions);

HTML linebreak = new HTML("<br>");
add(linebreak);

skipMalformedSubmissions = new SkipMalformedSubmissionsCheckbox(
Preferences.getSkipMalformedSubmissions(), settingsChange);
add(skipMalformedSubmissions);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
/*
* Copyright (C) 2011 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

package org.opendatakit.aggregate.client.preferences;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.google.gwt.user.server.rpc.XsrfProtect;
import org.opendatakit.aggregate.client.exception.RequestFailureException;

/**
* These actions require the ROLE_USER privilege, which is the least capable
* privilege (granted to all authorized users of the system).
*
* @author [email protected]
*/
@RemoteServiceRelativePath("preferenceservice")
public interface PreferenceService extends RemoteService {
PreferenceSummary getPreferences() throws RequestFailureException;

@XsrfProtect
void setSkipMalformedSubmissions(Boolean skipMalformedSubmissions) throws RequestFailureException;

@XsrfProtect
void setFasterBackgroundActionsDisabled(Boolean disabled) throws RequestFailureException;

}
/*
* Copyright (C) 2011 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

package org.opendatakit.aggregate.client.preferences;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.google.gwt.user.server.rpc.XsrfProtect;
import org.opendatakit.aggregate.client.exception.RequestFailureException;

/**
* These actions require the ROLE_USER privilege, which is the least capable
* privilege (granted to all authorized users of the system).
*
* @author [email protected]
*/
@RemoteServiceRelativePath("preferenceservice")
public interface PreferenceService extends RemoteService {
PreferenceSummary getPreferences() throws RequestFailureException;

@XsrfProtect
void setSkipMalformedSubmissions(Boolean skipMalformedSubmissions) throws RequestFailureException;
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
/*
* Copyright (C) 2011 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

package org.opendatakit.aggregate.client.preferences;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface PreferenceServiceAsync {

void getPreferences(AsyncCallback<PreferenceSummary> callback);

void setFasterBackgroundActionsDisabled(Boolean disabled, AsyncCallback<Void> callback);

void setSkipMalformedSubmissions(Boolean skipMalformedSubmissions, AsyncCallback<Void> callback);

}
/*
* Copyright (C) 2011 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

package org.opendatakit.aggregate.client.preferences;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface PreferenceServiceAsync {

void getPreferences(AsyncCallback<PreferenceSummary> callback);

void setSkipMalformedSubmissions(Boolean skipMalformedSubmissions, AsyncCallback<Void> callback);

}
Original file line number Diff line number Diff line change
@@ -1,75 +1,68 @@
/*
* Copyright (C) 2011 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

package org.opendatakit.aggregate.client.preferences;

import java.io.Serializable;

public class PreferenceSummary implements Serializable {

private static final long serialVersionUID = -53448827282096798L;

private String googleSimpleApiKey;

private String googleApiClientId;

private String enketoApiUrl;

private String enketoApiToken;

private Boolean fasterBackgroundActionsDisabled;

private Boolean skipMalformedSubmissions;

public PreferenceSummary() {

}

public PreferenceSummary(String googleSimpleApiKey, String googleApiClientId,
String enketoApiUrl, String enketoApiToken,
Boolean fasterBackgroundActionsDisabled, Boolean skipMalformedSubmissions) {
this.googleSimpleApiKey = googleSimpleApiKey;
this.googleApiClientId = googleApiClientId;
this.enketoApiUrl = enketoApiUrl;
this.enketoApiToken = enketoApiToken;
this.fasterBackgroundActionsDisabled = fasterBackgroundActionsDisabled;
this.skipMalformedSubmissions = skipMalformedSubmissions;
}

public String getGoogleSimpleApiKey() {
return googleSimpleApiKey;
}

public String getGoogleApiClientId() {
return googleApiClientId;
}

public String getEnketoApiUrl() {
return enketoApiUrl;
}

public String getEnketoApiToken() {
return enketoApiToken;
}

public Boolean getFasterBackgroundActionsDisabled() {
return fasterBackgroundActionsDisabled;
}

public Boolean getSkipMalformedSubmissions() {
return skipMalformedSubmissions;
}
}
/*
* Copyright (C) 2011 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

package org.opendatakit.aggregate.client.preferences;

import java.io.Serializable;

public class PreferenceSummary implements Serializable {

private static final long serialVersionUID = -53448827282096798L;

private String googleSimpleApiKey;

private String googleApiClientId;

private String enketoApiUrl;

private String enketoApiToken;

private Boolean skipMalformedSubmissions;

public PreferenceSummary() {

}

public PreferenceSummary(String googleSimpleApiKey, String googleApiClientId,
String enketoApiUrl, String enketoApiToken,
Boolean skipMalformedSubmissions) {
this.googleSimpleApiKey = googleSimpleApiKey;
this.googleApiClientId = googleApiClientId;
this.enketoApiUrl = enketoApiUrl;
this.enketoApiToken = enketoApiToken;
this.skipMalformedSubmissions = skipMalformedSubmissions;
}

public String getGoogleSimpleApiKey() {
return googleSimpleApiKey;
}

public String getGoogleApiClientId() {
return googleApiClientId;
}

public String getEnketoApiUrl() {
return enketoApiUrl;
}

public String getEnketoApiToken() {
return enketoApiToken;
}

public Boolean getSkipMalformedSubmissions() {
return skipMalformedSubmissions;
}
}
Loading

0 comments on commit 6f6b9eb

Please sign in to comment.