Skip to content

Commit

Permalink
updates to investment status component
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmypixel committed Aug 11, 2017
1 parent 83a24e6 commit 6e70288
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 138 deletions.
2 changes: 1 addition & 1 deletion assets/stylesheets/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
@import "components/local-nav";
@import "components/messages";
@import "components/meta-item";
@import "components/meta-list";
@import "components/metadata-list";
@import "components/pagination";
@import "components/phase-badge";
@import "components/proposition-menu";
@import "components/results";
@import "components/results-summary";
@import "components/status-bar";

// Style examples on components page
@import "components/.example";
5 changes: 0 additions & 5 deletions assets/stylesheets/components/_local-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
margin-bottom: $default-spacing-unit;
}

.status-bar {
margin-top: $default-spacing-unit * 2;
margin-bottom: -$default-spacing-unit;
}

.c-entity-search__aggregations {
margin-bottom: -$default-spacing-unit * 2;
}
Expand Down
11 changes: 11 additions & 0 deletions assets/stylesheets/components/_meta-list.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import "../settings";

.c-meta-list {
.c-meta-item {
margin-right: $default-spacing-unit;
}

.c-meta-item__label {
display: block;
}
}
40 changes: 0 additions & 40 deletions assets/stylesheets/components/_status-bar.scss

This file was deleted.

4 changes: 4 additions & 0 deletions assets/stylesheets/layout/_assemblies.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
margin-top: $default-spacing-unit * 2;
margin-bottom: $default-spacing-unit * 2;
}

.c-meta-list {
margin-top: $default-spacing-unit;
}
}

[type="hidden"] + .c-form-group {
Expand Down
12 changes: 10 additions & 2 deletions src/apps/investment-projects/middleware/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,17 @@ async function getInvestmentDetails (req, res, next, id = req.params.id) {

res.locals.investmentStatus = {
id: investmentData.id,
projectCode: investmentData.project_code,
meta: [
{
label: 'Project code',
value: investmentData.project_code,
},
{
label: 'Valuation',
value: investmentData.value_complete ? 'Project valued' : 'Not yet valued',
},
],
stageName: investmentData.stage.name,
valuation: investmentData.value_complete ? 'Project valued' : 'Not yet valued',
company: {
name: investmentData.investor_company.name,
url: buildCompanyUrl(investmentData.investor_company),
Expand Down
7 changes: 5 additions & 2 deletions src/apps/investment-projects/views/_layout.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
heading: investmentData.name,
modifier: 'light-banner'
}) %}
{% component 'investment-status', investmentStatus %}

{% if investmentData.archived %}
<div class="c-meta-list">
{{ investmentStatus.meta | map(callAsMacro('MetaItem')) | join | safe }}
</div>

{% if investmentData.archived %}
<p class="infostrip">
This investment project was archived on {{ investmentData.archived_on | formatDate }} by {{ investmentData.archived_by.first_name }} {{ investmentData.archived_by.last_name }}. <br>
<strong>Archive reason:</strong> {{ investmentData.archived_reason }}<br>
Expand Down
41 changes: 0 additions & 41 deletions src/templates/_components/investment-status.njk

This file was deleted.

1 change: 1 addition & 0 deletions src/templates/_layouts/datahub-base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{% from "_macros/common.njk" import LocalHeader with context %}
{% from "_macros/common.njk" import Pagination, LocalNav %}
{% from "_macros/results.njk" import Results, ResultsFilters %}
{% from "_macros/entities.njk" import MetaItem %}

{% if IS_XHR %}
{% extends "./xhr.njk" %}
Expand Down
47 changes: 0 additions & 47 deletions test/unit/components/investment-status.test.js

This file was deleted.

0 comments on commit 6e70288

Please sign in to comment.