-
Notifications
You must be signed in to change notification settings - Fork 6
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
Basic project overview page #110
Conversation
I had to switch to session["context"] instead of g.context for filtering
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #110 +/- ##
==========================================
+ Coverage 63.32% 72.42% +9.09%
==========================================
Files 18 20 +2
Lines 668 747 +79
==========================================
+ Hits 423 541 +118
+ Misses 245 206 -39 ☔ View full report in Codecov by Sentry. |
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.
Nice work. I have some comments attached. This PR scope is much smaller than I anticipated, at only +274 lines. I think the biggest improvement would be to support multiple contexts with a single module class via the context
constructor argument, rather than introducing new module classes, especially if a fair amount of the logic can be re-used.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…ject-overview-notes
* Draft necessary additions * Add questions in comments * project_overview * Add sidebar to project page * Use module context to filter modules in job sidebar * Use layout as parent for all pages again * Decouple View options from Module options * Show Modules in separate box * Add Project view to side menu * Don't make signac-dashoard name a link * Make checkboxes only affect relevant modules. I had to switch to session["context"] instead of g.context for filtering * Add different icon for project * Copy in minimal code to display project doc * Add project image viewer * Additional changes for project image viewer * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix import order and year * Refactor DocumentList to name based on context * Fix html indendation * Fix block syntax * Update code comments * Add whitespace control to multiline jinja expression * Use snake_case * Add argument to get_cards in Module * Enable text display for project * Add project schema view as copied from document list * Update project overview page title * Remove temp comment * Shorten url * Unify getting project and job files * Separate modal label from job id * Note how to use same render template for both * Generalize image viewer * Fix LazyView when mapping multiple urls to one endpoint * Set multiple routes to the get_file endpoint * Remove project image viewer specific files * Add todo * Add note on refactoring * Remove project-only modules names from __all__ * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix improper merge of layout * Use send_from_directory for project files * Add note for implementation * Generalize video viewer module * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove project-specific modules from init * Display number of jobs in project overview * Remove extra newline * Remove explanatory comment * Refactor get_file * Refactor image_viewer get_cards * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove unused import so flake8 passes. * Fix import. * Add trailing slash to top level pages * Add project overview rendering test * Add module enabled_contexts * Add test of modules in all enabled_contexts * Add test to raise error if bad context is given * Apply black formatting * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update docstrings and autodoc * Add proposed changelog entry * Default to JobContext * Remove setting mimetype for log files * Simplify job/project directory access * Also catch LookupError with different message * Apply doc changes from code review * Use quicker way to count jobs * Don't use OrderedDict for project schema * Simplify context checking logic and readability * Move context setting to render project and job methods * Revert "Don't use OrderedDict for project schema" This reverts commit e4be835. * Use g.active_page instead of session["context"] * Update link to source of code example * Move enabled_contexts out of constructor * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Move module name back to first argument * Set session context to fix module change bug * Remove obj argument in superclass Co-authored-by: Bradley Dice <[email protected]> * Replace OrderedDict with dict * Fix sidebar box visibility * Hide view options when viewing a single job * Make project cards multicolumn * Bring back view and module selecting on mobile * Add no cards message / no modules message for project info * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Divide modules by context - Replace enabled_modules list of indices with a dictionary with keys the contexts - Duplicate modules by using modules_by_context, to be replaced in the future * Simplify module enabling logic by using new data structure * Fix test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename enabled_modules to enabled_module_indices * Enable separate warning message when no modules are enabled * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix pre-commit errors * Apply suggestions to initialize modules_by_context Co-authored-by: Bradley Dice <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Move Dashboard._prepare into __init__ * Fix errors for no modules added * Use better name for unified template for schema and job document * Fix dict iteration * Factor out escaping truncated values * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix changelog version. * Make _supported_contexts class level * Make modules_by_context private * Add more tests for module visibility One is commented out because it fails. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update error message. * Fix error type and message. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename parameter to data, add docstring. * Convert to string with str. * Fix TODO. * Use dict literal. * Fix GET request. * Fix flake8. * Fix JobContext module test * Add docstring and subset parameter to SchemaView module * Change SchemaView to Schema * Rename schema_display file * Add default empty set _supported_contexts * Update copyright year * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename to escaped_dict_display * Clean up views.py * Update changelog * Update readme and docstring examples * Add Charlotte to contributors * Add ProjectContext examples to the readme * Fix changelog * Update module docstring * Update image and video viewer docstrings * Small doc fixes * Add (failing?) job sidebar test * Fix tests * Fix wrong default argument for Schema * Fix tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Document each module's supported contexts * Update changelog * Fix long line * Fix indentation in contributors * Remove redundant check in render project view * Fix problem initializing enabled_module_indices in session * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Set default enable_module_indices in injections * Formatting * Add test to catch the enabled_module_indices error * Set better default value of enabled_module_indices Co-authored-by: Charlotte Shiqi Zhao <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bradley Dice <[email protected]> Co-authored-by: Tim Moore <[email protected]>
Description
Overall changes:
New module added only for ProjectContext:
Modules that now support ProjectContext:
Modules that should be enabled eventually:
TODO:
Motivation and Context
Prototype to start addressing #27
Checklist: