Repository navigation
Overhaul School Vocabulary Manager - #9608
michaelchadwick wants to merge 1 commit into
Conversation
✅ Deploy Preview for ilios-frontend ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Visual Diff Report — PASSED2264 images compared: 104 added · 2160 identical DetailsAdded Files (104)
Download the results. |
bebf909 to
6062c2e
Compare
|
I'm liking the progress! Two quick notes after a cursory review: First - can we get a "add new (top-level) term" tooltip for the big add (+) icon, similar to what we have for the individual sub-term add icons? |
|
Todo:
|
239b5a5 to
a0d6c41
Compare
a0d6c41 to
479f9bc
Compare
| vocabulary: this.args.vocabulary, | ||
| active: true, | ||
| active: isActive, | ||
| ...(parent ? { parent } : {}), |
There was a problem hiding this comment.
This looks weird to me, not sure why it is destructuring the parent if it's set. I guess it works, but
| ...(parent ? { parent } : {}), | |
| parent: termParent ?? null, | |
| // or | |
| if (parent) { | |
| term.parent = parent; | |
| } |
would be a little bit clearer IMO.
There was a problem hiding this comment.
I agree it looks odd. I tried your suggestions, but it broke it. Investigating into it more.
There was a problem hiding this comment.
Just changing it like this was the simpler fix:
...
parent,
});
| if (parent) { | ||
| const siblings = await parent.children; | ||
| siblings.splice(siblings.indexOf(term), 1); | ||
| parent.set('children', siblings); | ||
| } |
There was a problem hiding this comment.
This feels a little bit like an old ember-data pattern. I don't think this is necessary anymore, and it might be possible to remove it entirely. If not let's get together and play with some options.
There was a problem hiding this comment.
This was unchanged code, btw, but you're right: it's not needed. I got rid of it, tests pass, and feature still seems to work.
| ); | ||
| } | ||
| <span class="actions"> | ||
| {{#if @canUpdate}} |
There was a problem hiding this comment.
Can this ever be true? Doesn't seem like we'd want actions on the new term form.
There was a problem hiding this comment.
This is for the "Edit" icon to appear, so you can switch back to it.
My only reason for removing it would be because we assume that once you've gotten here from the "Edit Term" form that you obviously have @canUpdate permissions, so there's no need to check again. /shrug
| } | ||
|
|
||
| get itemElement() { | ||
| return document.getElementById(this.itemId); |
There was a problem hiding this comment.
I'm ok with this, but I think a setElement = modifier((element) => this.itemElement = element); would be a little easier to grok. Then the itemId can go away as well.
There was a problem hiding this comment.
I don't see this convention anywhere else in the codebase. Can you expand on how this would work?
| export default class SchoolVocabularyTermsListComponent extends Component { | ||
| @cached | ||
| get termsData() { | ||
| if (this.args.terms !== undefined) { |
There was a problem hiding this comment.
This is confusing for me, as far as I can tell this component is only called in one place and the terms are always passed in.
There was a problem hiding this comment.
Sometimes there are no terms passed in because the filter prevents it.
| assert.strictEqual(component.items[1].title, 'Zebra'); | ||
| }); | ||
|
|
||
| test('clicking list item does nothing if not permitted to update', async function (assert) { |
There was a problem hiding this comment.
We're also losing the tooltip when update isn't enabled. I think it should probably stick around.
There was a problem hiding this comment.
Added the tooltip and row highlighting back even when @canUpdate is false. Cursor does not turn into pointer and the toggling is still off, though.
| durationInYears: Duration (in Years) | ||
| durationMinutes: "{count, plural, =1 {1 minute} other {# minutes}}" | ||
| edit: Edit | ||
| editSubTerm: Edit Sub-term |
There was a problem hiding this comment.
I don't think we need this split. It can always be Edit Term
There was a problem hiding this comment.
Team discussion in a previous meeting decided to split the strings up into "Edit Term" and "Edit Sub-term" so as to further disambiguate where in the tree of terms you're editing, so I think we should keep it.
| newSchool: New School | ||
| newSession: New Session | ||
| newSessionType: New Session Type | ||
| newSubTerm: New Sub-term |
There was a problem hiding this comment.
I don't think we need this split. It can always be New Term
There was a problem hiding this comment.
Team discussion in a previous meeting decided to split the strings up into "New Term" and "New Sub-term" so as to further disambiguate where in the tree of terms you're adding, so I think we should keep it.
fd05ea1 to
7051a6b
Compare
7051a6b to
dab366b
Compare
Fixes ilios/ilios#6927
The current School Vocabulary Manager needed an overhaul and that's what this PR does.
The Taxonomy Manager could probably use some updates, like adding term counts, but that's a separate PR.
Old

Bold
