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

refactor: css and use ci colours #482

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.


# compiled output
public/assets/tailwind.css

/dist
/tmp

Expand Down
17 changes: 13 additions & 4 deletions frontend/app/analysis/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,18 @@
as |f|
>
<TaskSelection
@on-set-customer={{queue (fn (mut f.model.customer)) (fn this.validate f.model)}}
@on-set-project={{queue (fn (mut f.model.project)) (fn this.validate f.model)}}
@on-set-task={{queue (fn (mut f.model.task)) (fn this.validate f.model)}}
@on-set-customer={{queue
(fn (mut f.model.customer))
(fn this.validate f.model)
}}
@on-set-project={{queue
(fn (mut f.model.project))
(fn this.validate f.model)
}}
@on-set-task={{queue
(fn (mut f.model.task))
(fn this.validate f.model)
}}
@initial={{hash
customer=this._customer
project=this._project
Expand Down Expand Up @@ -234,4 +243,4 @@
</div>
<div class="grid-cell"></div>
</div>
</PagePermission>
</PagePermission>
61 changes: 34 additions & 27 deletions frontend/app/analysis/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
<h1>Analysis</h1>

{{#unless this.prefetchData.isRunning}}
<TaskSelection
@history={{false}}
@archived={{true}}
@on-set-customer={{fn this.setModelFilter "customer"}}
@on-set-project={{fn this.setModelFilter "project"}}
@on-set-task={{fn this.setModelFilter "task"}}
@initial={{hash
customer=this.selectedCustomer
project=this.selectedProject
task=this.selectedTask
comment=this.comment
}}
as |t|
>
<FilterSidebar
@appliedCount={{this.appliedFilters.length}}
@onReset={{queue t.clear this.reset}}
as |fs|
<TaskSelection
@history={{false}}
@archived={{true}}
@on-set-customer={{fn this.setModelFilter "customer"}}
@on-set-project={{fn this.setModelFilter "project"}}
@on-set-task={{fn this.setModelFilter "task"}}
@initial={{hash
customer=this.selectedCustomer
project=this.selectedProject
task=this.selectedTask
comment=this.comment
}}
as |t|
>
<FilterSidebar
@appliedCount={{this.appliedFilters.length}}
@onReset={{queue t.clear this.reset}}
as |fs|
>
<fs.group @label="Task" @expanded={{true}}>
<fs.label>
Customer
Expand All @@ -45,12 +45,19 @@
</fs.label>
<fs.label>
Comment
<fs.filter data-test-filter-comment>
{{#let (unique-id) as |id|}}
<label for={{id}} hidden>comment</label>
<input id={{id}} value={{this.comment}} {{ on "change" (fn this.setModelFilterOnChange "comment")}} class="form-control comment-field" placeholder="Comment" name="comment" />
{{/let}}
</fs.filter>
<fs.filter data-test-filter-comment>
{{#let (unique-id) as |id|}}
<label for={{id}} hidden>comment</label>
<input
id={{id}}
value={{this.comment}}
{{on "change" (fn this.setModelFilterOnChange "comment")}}
class="form-control comment-field"
placeholder="Comment"
name="comment"
/>
{{/let}}
</fs.filter>
</fs.label>
</fs.group>
<fs.group @label="Responsibility">
Expand Down Expand Up @@ -230,8 +237,8 @@
</fs.label>

</fs.group>
</FilterSidebar>
</TaskSelection>
</FilterSidebar>
</TaskSelection>
{{/unless}}

{{#if this.appliedFilters.length}}
Expand Down Expand Up @@ -482,4 +489,4 @@
</div>
{{/if}}
</PagePermission>
{{/if}}
{{/if}}
2 changes: 1 addition & 1 deletion frontend/app/application/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

<div id="filter-sidebar-target"></div>

{{outlet}}
{{outlet}}
2 changes: 1 addition & 1 deletion frontend/app/components/async-list/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
</div>
{{else}}
{{yield "body" @data.value}}
{{/if}}
{{/if}}
2 changes: 1 addition & 1 deletion frontend/app/components/attendance-slider/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default class AttendanceSlider extends Component {

labels.push({
value: pad2joincolon(h, m),
size: m === 0 ? "lg" : "sm",
size: m === 0 ? "text-black/80" : "text-black/65",
style: htmlSafe(`left: ${offsetH + offsetM}%;`),
});
}
Expand Down
15 changes: 9 additions & 6 deletions frontend/app/components/attendance-slider/template.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="attendance-slider" ...attributes>
<div class="attendance-slider pt-4 relative" ...attributes>
<RangeSlider
@start={{this.start}}
@step={{15}}
Expand All @@ -12,25 +12,28 @@
@on-change={{perform this.save}}
/>

<div class="slider-labels">
<div class="slider-labels relative h-12 text-black/85">
{{#each this.labels as |label|}}
<div
style={{label.style}}
class="slider-label slider-label--{{label.size}}"
class="slider-label
{{label.size}}
flex absolute top-4 -translate-x-3/4 text-3xs"
>
<div class="slider-label-text">
<div class="slider-label-text -rotate-45">
{{label.value}}
</div>
</div>
{{/each}}
</div>

<div class="slider-title">
<div class="slider-title absolute top-0 left-0 text-xs text-black">
<span>{{this.duration}}</span>
<FaIcon
@icon="trash-can"
class="cursor-pointer"
data-test-delete-attendance="true"
{{on "click" (perform this.delete)}}
/>
</div>
</div>
</div>
10 changes: 5 additions & 5 deletions frontend/app/components/balance-donut/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ class BalanceDonutComponent extends Component {
return abs(this.args.balance.usedDays / this.args.balance.credit);
}

get color() {
get strokeClass() {
if (this.args.balance.usedDuration) {
return "primary";
return "stroke-primary";
}

if (this.value > 1 || this.value < 0) {
return "danger";
return "stroke-danger";
}

if (this.value === 1) {
return "warning";
return "stroke-warning";
}

return "success";
return "stroke-adfinis-green/75";
}

radius = 100 / (2 * PI);
Expand Down
17 changes: 10 additions & 7 deletions frontend/app/components/balance-donut/template.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div {{style this.style}} class="{{@class}} balance-donut {{this.color}}">
<div class="donut-title">{{@title}}</div>
<div {{style this.style}} class="{{@class}} balance-donut {{this.strokeClass}} relative translate-y-[calc(var(--max-offset)*var(--offset-multiplicator))] md:basis-24 text-black/85">
<div class="donut-title text-center text-2xl">{{@title}}</div>

<div class="donut">
<div class="donut relative">
<svg width="100%" height="100%" viewBox="0 0 40 40">
<circle
class="donut-ring"
class="donut-ring stroke-adfinis-darkgrey/60"
cx="20"
cy="20"
r={{this.radius}}
Expand All @@ -19,17 +19,20 @@
r={{this.radius}}
fill="transparent"
stroke-width="2"
stroke-dasharray="{{mult (min this.value 1) 100}} {{mult (sub 1 (min this.value 1)) 100}}"
stroke-dasharray="{{mult (min this.value 1) 100}} {{mult
(sub 1 (min this.value 1))
100
}}"
stroke-dashoffset="25"
></circle>
</svg>

<div class="donut-content">
<div class="donut-content absolute flex justify-center items-center text-center paddin-4 p-4 inset-0 w-full h-full flex-col">
{{#if @balance.usedDuration}}
{{format-duration @balance.usedDuration false}}
{{else}}
{{#if @balance.credit}}
<div>{{@balance.usedDays}} of {{@balance.credit}}</div>
<div class="text-xs text-adfinis-darkgrey">{{@balance.usedDays}} of {{@balance.credit}}</div>
{{#if (gte @balance.credit 1)}}
<div>{{round (mult this.value 100)}}%</div>
{{/if}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div ...attributes title="This project's comments are visible to the customer">
<FaIcon @icon="eye" />
</div>
</div>
2 changes: 1 addition & 1 deletion frontend/app/components/date-buttons/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
type="button"
{{on "click" (fn this.selectDate choice)}}
>{{choice}}</button>
{{/each}}
{{/each}}
6 changes: 3 additions & 3 deletions frontend/app/components/date-navigation/template.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="date-navigation btn-toolbar" ...attributes>
<div class="date-navigation btn-toolbar flex flex-row" ...attributes>
<div class="btn-group">
<MagicLinkBtn />
</div>
<div class="btn-group">
<div class="btn-group mx-6">
<button
type="button"
data-test-previous
Expand Down Expand Up @@ -33,4 +33,4 @@
</div>

<SyDatepickerBtn @value={{@current}} @onChange={{@onChange}} />
</div>
</div>
2 changes: 1 addition & 1 deletion frontend/app/components/duration-since/template.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span>
<span ...attributes>
{{format-duration this.duration}}
</span>
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
{{else}}
{{yield}}
{{/if}}
</div>
</div>
22 changes: 13 additions & 9 deletions frontend/app/components/filter-sidebar/group/template.hbs
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<div class="filter-sidebar-group {{if this.expanded 'filter-sidebar-group--expanded'}}">
<div
class="filter-sidebar-group
{{if this.expanded 'filter-sidebar-group--expanded'}}"
>
<a
href="#"
class="filter-sidebar-group-label"
{{on "click" (toggle "expanded" this)}}>
{{on "click" (toggle "expanded" this)}}
>
{{@label}}
<FaIcon
@icon="angle-right"
@prefix="fas"
@transform="{{if this.expanded 'rotate-90'}}"
/>
</a>
<div class="filter-sidebar-group-body">
<div class="filter-sidebar-group-content">
{{yield}}
</div>
/>
</a>
<div class="filter-sidebar-group-body">
<div class="filter-sidebar-group-content">
{{yield}}
</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion frontend/app/components/filter-sidebar/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
{{! template-lint-disable}}
{{on "click" (fn (mut this.visible) false)}}
></div>
{{/in-element}}
{{/in-element}}
9 changes: 6 additions & 3 deletions frontend/app/components/magic-link-btn/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
class="btn btn-default"
{{on "click" (toggle "isModalVisible" this)}}
>
<FaIcon @icon="bolt" @prefix="fas" />
<FaIcon @icon="bolt" @prefix="fas" />
{{#if this.isModalVisible}}
<MagicLinkModal @isVisible={{this.isModalVisible}} @onClose={{toggle "isModalVisible" this}} />
<MagicLinkModal
@isVisible={{this.isModalVisible}}
@onClose={{toggle "isModalVisible" this}}
/>
{{/if}}
</button>
</button>
17 changes: 4 additions & 13 deletions frontend/app/components/magic-link-modal/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
data-test-magic-link-modal
as |modal|
>
<div
class="magic-link-modal"
data-test-magic-link-form
>
<div class="magic-link-modal" data-test-magic-link-form>
<modal.header>
Create a magic link
</modal.header>
Expand All @@ -20,15 +17,9 @@
@on-set-task={{this.onSetTask}}
as |t|
>
<div
class="form-list-cell form-group"
>{{t.customer}}</div>
<div
class="form-list-cell form-group"
>{{t.project}}</div>
<div
class="form-list-cell form-group"
>{{t.task}}</div>
<div class="form-list-cell form-group">{{t.customer}}</div>
<div class="form-list-cell form-group">{{t.project}}</div>
<div class="form-list-cell form-group">{{t.task}}</div>
</TaskSelection>
</div>

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/no-mobile-message/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
Try opening this page on a larger device, or go back to the
<LinkTo @route="index">home page</LinkTo>!
</p>
</div>
</div>
Loading
Loading