Skip to content

Commit

Permalink
bug/1693 add helper method to center extra long ULURP names
Browse files Browse the repository at this point in the history
     - the custom helper method determines the length of `action.dcpName` and if it is too long, the helper method applies styling to center the text to prevent the ULURP name from obscturing the BBL numbers on smaller screens
  • Loading branch information
horatiorosa committed Jul 6, 2022
1 parent 108227e commit 6193cfc
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 24 deletions.
7 changes: 7 additions & 0 deletions client/app/helpers/center-lengthy-text.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { helper } from '@ember/component/helper';

export function centerLengthyText(text) {
return (text.length > 22) ? 'center-content' : '';
}

export default helper(centerLengthyText);
6 changes: 6 additions & 0 deletions client/app/styles/layouts/_l-default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,9 @@ h5.clickable-header {
box-shadow: 0 0 0 4px rgba(0,0,0,0.1);
}
}

// fixes for the extra long ULURP name & numbers to prevent bleeding into the BBL numbers
.text-tiny .center-content {
display: flex;
justify-content: center;
}
9 changes: 6 additions & 3 deletions client/app/templates/components/milestones/public-hearing.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
<div class="text-tiny">
{{#each @hearing.hearingActions as |action index|}}
{{#if action.dcpName}}
<span class="label light-gray tiny-margin-bottom tiny-margin-right" data-test-hearing-actions-list="{{@hearing.disposition.id}}{{index}}">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
<span class="{{center-lengthy-text action.dcpName}}">
<span class="label light-gray tiny-margin-bottom tiny-margin-right"
data-test-hearing-actions-list="{{@hearing.disposition.id}}{{index}}">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
</span>
</span>
{{/if}}
{{/each}}
Expand Down
18 changes: 12 additions & 6 deletions client/app/templates/components/project-milestone.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@
<div class="text-tiny">
{{#each vote.voteActions as |action index|}}
{{#if action.dcpName}}
<span class="label light-gray tiny-margin-bottom tiny-margin-right" data-test-vote-actions-list="{{vote.disposition.id}}{{index}}">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
<span class="{{center-lengthy-text action.dcpName}}">
<span class="label light-gray tiny-margin-bottom tiny-margin-right"
data-test-vote-actions-list="{{vote.disposition.id}}{{index}}">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
</span>
</span>
{{/if}}
{{/each}}
Expand Down Expand Up @@ -158,9 +161,12 @@
<div class="text-tiny">
{{#each vote.voteActions as |action index|}}
{{#if action.dcpName}}
<span class="label light-gray tiny-margin-bottom tiny-margin-right" data-test-vote-actions-list="{{vote.disposition.id}}{{index}}">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
<span class="{{center-lengthy-text action.dcpName}}">
<span class="label light-gray tiny-margin-bottom tiny-margin-right"
data-test-vote-actions-list="{{vote.disposition.id}}{{index}}">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
</span>
</span>
{{/if}}
{{/each}}
Expand Down
8 changes: 5 additions & 3 deletions client/app/templates/components/to-review-project-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@
<small data-test-hearing-actions-list="{{hearing.disposition.id}}">
{{#each hearing.hearingActions as |action index| ~}}
{{#if action.dcpName}}
<span class="label light-gray tiny-margin-bottom tiny-margin-right">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
<span class="{{center-lengthy-text action.dcpName}}">
<span class="label light-gray tiny-margin-bottom tiny-margin-right">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
</span>
</span>
{{/if}}
{{~/each}}
Expand Down
8 changes: 5 additions & 3 deletions client/app/templates/components/upcoming-project-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@
<small data-test-hearing-actions-list="{{hearing.disposition.id}}">
{{#each hearing.hearingActions as |action index| ~}}
{{#if action.dcpName}}
<span class="label light-gray tiny-margin-bottom tiny-margin-right">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
<span class="{{center-lengthy-text action.dcpName}}">
<span class="label light-gray tiny-margin-bottom tiny-margin-right">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
</span>
</span>
{{/if}}
{{~/each}}
Expand Down
8 changes: 5 additions & 3 deletions client/app/templates/my-projects/assignment/hearing/add.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@
<div class="text-tiny" data-test-hearing-actions-list="{{hearing.disposition.id}}">
{{#each hearing.hearingActions as |action index| ~}}
{{#if action.dcpName}}
<span class="label light-gray tiny-margin-bottom tiny-margin-right">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
<span class="{{center-lengthy-text action.dcpName}}">
<span class="label light-gray tiny-margin-bottom tiny-margin-right">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
</span>
</span>
{{/if}}
{{~/each}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@
<small data-test-hearing-actions-list="{{hearing.disposition.id}}">
{{#each hearing.hearingActions as |action index| ~}}
{{#if action.dcpName}}
<span class="label light-gray tiny-margin-bottom tiny-margin-right">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
<span class="{{(center-lengthy-text action.dcpName}}">
<span class="label light-gray tiny-margin-bottom tiny-margin-right">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
</span>
</span>
{{/if}}
{{~/each}}
Expand Down Expand Up @@ -556,9 +558,11 @@
<small data-test-hearing-actions-list="{{hearing.disposition.id}}">
{{#each hearing.hearingActions as |action index| ~}}
{{#if action.dcpName}}
<span class="label light-gray tiny-margin-bottom tiny-margin-right">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
<span class="{{center-lengthy-text action.dcpName}}">
<span class="label light-gray tiny-margin-bottom tiny-margin-right">
{{action.dcpName}}
<small>{{action.dcpUlurpnumber}}</small>
</span>
</span>
{{/if}}
{{~/each}}
Expand Down

0 comments on commit 6193cfc

Please sign in to comment.