-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/download tab #1635
Feature/download tab #1635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As always: neat code, good tests.
The download component is a bit heavy, but the functionality all directly concerns downloading, so that's fine.
The new look for the download tab is a lot better.
this.totalResults?.complete(); | ||
this.resultsConfig?.complete(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful closing of the observables here, I wouldn't have thought to do so if replacing them with a new stream.
Out of curiosity, did problems arise when not closed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is more "good practice", because we're creating observables in ngOnChanges
, it's good to close them when new input comes in.
But this is triggered when the input receives a new queryModel
. That's really an edge case. (See #1247 (comment) for more detail.)
import { QueryModel } from '../models'; | ||
import { mockCorpus } from '../../../mock-data/corpus'; | ||
import { commonTestBed } from '../../common-test-bed'; | ||
import { QueryModel } from '../../models'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The imports for models and services would benefit from path mapping in tsconfig.json
if (state.tab === 'search-results') { | ||
return { tab: null }; | ||
} else { | ||
return state; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Familiarizing myself with the store
stuff, which does look very neat.
I wonder if something like a 'default state' would be beneficial to add as an option in StoreSync
? In this case if the tab is search-results
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, good point. Filters have something like that, but perhaps it could be generalised to more models.
This moves the download menu into a separate tab.
The download tab includes a form with all options for the download; it replaces both the "download" button on the top (with the attached dropdown menu) and the options dialogue window. (The options dialogue is still used in the download history, though.)
close #1310
close #1029
close #674
close #1118 (this suggested an alternative approach)
Screen capture:
Screencast.from.19-07-24.12.12.12.webm
Notes:
tab
parameter. Old routes will continue to work.tags
andcontext
as forbidden field names. This isn't because of any changes in this PR, I just noticed they should have been added.