-
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
New global store version + new dynamic styling for categorization page #66
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d02d096
New version of global store + new means of dynamic styling via store …
jarmoza d17c7bc
Delete mapper-missingdata.vue
jarmoza f73ece4
Delete missingdata.vue
jarmoza 4be1cca
Streamlining of landing and categorization pages components and rewor…
jarmoza 2ebb3fe
Reintroduction of category to column map and store init function alon…
jarmoza 3f6aaa5
Inserting categoryClasses mutation helper code into category setup fu…
jarmoza b659431
Switching categoryClasses back into a regular store field accessible …
jarmoza bf1069c
Update column linking table loading code for new data dictionary obje…
jarmoza cf94902
suggestion to make table method more compact
surchs a0e79d4
suggestion to move state keeping to global store
surchs 49579d3
Small, final suggested changes for PR 66
jarmoza c3d3f0e
Categorization page merge with current
jarmoza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<template> | ||
|
||
<b-container fluid> | ||
|
||
<!-- Heading for category select component --> | ||
<b-row> | ||
<h3>{{ title }}</h3> | ||
</b-row> | ||
|
||
<!-- Instructions prompting the user how to link categories and columns --> | ||
<b-row> | ||
<p class="instructions-text">{{ instructions }}</p> | ||
</b-row> | ||
|
||
<!-- Category selection table --> | ||
<b-row> | ||
<b-table | ||
head-variant="dark" | ||
:items="categoryTable" | ||
outlined | ||
@row-selected="selectCategory" | ||
select-mode="single" | ||
selectable | ||
selected-variant="" | ||
:tbody-tr-class="styleTableRow" | ||
thead-class="hidden"> | ||
</b-table> | ||
</b-row> | ||
|
||
</b-container> | ||
|
||
</template> | ||
|
||
<script> | ||
|
||
export default { | ||
|
||
data() { | ||
|
||
return { | ||
|
||
selectedCategory: this.categories[0] | ||
}; | ||
}, | ||
|
||
computed: { | ||
|
||
categoryTable() { | ||
|
||
// Return a list of dicts for each category in the table | ||
return this.categories.map((name) => ({ category: name })); | ||
} | ||
}, | ||
|
||
methods: { | ||
|
||
selectCategory(p_row) { | ||
|
||
// If a new category was selected... | ||
if ( 0 !== p_row.length ) { | ||
|
||
// 1. Save the newly selected category, if given | ||
this.selectedCategory = p_row[0].category; | ||
|
||
// 2. Tell the parent page about the category selction | ||
this.$emit("category-select", { category: this.selectedCategory }); | ||
} | ||
}, | ||
|
||
styleTableRow(p_row, p_rowType) { | ||
|
||
// 1. Determine the opacity for this row | ||
let opacityClass = ( this.selectedCategory != p_row.category ) ? | ||
"category-transparent" : "category-opaque"; | ||
|
||
// 2. Get the color class for this row | ||
let colorClass = this.categoryClasses[p_row.category]; | ||
|
||
return [opacityClass, colorClass]; | ||
} | ||
}, | ||
|
||
props: ["categories", "categoryClasses", "instructions", "title"] | ||
} | ||
|
||
</script> | ||
|
||
<style> | ||
|
||
.category-transparent { | ||
|
||
opacity: 0.5; | ||
} | ||
|
||
.category-opaque { | ||
|
||
opacity: 1.0; | ||
} | ||
|
||
.instructions-text { | ||
|
||
color: grey; | ||
font-style: italic; | ||
} | ||
|
||
</style> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
|
||
<b-container fluid> | ||
|
||
<!-- Category to column linking table --> | ||
<b-table | ||
bordered | ||
outlined | ||
:fields="fields" | ||
head-variant="dark" | ||
:items="tableData" | ||
@row-clicked="applyCategory" | ||
:tbody-tr-class="styleTableRow"> | ||
</b-table> | ||
|
||
</b-container> | ||
|
||
</template> | ||
|
||
<script> | ||
|
||
export default { | ||
|
||
methods: { | ||
|
||
applyCategory(p_row, p_index, p_event) { | ||
|
||
// Tell the parent page that a column has been linked with a category | ||
this.$emit("column-name-selected", { column: p_row.column }); | ||
}, | ||
|
||
styleTableRow(p_row, p_rowType) { | ||
|
||
// Check to see what category has been assigned to this row's column, if any | ||
let assignedCategory = this.columnToCategoryMap[p_row.column]; | ||
|
||
return ( null === assignedCategory ) ? "" : this.categoryClasses[assignedCategory]; | ||
} | ||
}, | ||
|
||
props: [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here too I'd say let's type these and declare the required props. |
||
|
||
"categoryClasses", | ||
"columnToCategoryMap", | ||
"fields", | ||
"selectedCategory", | ||
"tableData" | ||
] | ||
} | ||
</script> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Let's give these props a type and also define the ones that are required. See also the Vue style guide: https://v2.vuejs.org/v2/style-guide/?redirect=true#Prop-definitions-essential
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.
This is good stuff.
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.
See: #70