Skip to content
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

KAS-2683 (DES-802): Elementen/structuur omzetten naar Octane componenten - pills #981

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/components/access-level-pill.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
{{else}}
{{#if (not @confidential)}}
{{#if (not this.isEditing)}}
<span
class={{this.pillClass}}
<Auk::Pill
@skin={{this.pillSkin}}
class="auk-u-cursor-pointer"
data-test-access-level-pill
{{on "click" this.toggleEdit}}
Copy link
Contributor Author

@brenner-company brenner-company Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikiDi Goed gezien 🤭

>
{{this.accessLevelLabel}}
</span>
</Auk::Pill>
{{else}}
<div style="width:75%">
<Utils::ModelSelector
Expand Down
11 changes: 4 additions & 7 deletions app/components/access-level-pill.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ export default class AccessLevelPillComponent extends Component {
return !this.args.confidential;
}

get pillClass() {
const baseClass = 'auk-pill';
const classes = [baseClass, 'auk-u-cursor-pointer'];
get pillSkin() {
let modifier;
if (this.args.accessLevel) {
switch (this.args.accessLevel.uri) {
Expand All @@ -47,11 +45,10 @@ export default class AccessLevelPillComponent extends Component {
modifier = 'danger';
break;
}
if (modifier) {
classes.push(`${baseClass}--${modifier}`);
}
} else {
modifier = 'default';
}
return classes.join(' ');
return modifier;
}

get accessLevelLabel() {
Expand Down
12 changes: 7 additions & 5 deletions app/components/agenda/agenda-overview/agenda-overview-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,14 @@
{{/if}}
</div>
{{#if this.subcase.confidential}}
<span class="vlc-agenda-items__confidentiality-button auk-pill auk-pill--danger" data-test-agenda-overview-item-confidentiality-locked>
<div class="auk-icon auk-icon--default vlc-agenda-items__icons">
<i class="ki ki-lock-closed"></i>
</div>
<Auk::Pill
@skin="danger"
@icon="lock-closed"
class="auk-u-ml-2"
data-test-agenda-overview-item-confidentiality-locked
>
{{t "confidential"}}
</span>
</Auk::Pill>
{{/if}}
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/components/agenda/agendaitem/agendaitem-news-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
<hr/>
<div class="auk-u-mb-4 auk-u-mt-2">
{{#if @newsletterInfo.finished}}
<div class="auk-pill auk-pill--success">
<Auk::Pill @skin="success">
{{t "finished"}}
</div>
</Auk::Pill>
{{else}}
<div class="auk-pill auk-pill--warning">
<Auk::Pill @skin="warning">
{{t "not-finished"}}
</div>
</Auk::Pill>
{{/if}}
</div>
</div>
8 changes: 4 additions & 4 deletions app/components/agenda/agendaitem/agendaitem-press.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
<hr/>
<div class="auk-u-mt-2">
{{#if agendaitem.forPress}}
<div class="auk-pill auk-pill--success">
<Auk::Pill @skin="success">
{{t "for-press"}}
</div>
</Auk::Pill>
{{else}}
<div class="auk-pill auk-pill--warning">
<Auk::Pill @skin="warning">
{{t "not-public-press"}}
</div>
</Auk::Pill>
{{/if}}
</div>
{{else}}
Expand Down
4 changes: 2 additions & 2 deletions app/components/decision/decision-result-pill.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="auk-pill {{this.modifierClass}}">
<Auk::Pill @skin={{this.skin}}>
{{@decisionResultCode.label}}
</div>
</Auk::Pill>
10 changes: 5 additions & 5 deletions app/components/decision/decision-result-pill.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import Component from '@glimmer/component';
import CONSTANTS from 'frontend-kaleidos/config/constants';

export default class DecisionResultPill extends Component {
get modifierClass() {
get skin() {
const codes = CONSTANTS.DECISION_RESULT_CODE_URIS;
const selectedUri = this.args.decisionResultCode.get('uri');
if (selectedUri === codes.GOEDGEKEURD) {
return 'auk-pill--success';
return 'success';
} else if (selectedUri === codes.UITGESTELD) {
return 'auk-pill--warning';
return 'warning';
}
// } else if (selectedUri === codes.INGETROKKEN) {
// return 'auk-pill--danger';
// return 'danger';
// }
return '';
return 'default';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>
<div class="auk-form-group">
<Auk::Label>{{t "document-type"}}</Auk::Label>
<Auk::Pill class="auk-pill--white">
<Auk::Pill @skin="white">
{{this.translationDocument.file.extension}}
</Auk::Pill>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
<div class="auk-form-group">
<Auk::Label>{{t "document-type"}}</Auk::Label>
<Auk::Pill class="auk-pill--white">
<Auk::Pill @skin="white">
{{this.translationDocument.file.extension}}
</Auk::Pill>
</div>
Expand Down
7 changes: 5 additions & 2 deletions app/components/subcase/subcase-case/subcase-titles.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@
{{#if (not subcase.showAsRemark)}}
<div class="auk-u-mb-2">
{{#if (await subcase.subcaseName)}}
<span class={{await pillClass}}>
<Auk::Pill
@skin={{await pillSkin}}
class="auk-u-text-capitalize"
>
{{await subcase.subcaseName}}
</span>
</Auk::Pill>
{{/if}}
</div>
{{/if}}
Expand Down
11 changes: 5 additions & 6 deletions app/components/subcase/subcase-case/subcase-titles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ export default class SubcaseTitles extends Component {
subcase = null;

@computed('subcase.approved')
get pillClass() {
return this.getPillClass();
get pillSkin() {
return this.getPillSkin();
}

async getPillClass() {
const baseClass = 'auk-pill auk-u-text-capitalize';
async getPillSkin() {
const approved = await this.subcase.get('approved');
if (approved) {
return `${baseClass} auk-pill--success`;
return 'success';
}
return `${baseClass} auk-pill--default`;
return 'default';
}

@action
Expand Down
11 changes: 0 additions & 11 deletions app/styles/custom-components/_vlc-agenda-items.scss
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,6 @@ $i: 0;
}
}

.vlc-agenda-items__confidentiality-button {
margin-left: 1rem;
align-items: center;
color: white;
}

.vlc-agenda-items__sub-item a:hover .vlc-agenda-items__confidentiality-button,
.vlc-agenda-items__sub-item a:hover .vlc-agenda-items__confidentiality-button .vlc-agenda-items__icons {
color: white;
}

.vlc-agenda-items__text {
width: 100%;
}
Expand Down