Skip to content

Commit 2c2a9fa

Browse files
authored
Fixed the css and refactored the hbs file (#1664)
- Ticket: [ENG-4051] ## Purpose Fixed the CSS for cutting off a button on the mobile view on the Project Analytics Page > Linked Projects ## Summary of Changes Updated the analytics-page/andon/application/template.hbs to be the same dom structure and css. Updated the analytics-page/andon/application/styles.scss to have a @media screen and (max-device-height: 500px) attribute to change the max-height, padding and margin-bottom.
1 parent badcff8 commit 2c2a9fa

File tree

2 files changed

+68
-61
lines changed

2 files changed

+68
-61
lines changed

lib/analytics-page/addon/application/styles.scss

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
@media (min-width: 768px) {
2-
.Counts {
3-
display: flex;
4-
}
5-
}
6-
7-
@media (max-width: 767px) {
8-
.CountBox:global(.panel) {
9-
margin-left: 15px;
10-
margin-right: 15px;
11-
}
12-
}
131

142
.Counts {
153
margin-top: 20px;
@@ -64,3 +52,24 @@
6452
margin: 0;
6553
border: 0;
6654
}
55+
56+
@media (min-width: 768px) {
57+
.Counts {
58+
display: flex;
59+
}
60+
}
61+
62+
@media (max-width: 768px) {
63+
.CountBox:global(.panel) {
64+
margin-left: 15px;
65+
margin-right: 15px;
66+
}
67+
}
68+
69+
@media screen and (max-device-height: 500px) {
70+
:global(.modal-body) {
71+
max-height: 60vh;
72+
padding: 0;
73+
margin-bottom: 0;
74+
}
75+
}

lib/analytics-page/addon/application/template.hbs

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -18,57 +18,55 @@
1818
{{/if}}
1919
</div>
2020
</div>
21-
<div class='col-sm-4' local-class='CountBox'>
22-
<div class='panel panel-default'>
23-
<div class='panel-body'>
24-
<h3>{{t 'analytics.links'}}</h3>
25-
{{#if this.loading}}
26-
{{loading-indicator dark=true}}
27-
{{else}}
28-
<h2>{{this.linkedByCount}}</h2>
29-
<button
30-
type='button'
31-
class='btn btn-link'
32-
local-class='button-link'
33-
{{on 'click' this.showLinksModal}}
34-
>
35-
{{t 'analytics.viewLinks'}}
36-
</button>
37-
{{#if this.linksModalShown}}
38-
{{#bs-modal-simple
39-
title=(t 'analytics.links')
40-
closeTitle=(t 'general.close')
41-
onHide=(action 'hideLinksModal')
42-
}}
43-
{{#if this.node}}
44-
<ul class='list-group'>
45-
{{#paginated-list/has-many
46-
model=this.node
47-
relationshipName='linkedByNodes'
48-
query=this.linkedByQueryParams
49-
analyticsScope='Project Analytics - Links'
50-
as |list|
51-
}}
52-
<list.item as |node|>
53-
<NodeCard
54-
@node={{node}}
55-
@readOnly={{true}}
56-
@analyticsScope='Project Analytics - Links'
57-
/>
58-
</list.item>
21+
<div class='col-sm-4 panel panel-default' local-class='CountBox'>
22+
<div class='panel-body'>
23+
<h3>{{t 'analytics.links'}}</h3>
24+
{{#if this.loading}}
25+
{{loading-indicator dark=true}}
26+
{{else}}
27+
<h2>{{this.linkedByCount}}</h2>
28+
<button
29+
type='button'
30+
class='btn btn-link'
31+
local-class='button-link'
32+
{{on 'click' this.showLinksModal}}
33+
>
34+
{{t 'analytics.viewLinks'}}
35+
</button>
36+
{{#if this.linksModalShown}}
37+
{{#bs-modal-simple
38+
title=(t 'analytics.links')
39+
closeTitle=(t 'general.close')
40+
onHide=(action 'hideLinksModal')
41+
}}
42+
{{#if this.node}}
43+
<ul class='list-group'>
44+
{{#paginated-list/has-many
45+
model=this.node
46+
relationshipName='linkedByNodes'
47+
query=this.linkedByQueryParams
48+
analyticsScope='Project Analytics - Links'
49+
as |list|
50+
}}
51+
<list.item as |node|>
52+
<NodeCard
53+
@node={{node}}
54+
@readOnly={{true}}
55+
@analyticsScope='Project Analytics - Links'
56+
/>
57+
</list.item>
5958

60-
<list.empty>
61-
{{t 'analytics.noLinks'}}
62-
</list.empty>
63-
{{/paginated-list/has-many}}
64-
</ul>
65-
{{else}}
66-
<LoadingIndicator @dark={{true}} />
67-
{{/if}}
68-
{{/bs-modal-simple}}
69-
{{/if}}
59+
<list.empty>
60+
{{t 'analytics.noLinks'}}
61+
</list.empty>
62+
{{/paginated-list/has-many}}
63+
</ul>
64+
{{else}}
65+
<LoadingIndicator @dark={{true}} />
66+
{{/if}}
67+
{{/bs-modal-simple}}
7068
{{/if}}
71-
</div>
69+
{{/if}}
7270
</div>
7371
</div>
7472
<div class='col-sm-4 panel panel-default' local-class='CountBox'>

0 commit comments

Comments
 (0)