Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match mesos artifact defaults #1434

Merged
merged 2 commits into from Feb 28, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;

public class SingularityMesosArtifact {
private final String uri;
Expand All @@ -11,18 +12,18 @@ public class SingularityMesosArtifact {

@JsonCreator
public static SingularityMesosArtifact fromString(String uri) {
return new SingularityMesosArtifact(uri, false, false, false);
return new SingularityMesosArtifact(uri, Optional.<Boolean>absent(), Optional.<Boolean>absent(), Optional.<Boolean>absent());
}

@JsonCreator
public SingularityMesosArtifact(@JsonProperty("uri") String uri,
@JsonProperty("cache") boolean cache,
@JsonProperty("executable") boolean executable,
@JsonProperty("extract") boolean extract) {
@JsonProperty("cache") Optional<Boolean> cache,
@JsonProperty("executable") Optional<Boolean> executable,
@JsonProperty("extract") Optional<Boolean> extract) {
this.uri = uri;
this.cache = cache;
this.executable = executable;
this.extract = extract;
this.cache = cache.or(false);
this.executable = executable.or(true);
this.extract = extract.or(false);
}

public String getUri() {
Expand Down
Expand Up @@ -553,7 +553,7 @@ class NewDeployForm extends Component {

<div id="mesos-artifact-button-row" className="row">
<div className="col-sm-6">
<button className="btn btn-success btn-block" onClick={event => this.addObjectToArrayFieldPreventDefault('uris', {}, event)}>
<button className="btn btn-success btn-block" onClick={event => this.addObjectToArrayFieldPreventDefault('uris', {extract: true}, event)}>
<span className="glyphicon glyphicon-plus"></span>
{" Artifact"}
</button>
Expand Down
2 changes: 1 addition & 1 deletion SingularityUI/app/components/newDeployForm/fields.es6
Expand Up @@ -104,7 +104,7 @@ export const MESOS_ARTIFACT_FIELDS = [
{id: 'uri', type: 'text', required: true},
{id: 'cache', type: 'text'},
{id: 'executable', type: 'text'},
{id: 'extract', type: 'text'}
{id: 'extract', type: 'text', default: true}
];

export const ARTIFACT_FIELDS = {
Expand Down