Skip to content

Commit

Permalink
Merge pull request #64 from jobready/feature/NEP-5881
Browse files Browse the repository at this point in the history
NEP-5881: Conditionally hide Export Results button
  • Loading branch information
dn-readytech committed Mar 19, 2018
2 parents e279bda + 809afac commit 57e5239
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
7 changes: 6 additions & 1 deletion dist/react-filterbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8483,7 +8483,7 @@ var FilterBar = exports.FilterBar = (function (_React$Component) {
this.context.filterBarStore.isConfigurable() && React.createElement(ConfigurationButton, {
filterBarStore: this.context.filterBarStore
}),
React.createElement(ExportResultsButton, {
this.context.filterBarStore.isExportable() && React.createElement(ExportResultsButton, {
filterBarActor: this.context.filterBarActor
}),
React.createElement(BatchActionsList, null)
Expand Down Expand Up @@ -11882,6 +11882,11 @@ var FilterBarStore = exports.FilterBarStore = (function () {
return this.getConfigurationUrl() !== undefined;
}
},
isExportable: {
value: function isExportable() {
return this.getExportResultsUrl() !== undefined;
}
},
setSavedSearches: {
value: function setSavedSearches(savedSearches) {
this.savedSearches = savedSearches;
Expand Down
6 changes: 3 additions & 3 deletions dist/react-filterbar.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ gulp.task('neptune', function() {
.transform(babelify)
.bundle()
.pipe(source(appDistFile))
.pipe(gulp.dest('../neptune/vendor/assets/bower_components/react-filterbar/dist'));
.pipe(gulp.dest('/app/vendor/assets/bower_components/react-filterbar/dist'));
});

gulp.task('marcus', function() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-filterbar",
"version": "1.18.2",
"version": "1.18.3",
"description": "",
"main": "dist/react-filterbar.js",
"engines": {
Expand Down
8 changes: 5 additions & 3 deletions src/components/FilterBar/FilterBar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ export class FilterBar extends React.Component {
/>
}

<ExportResultsButton
filterBarActor={this.context.filterBarActor}
/>
{this.context.filterBarStore.isExportable() &&
<ExportResultsButton
filterBarActor={this.context.filterBarActor}
/>
}

<BatchActionsList />
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/stores/FilterBarStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ export class FilterBarStore {
return this.getConfigurationUrl() !== undefined;
}

isExportable() {
return this.getExportResultsUrl() !== undefined;
}

setSavedSearches(savedSearches) {
this.savedSearches = savedSearches;
this.emitChange();
Expand Down

0 comments on commit 57e5239

Please sign in to comment.