-
Notifications
You must be signed in to change notification settings - Fork 5
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/changenote settings #901
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 9 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 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
108 changes: 108 additions & 0 deletions
108
vue-client/src/components/usersettings/change-categories.vue
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,108 @@ | ||
<script> | ||
import { mapGetters } from 'vuex'; | ||
import * as StringUtil from 'lxljs/string'; | ||
import LensMixin from '@/components/mixins/lens-mixin'; | ||
|
||
export default { | ||
name: 'change-categories', | ||
mixins: [LensMixin], | ||
data() { | ||
return { | ||
expanded: false, | ||
}; | ||
}, | ||
props: { | ||
sigel: Object, | ||
availableCategories: [], | ||
}, | ||
methods: { | ||
updateChangeCategories(e, sigel, categoryId) { | ||
this.$store.dispatch('updateSubscribedChangeCategories', { libraryId: sigel.code, categoryId: categoryId, checked: e.target.checked }); | ||
}, | ||
toggleExpanded() { | ||
this.expanded = !this.expanded; | ||
}, | ||
isActiveCategory(categoryId) { | ||
const obj = this.userChangeCategories.find(c => c.heldBy === this.sigel.code); | ||
return obj ? obj.triggers.includes(categoryId) : false; | ||
}, | ||
label(obj) { | ||
return this.getLabel(obj); | ||
}, | ||
}, | ||
computed: { | ||
...mapGetters([ | ||
'userChangeCategories', | ||
]), | ||
isExpanded() { | ||
return this.expanded; | ||
}, | ||
sigelLabel() { | ||
return StringUtil.getSigelLabel(this.sigel); | ||
}, | ||
}, | ||
mounted() { | ||
this.$nextTick(() => { | ||
}); | ||
}, | ||
}; | ||
</script> | ||
|
||
<template> | ||
<div class="Categories"> | ||
<div class="Categories-label" @click="toggleExpanded"> | ||
<i class="Categories-arrow fa fa-chevron-right" | ||
:class="{'icon is-expanded' : isExpanded}" | ||
></i> | ||
{{ sigelLabel }} | ||
</div> | ||
|
||
<div v-if="isExpanded"> | ||
<div class="Categories-row" v-for="category in availableCategories" :key="category['@id']"> | ||
<div class="Categories-key">{{ label(category) }}</div> | ||
<div class="Categories-value"> | ||
<input id="categoryCheckbox" | ||
class="customCheckbox-input" | ||
type="checkbox" | ||
@change="updateChangeCategories(...arguments, sigel, category['@id'])" :checked="isActiveCategory(category['@id'])"> | ||
<div class="customCheckbox-icon"></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped lang="less"> | ||
.Categories { | ||
&-arrow { | ||
transition: all 0.2s ease; | ||
padding: 0 2px; | ||
font-size: 14px; | ||
color: @grey-darker-transparent; | ||
|
||
&.is-expanded { | ||
transform: rotate(90deg); | ||
} | ||
.Categories-label:hover & { | ||
color: @black | ||
} | ||
} | ||
&-row { | ||
display: flex; | ||
border: solid @grey-lighter; | ||
border-width: 0px 0px 1px 0px; | ||
} | ||
&-key { | ||
padding: 0.5em; | ||
width: 50%; | ||
} | ||
&-value { | ||
padding: 0.5em; | ||
width: 50%; | ||
} | ||
&-label { | ||
padding: 0.5em; | ||
cursor: pointer; | ||
} | ||
} | ||
</style> |
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
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
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
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?