-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/changenote settings #901
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
Open
lrosenstrom
wants to merge
33
commits into
develop
Choose a base branch
from
feature/changenote-settings
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
4545b5c
WIP on change note user settings
lrosenstrom 02516b1
Get change categories + labels from the data instead
lrosenstrom cae6e9a
Use flexbox instead of table
lrosenstrom f474a43
Simplify icon rotation css + make it work
lrosenstrom c16d9bc
*Naming things *Don't expand category list by default
lrosenstrom 0dd1eb6
Sort list of sigels for changecategory view
lrosenstrom abcf5aa
Use sigel label instead of friendly name
lrosenstrom 4a62eea
Cleanup
lrosenstrom 830bacb
Write changenote notification email to user db
lrosenstrom e54dacb
Use library uri instead of library code in changesettings db
lrosenstrom e0bf139
Fix collection uri generation
lrosenstrom d036174
Fix sigelUri again
lrosenstrom fe76f94
Fix nullpointer on work extraction
lrosenstrom b23a37d
Cleanup
lrosenstrom 9a2e23d
Let frontend facilitate a simple commit message in adminmetadata instead
lrosenstrom 8db1bac
Alternative: overwrite changenote for each change.
lrosenstrom 402a1cd
Label -> comment
lrosenstrom 1c4fec4
Fix hightlight not being removed automatically
lrosenstrom 2d8e587
Remove TODO
lrosenstrom 0d8a1a1
Remove unused changenote code
lrosenstrom f6b6c83
WIP
lrosenstrom 9a7484a
Avoid messing with the activeSearchType state when in the 'changes' view
lrosenstrom 951d964
Make search tab menu look reasonable
lrosenstrom ab44db7
Restore file deleted by mistake
lrosenstrom da96898
Put change note search under directory care
lrosenstrom 22d87de
Fix reverse relations spinner in change note search
lrosenstrom 506d30d
Wrapper for change note view
lrosenstrom fd41d23
Search directly on change note view page load
lrosenstrom 84e7d7a
Allow only one set of change categories for all library codes
lrosenstrom 2ab0280
Aktivt sigel -> Aktiv sigel
lrosenstrom ee2bc16
WIP on facets
lrosenstrom 77157eb
Checkboxes
lrosenstrom cf4d910
Checkboxes
lrosenstrom 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ import { mixin as clickaway } from 'vue-clickaway'; | |
| import * as DisplayUtil from 'lxljs/display'; | ||
| import EncodingLevelIcon from '@/components/shared/encoding-level-icon'; | ||
| import TypeIcon from '@/components/shared/type-icon'; | ||
| import CheckBox from '@/components/shared/check-box'; | ||
| import FacetMixin from '@/components/mixins/facet-mixin'; | ||
| import Facet from './facet.vue'; | ||
|
|
||
|
|
@@ -18,6 +19,10 @@ export default { | |
| expanded: { | ||
| type: Boolean, | ||
| }, | ||
| isChangeView: { | ||
| type: Boolean, | ||
| default: false, | ||
| }, | ||
| }, | ||
| data() { | ||
| return { | ||
|
|
@@ -47,7 +52,7 @@ export default { | |
| this.$store.dispatch('setUser', userObj); | ||
| }, | ||
| featuredComparison(facet) { | ||
| if (this.group.dimension === '@reverse.itemOf.heldBy.@id') { | ||
| if (this.isCollectionGroup(this.group.dimension)) { | ||
| // Featured code for '@reverse.itemOf.heldBy.@id' | ||
| const userSigels = this.user.collections.map(item => item.code); | ||
| if (facet.object.hasOwnProperty('sigel')) { | ||
|
|
@@ -61,6 +66,20 @@ export default { | |
| } | ||
| return false; | ||
| }, | ||
| defaultChecked(facet) { | ||
| if (this.isChangeFacetGroup) { | ||
| const id = facet.object['@id']; | ||
| return this.checkedCategoriesAndSigels.includes(id); | ||
| } | ||
| return false; | ||
| }, | ||
| checked(link, id) { | ||
| console.log('link', JSON.stringify(link)); | ||
| console.log('id', JSON.stringify(id)); | ||
| }, | ||
| isCollectionGroup(dim) { | ||
| return dim === '@reverse.itemOf.heldBy.@id' || dim === '[email protected].@id'; | ||
| }, | ||
| }, | ||
| computed: { | ||
| settings() { | ||
|
|
@@ -76,6 +95,7 @@ export default { | |
| const self = this; | ||
| const list = this.group.observation.map((o) => { | ||
| let label; | ||
| console.log('observation', JSON.stringify(o)); | ||
| if (o.object.hasOwnProperty('@id')) { | ||
| label = DisplayUtil.getItemLabel( | ||
| o.object, | ||
|
|
@@ -96,6 +116,7 @@ export default { | |
| amount: o.totalItems, | ||
| link: o.view['@id'], | ||
| featured: self.featuredComparison(o), | ||
| isDefaultChecked: self.defaultChecked(o), | ||
| }; | ||
| }); | ||
| return list; | ||
|
|
@@ -132,7 +153,7 @@ export default { | |
| }, | ||
| featuredFacets() { | ||
| let featured = this.facets.filter(o => o.featured === true); | ||
| if (this.group.dimension === '@reverse.itemOf.heldBy.@id') { | ||
| if (this.isCollectionGroup(this.group.dimension)) { | ||
| const activeSigel = this.user.settings.activeSigel; | ||
| featured = sortBy(featured, o => o.object.sigel !== activeSigel && o.label !== activeSigel && o.label !== `library/${activeSigel}`); | ||
| } | ||
|
|
@@ -161,11 +182,18 @@ export default { | |
| hasScroll() { | ||
| return !this.revealLevels[this.currentLevel] && this.isExpanded; | ||
| }, | ||
| isChangeFacetGroup() { | ||
| return (this.group.dimension === 'category.@id' || this.group.dimension === '[email protected].@id') && this.isChangeView; | ||
| }, | ||
| checkedCategoriesAndSigels() { | ||
| return [...this.changeCategories.map(c => c.heldBy), ...this.changeCategories.find(c => c.hasOwnProperty('triggers')).triggers]; | ||
| }, | ||
| }, | ||
| components: { | ||
| Facet, | ||
| EncodingLevelIcon, | ||
| TypeIcon, | ||
| CheckBox, | ||
| }, | ||
| }; | ||
| </script> | ||
|
|
@@ -209,7 +237,13 @@ export default { | |
| :class="{'is-expanded' : isExpanded, 'has-scroll' : hasScroll}"> | ||
| <facet v-for="facetItem in featuredFacets" | ||
| :facet="facetItem" | ||
| :key="'featured_'+facetItem.link"> | ||
| :key="'featured_'+facetItem.link" | ||
| :is-link="!isChangeFacetGroup"> | ||
| <check-box v-if="group.dimension === '[email protected].@id' && isChangeView" | ||
| slot="checkbox" | ||
| :checkedProperty="facetItem.object['@id']" | ||
| :isChosen="facetItem.isDefaultChecked" | ||
| @changed="checked(facetItem.link, facetItem.object['@id'])"></check-box> | ||
| <encoding-level-icon | ||
| slot="icon" | ||
| v-if="group.dimension === 'meta.encodingLevel'" | ||
|
|
@@ -223,7 +257,13 @@ export default { | |
| <hr v-show="featuredFacets.length > 0"> | ||
| <facet v-for="facetItem in normalFacets" | ||
| :facet="facetItem" | ||
| :key="facetItem.link"> | ||
| :key="facetItem.link" | ||
| :is-link="!isChangeFacetGroup"> | ||
| <check-box v-if="group.dimension === 'category.@id' || group.dimension === '[email protected].@id' && isChangeView" | ||
| slot="checkbox" | ||
| :checkedProperty="facetItem.object['@id']" | ||
| :isChosen="facetItem.isDefaultChecked" | ||
| @changed="checked(facetItem.link, facetItem.object['@id'])"></check-box> | ||
| <encoding-level-icon | ||
| slot="icon" | ||
| v-if="group.dimension === 'meta.encodingLevel'" | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,68 @@ | ||
| <script> | ||
| import { mapGetters } from 'vuex'; | ||
|
|
||
| export default { | ||
| name: 'check-box', | ||
| props: { | ||
| checkedProperty: { | ||
| type: String, | ||
| default: '', | ||
| }, | ||
| tooltipText: { | ||
| type: String, | ||
| default: '', | ||
| }, | ||
| isChosen: { | ||
| type: Boolean, | ||
| default: false, | ||
| }, | ||
| }, | ||
| data() { | ||
| return { | ||
| }; | ||
| }, | ||
| methods: { | ||
| onChange(e) { | ||
| this.$emit('changed', e); | ||
| // emit on change and let the parent handle it. | ||
| }, | ||
| }, | ||
| computed: { | ||
| ...mapGetters([ | ||
| 'resources', | ||
| ]), | ||
| }, | ||
| components: { | ||
| }, | ||
| mounted() { | ||
| this.$nextTick(() => {}); | ||
| }, | ||
| }; | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="TypeIcon"> | ||
| <input id="test" class="customCheckbox-input" type="checkbox" @change="onChange" :checked="isChosen"> | ||
| <div class="customCheckbox-icon"></div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style lang="less"> | ||
| .TypeIcon { | ||
| background-color: @grey-lightest; | ||
| color: @brand-primary; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| min-width: 20px; | ||
| height: 20px; | ||
| border-radius: 0.25rem; | ||
| margin-right: 5px; | ||
| font-size: 12px; | ||
|
|
||
| &-label { | ||
| font-weight: 800; | ||
| } | ||
| } | ||
|
|
||
| </style> |
This file contains hidden or 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
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.
It is mostly a hygiene detail. Is it possible to use a bit more generic or less libris-centric names excluding the word sigel in some of these function or var/const names? Since the sigel is by our definition the code on something and not the actual entity it describes (contrary to how we use it in natural language, the hard part here being it plays different roles and is not always a library). Are we meaning userLocation? Not a stopper by any means and should it turn out to be too timeconsuming to figure out I wouldn't argue it easier to revisit later when the model and definitions around this is clearer.
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.
We can change it to 'collection', because that's what it is called in the user store?