-
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
[#1791] Update design for case statuses #821
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4746ce9
[#1791] Starting design update of case detail status
jiromaykin b7d4d43
:sparkles: [#1791] Add statustype configuration to each status in det…
stevenbal a8386a7
:sparkles: [#1791] Pass eindstatustype information to case detail fro…
stevenbal bdcd1d6
[#1791] Added case status accordion styling
jiromaykin b30845d
[#1791] Update mocks and fix failing test(s)
pi-sigma 28e76a9
Merge branch 'develop' into feature/1791-design-status-case-detail
pi-sigma eb05214
[#1791] Added styles for case detail page
jiromaykin 57507c4
Merge branch 'develop' into feature/1791-design-status-case-detail
alextreme 97c7d14
:art: [#1791] Added disabled contact-button, and case status logic-st…
jiromaykin 6adabf3
[#1791] Positioned continuous line before case status
jiromaykin bef22c2
[#1791] Corrected cases statuses after review
jiromaykin 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
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
31 changes: 21 additions & 10 deletions
31
src/open_inwoner/components/templates/components/StatusIndicator/StatusIndicator.html
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 |
---|---|---|
@@ -1,12 +1,23 @@ | ||
{% load icon_tags %} | ||
{% if status_indicator %} | ||
<div class="card__header {{ status_indicator }}"> | ||
{% if status_indicator == "success" %} | ||
{% icon icon="check_circle" icon_position="after" extra_classes="icon--"|add:status_indicator %} {{status_indicator_text}} | ||
{% elif status_indicator == "failure" %} | ||
{% icon icon="cancel" icon_position="after" extra_classes="icon--"|add:status_indicator %} {{status_indicator_text}} | ||
{% else %} | ||
{% icon icon=status_indicator icon_position="after" extra_classes="icon--"|add:status_indicator %} {{status_indicator_text}} | ||
{% endif %} | ||
</div> | ||
{% if status_indicator_text %} | ||
<div class="card__header {{ status_indicator }}"> | ||
{% if status_indicator == "info" %} | ||
{% icon icon="info" icon_position="after" extra_classes="icon--"|add:status_indicator outlined=True %} | ||
<span class="card__status_indicator_text">{{status_indicator_text}}</span> | ||
{% elif status_indicator == "success" %} | ||
{% icon icon="check_circle" icon_position="after" extra_classes="icon--"|add:status_indicator outlined=True %} | ||
jiromaykin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<span class="card__status_indicator_text">{{status_indicator_text}}</span> | ||
{% elif status_indicator == "failure" %} | ||
{% icon icon="cancel" icon_position="after" extra_classes="icon--"|add:status_indicator outlined=True %} | ||
<span class="card__status_indicator_text">{{status_indicator_text}}</span> | ||
{% elif status_indicator == "warning" %} | ||
{% icon icon="warning_amber" icon_position="after" extra_classes="icon--"|add:status_indicator outlined=True %} | ||
<span class="card__status_indicator_text">{{status_indicator_text}}</span> | ||
{% else %} | ||
{% icon icon="info" icon_position="after" extra_classes="icon--default" outlined=True %} | ||
<span class="card__status_indicator_text">{{status_indicator_text}}</span> | ||
{% endif %} | ||
</div> | ||
{% else %} | ||
<div class="card__header }}"></div> | ||
{% endif %} |
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,25 @@ | ||
export class DisableCaseContactButton { | ||
static selector = '.case-contact-form' | ||
|
||
constructor(form) { | ||
this.form = form | ||
this.contactTextarea = this.form.querySelector('textarea') | ||
this.form.addEventListener('input', this.handleTextareaInput.bind(this)) | ||
} | ||
|
||
handleTextareaInput() { | ||
const submitButton = this.form.querySelector('button[type="submit"]') | ||
|
||
if (this.contactTextarea.value === '') { | ||
submitButton.setAttribute('disabled', 'true') | ||
submitButton.classList.add('button--disabled') | ||
} else { | ||
submitButton.removeAttribute('disabled') | ||
submitButton.classList.remove('button--disabled') | ||
} | ||
} | ||
} | ||
|
||
document | ||
.querySelectorAll(DisableCaseContactButton.selector) | ||
.forEach((caseContactForm) => new DisableCaseContactButton(caseContactForm)) |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
import './document_upload' | ||
import './spinner' | ||
import './status_accordion' |
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,49 @@ | ||
export class StatusAccordion { | ||
static selector = '.status-list__list-item' | ||
|
||
constructor(node) { | ||
this.node = node | ||
this.buttons = node.querySelectorAll('.status-list__button') | ||
this.buttons.forEach((button) => { | ||
button.addEventListener( | ||
'click', | ||
this.toggleStatusAccordion.bind(this, node) | ||
) | ||
}) | ||
} | ||
|
||
toggleStatusAccordion(node, event) { | ||
event.preventDefault() | ||
const statusContent = node.querySelector( | ||
'.status-list__notification-content' | ||
) | ||
setTimeout(() => { | ||
console.log('status is clicked') | ||
|
||
// Toggle any status list-element (current, completed, final, future) | ||
node.classList.toggle( | ||
'status--open', | ||
!node.classList.contains('status--open') | ||
) | ||
// Control toggle of only current and final elements | ||
statusContent.classList.toggle( | ||
'status-content--open', | ||
!statusContent.classList.contains('status-content--open') | ||
) | ||
|
||
this.buttons.forEach((button) => { | ||
button.setAttribute( | ||
'aria-expanded', | ||
button.getAttribute('aria-expanded') === 'true' ? 'false' : 'true' | ||
) | ||
}) | ||
}, 5) | ||
} | ||
} | ||
|
||
/** | ||
* Controls the toggling of expanded case-status content | ||
*/ | ||
document | ||
.querySelectorAll(StatusAccordion.selector) | ||
.forEach((statusToggle) => new StatusAccordion(statusToggle)) |
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.
Should be refactored in develop?
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.
@alextreme Do you mean there is an equivalent for this in Develop already? These values are part of Steven's commits on which I am relying to build the front-end, so I need them :-)
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.
@jiromaykin I mean that the objects.all() call is incorrect/inefficient, but this should have already been fixed on develop. The values should remain the same afaik