Skip to content

Commit 1eae8e8

Browse files
authored
feat: Announcements in Homepage (#591)
* feat: AnnouncementsList component (#540) * Adds fake endpoint return for development * Basic Announcements list * Basic unstyled Announcements list * Restoring proper announcements endpoint code * Linting issues Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * feat: Announcements container and saga, api and reducer modifications (#541) * Basic container * Adding status code to announcement response * Updating Announcements reducer, sagas and api to support loading and error states * Linting details * Completing the global state fixture * Basic tests for connection Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * Basic card with loading shimmer (#546) Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * feat: Card Styling for announcements (#550) * Shimmering card styles * Basic card typography styling * Add links and link styles to cards * Adjusting card copy per Knowl specs Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * feat: Wiring announcements block on Homepage (#551) * Adds announcemetns to homepage, integrates basic card * Spacing and details * Adjusting loading state * Adds card and see more links logging * Updates layout size; focus detail * Variables on List component styles * Cleaning fake response Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * feat: Adds config for announcements (#562) * Moves config tests, adds config for announcements and test Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * Wiring announcements feature to the config option Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * Updating configuration docs Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * Extracting navLinks logic into the config utils Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * Adds LPL typography to announcements; some layout fine-tuning (#581) Signed-off-by: Marcos Iglesias Valle <golodhros@gmail.com> Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * Fixing merge conflicts Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
1 parent 651059b commit 1eae8e8

46 files changed

Lines changed: 2027 additions & 320 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

amundsen_application/static/css/_animations.scss

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ $loading-curve: cubic-bezier(0.45, 0, 0.15, 1);
1818

1919
.is-shimmer-animated {
2020
animation: $loading-duration shimmer $loading-curve infinite;
21-
background-image: linear-gradient(
22-
to right,
23-
$gray10 0%,
24-
$gray10 33%,
25-
$gray5 50%,
26-
$gray10 67%,
27-
$gray10 100%
28-
);
21+
background-image:
22+
linear-gradient(
23+
to right,
24+
$gray10 0%,
25+
$gray10 33%,
26+
$gray5 50%,
27+
$gray10 67%,
28+
$gray10 100%
29+
);
2930
background-repeat: no-repeat;
3031
background-size: 300% 100%;
3132
}

amundsen_application/static/css/_layouts.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
$resource-header-height: 84px;
77
$aside-separation-space: 40px;
8+
$screen-lg-max: 1490px;
9+
$screen-lg-container: 1440px;
810

911
.resource-detail-layout {
1012
height: calc(100vh - #{$nav-bar-height} - #{$footer-height});
@@ -198,6 +200,12 @@ $aside-separation-space: 40px;
198200
min-width: $body-min-width;
199201
}
200202

203+
@media (min-width: $screen-lg-max) {
204+
#main > .container {
205+
width: $screen-lg-container;
206+
}
207+
}
208+
201209
#main > .container {
202210
margin: 96px auto 48px;
203211
}

amundsen_application/static/css/_typography-default.scss

Lines changed: 178 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,150 @@
33

44
@import 'variables';
55

6+
// New Typography styles based on LPL
7+
// Use these styles going forward
8+
9+
// Placeholder selectors
10+
// Ref: http://thesassway.com/intermediate/understanding-placeholder-selectors
11+
12+
%text-headline-w1 {
13+
font-family: $text-heading-font-family;
14+
font-size: $w1-headline-font-size;
15+
line-height: $w1-headline-line-height;
16+
font-weight: $title-font-weight;
17+
}
18+
19+
%text-headline-w2 {
20+
font-family: $text-heading-font-family;
21+
font-size: $w2-headline-font-size;
22+
line-height: $w2-headline-line-height;
23+
font-weight: $title-font-weight;
24+
}
25+
26+
%text-headline-w3 {
27+
font-family: $text-heading-font-family;
28+
font-size: $w3-headline-font-size;
29+
line-height: $w3-headline-line-height;
30+
font-weight: $title-font-weight;
31+
}
32+
33+
%text-title-w1 {
34+
font-family: $text-body-font-family;
35+
font-size: $w1-font-size;
36+
line-height: $w1-line-height;
37+
font-weight: $title-font-weight;
38+
}
39+
40+
%text-title-w2 {
41+
font-family: $text-body-font-family;
42+
font-size: $w2-font-size;
43+
line-height: $w2-line-height;
44+
font-weight: $title-font-weight;
45+
}
46+
47+
%text-title-w3 {
48+
font-family: $text-body-font-family;
49+
font-size: $w3-font-size;
50+
line-height: $w3-line-height;
51+
font-weight: $title-font-weight;
52+
}
53+
54+
%text-subtitle-w1 {
55+
font-family: $text-body-font-family;
56+
font-size: $w1-font-size;
57+
line-height: $w1-line-height;
58+
font-weight: $subtitle-font-weight;
59+
}
60+
61+
%text-subtitle-w2 {
62+
font-family: $text-body-font-family;
63+
font-size: $w2-font-size;
64+
line-height: $w2-line-height;
65+
font-weight: $subtitle-font-weight;
66+
}
67+
68+
%text-subtitle-w3 {
69+
font-family: $text-body-font-family;
70+
font-size: $w3-font-size;
71+
line-height: $w3-line-height;
72+
font-weight: $subtitle-font-weight;
73+
}
74+
75+
%text-body-w1 {
76+
font-family: $text-body-font-family;
77+
font-size: $w1-font-size;
78+
line-height: $w1-line-height;
79+
font-weight: $body-font-weight;
80+
}
81+
82+
%text-body-w2 {
83+
font-family: $text-body-font-family;
84+
font-size: $w2-font-size;
85+
line-height: $w2-line-height;
86+
font-weight: $body-font-weight;
87+
}
88+
89+
%text-body-w3 {
90+
font-family: $text-body-font-family;
91+
font-size: $w3-font-size;
92+
line-height: $w3-line-height;
93+
font-weight: $body-font-weight;
94+
}
95+
96+
// Typography classes
97+
// Headlines
98+
.text-headline-w1 {
99+
@extend %text-headline-w1;
100+
}
101+
102+
.text-headline-w2 {
103+
@extend %text-headline-w2;
104+
}
105+
106+
.text-headline-w3 {
107+
@extend %text-headline-w3;
108+
}
109+
110+
// Titles
111+
.text-title-w1 {
112+
@extend %text-title-w1;
113+
}
114+
115+
.text-title-w2 {
116+
@extend %text-title-w2;
117+
}
118+
119+
.text-title-w3 {
120+
@extend %text-title-w3;
121+
}
122+
123+
// Subtitles
124+
.text-subtitle-w1 {
125+
@extend %text-subtitle-w1;
126+
}
127+
128+
.text-subtitle-w2 {
129+
@extend %text-subtitle-w2;
130+
}
131+
132+
.text-subtitle-w3 {
133+
@extend %text-subtitle-w3;
134+
}
135+
136+
// Body
137+
.text-body-w1 {
138+
@extend %text-body-w1;
139+
}
140+
141+
.text-body-w2 {
142+
@extend %text-body-w2;
143+
}
144+
145+
.text-body-w3 {
146+
@extend %text-body-w3;
147+
}
148+
149+
// Typography Helpers
6150
.text-center {
7151
text-align: center;
8152
}
@@ -15,6 +159,40 @@
15159
text-align: right;
16160
}
17161

162+
.truncated {
163+
white-space: nowrap;
164+
overflow: hidden;
165+
text-overflow: ellipsis;
166+
}
167+
168+
// Text for Screen Readers only
169+
// Reference: Bootstrap 4 codebase
170+
.sr-only {
171+
position: absolute !important;
172+
width: 1px !important;
173+
height: 1px !important;
174+
padding: 0 !important;
175+
margin: -1px !important;
176+
overflow: hidden !important;
177+
clip: rect(0, 0, 0, 0) !important;
178+
white-space: nowrap !important;
179+
border: 0 !important;
180+
}
181+
182+
// From https://gist.github.com/igorescobar/d74a76629bab47d601d71c3a6e010ff2
183+
@mixin truncate($font-size, $line-height, $lines-to-show) {
184+
display: block; // Fallback for non-webkit
185+
display: -webkit-box;
186+
font-size: $font-size;
187+
line-height: $line-height;
188+
-webkit-line-clamp: $lines-to-show;
189+
-webkit-box-orient: vertical;
190+
overflow: hidden;
191+
text-overflow: ellipsis;
192+
}
193+
194+
// Old typography styles
195+
// DEPRECATED - Don't use!
18196
h1,
19197
h2,
20198
h3,
@@ -184,23 +362,3 @@ body {
184362
.text-primary {
185363
color: $text-primary;
186364
}
187-
188-
.truncated {
189-
white-space: nowrap;
190-
overflow: hidden;
191-
text-overflow: ellipsis;
192-
}
193-
194-
// Text for Screen Readers only
195-
// Reference: Bootstrap 4 codebase
196-
.sr-only {
197-
position: absolute !important;
198-
width: 1px !important;
199-
height: 1px !important;
200-
padding: 0 !important;
201-
margin: -1px !important;
202-
overflow: hidden !important;
203-
clip: rect(0, 0, 0, 0) !important;
204-
white-space: nowrap !important;
205-
border: 0 !important;
206-
}

amundsen_application/static/css/_variables-default.scss

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ $stroke-underline: $gray40 !default;
2727
// Typography
2828
$text-primary: $gray100 !default;
2929
$text-secondary: $gray60 !default;
30-
$text-secondary: $gray60 !default;
3130
$text-tertiary: $gray40 !default;
3231
$text-placeholder: $gray40 !default;
3332
$text-inverse: $white !default;
@@ -130,3 +129,39 @@ $spacer-1: $spacer-size;
130129
$spacer-2: $spacer-size * 2;
131130
$spacer-3: $spacer-size * 3;
132131
$spacer-4: $spacer-size * 4;
132+
133+
// Elevations (from LPL)
134+
$elevation-level1: 0 0 1px 0 rgba(0, 0, 0, 0.12),
135+
0 1px 1px 1px rgba(0, 0, 0, 0.08);
136+
$elevation-level2: 0 0 1px 0 rgba(0, 0, 0, 0.12),
137+
0 2px 3px 0 rgba(0, 0, 0, 0.16);
138+
$elevation-level3: 0 0 1px 0 rgba(0, 0, 0, 0.12),
139+
0 2px 4px 0 rgba(0, 0, 0, 0.16);
140+
$elevation-level4: 0 0 1px 0 rgba(0, 0, 0, 0.12),
141+
0 3px 6px 0 rgba(0, 0, 0, 0.16);
142+
143+
// New Typography variables based on LPL
144+
$text-heading-font-family: $font-family-header;
145+
$text-body-font-family: $font-family-body;
146+
147+
$w1-font-size: 20px;
148+
$w1-line-height: 24px;
149+
150+
$w2-font-size: 16px;
151+
$w2-line-height: 20px;
152+
153+
$w3-font-size: 14px;
154+
$w3-line-height: 18px;
155+
156+
$w1-headline-font-size: 36px;
157+
$w1-headline-line-height: 40px;
158+
159+
$w2-headline-font-size: 26px;
160+
$w2-headline-line-height: 28px;
161+
162+
$w3-headline-font-size: 22px;
163+
$w3-headline-line-height: 24px;
164+
165+
$title-font-weight: $font-weight-body-bold;
166+
$subtitle-font-weight: $font-weight-body-semi-bold;
167+
$body-font-weight: $font-weight-body-regular;

amundsen_application/static/js/components/AnnouncementPage/tests/index.spec.tsx renamed to amundsen_application/static/js/components/AnnouncementPage/index.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
AnnouncementPageProps,
1414
mapDispatchToProps,
1515
mapStateToProps,
16-
} from '..';
16+
} from '.';
1717

1818
describe('AnnouncementPage', () => {
1919
let props: AnnouncementPageProps;

amundsen_application/static/js/components/AnnouncementPage/index.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ import './styles.scss';
1414

1515
import { GlobalState } from 'ducks/rootReducer';
1616
import { GetAnnouncementsRequest } from 'ducks/announcements/types';
17-
import { getAnnouncements } from 'ducks/announcements/reducer';
17+
import { getAnnouncements } from 'ducks/announcements';
1818
import { AnnouncementPost } from 'interfaces';
1919

20+
const ANNOUNCEMENTS_HEADER_TEXT = 'Announcements';
21+
2022
export interface StateFromProps {
2123
posts: AnnouncementPost[];
2224
}
@@ -29,7 +31,9 @@ export type AnnouncementPageProps = StateFromProps & DispatchFromProps;
2931

3032
export class AnnouncementPage extends React.Component<AnnouncementPageProps> {
3133
componentDidMount() {
32-
this.props.announcementsGet();
34+
const { announcementsGet } = this.props;
35+
36+
announcementsGet();
3337
}
3438

3539
createPost(post: AnnouncementPost, postIndex: number) {
@@ -47,7 +51,9 @@ export class AnnouncementPage extends React.Component<AnnouncementPageProps> {
4751
}
4852

4953
createPosts() {
50-
return this.props.posts.map((post, index) => {
54+
const { posts } = this.props;
55+
56+
return posts.map((post, index) => {
5157
return this.createPost(post, index);
5258
});
5359
}
@@ -57,9 +63,9 @@ export class AnnouncementPage extends React.Component<AnnouncementPageProps> {
5763
<DocumentTitle title="Announcements - Amundsen">
5864
<main className="container announcement-container">
5965
<div className="row">
60-
<div className="col-xs-12">
66+
<div className="col-xs-12 col-md-10 col-md-offset-1">
6167
<h1 id="announcement-header" className="h3">
62-
Announcements
68+
{ANNOUNCEMENTS_HEADER_TEXT}
6369
</h1>
6470
<hr />
6571
<div id="announcement-content" className="announcement-content">

amundsen_application/static/js/components/BrowsePage/tests/index.spec.tsx renamed to amundsen_application/static/js/components/BrowsePage/index.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as DocumentTitle from 'react-document-title';
77
import { shallow } from 'enzyme';
88

99
import TagsListContainer from 'components/common/Tags';
10-
import { BrowsePage } from '..';
10+
import { BrowsePage } from '.';
1111

1212
describe('BrowsePage', () => {
1313
const setup = () => {

amundsen_application/static/js/components/BrowsePage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class BrowsePage extends React.Component {
1717
<DocumentTitle title={BROWSE_PAGE_DOCUMENT_TITLE}>
1818
<main className="container">
1919
<div className="row">
20-
<div className="col-xs-12">
20+
<div className="col-xs-12 col-md-10 col-md-offset-1">
2121
<TagsListContainer shortTagsList={false} />
2222
</div>
2323
</div>

0 commit comments

Comments
 (0)