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

Investment project stages #395

Merged
merged 6 commits into from
Aug 11, 2017
Merged

Conversation

feedmypixel
Copy link
Contributor

@feedmypixel feedmypixel commented Jul 31, 2017

NOTE - the Investment Project flow itself is in discussion at present as we need some discovery to confirm we are meeting user needs. However the work here can be easily repurposed and is still valid

This work involves the first part of the investment creation project flow.

Of Note (see commits for more detailed information)

  • Rework investment project flow to work with CTI, FDI and Non-FDI types (see flow diagram below)
  • Improve url structure for the create flow
  • Add new form macros to Investment project creation flow
  • Add project stage progress component to show current position in the flow, progress component #423
  • Add move project stage component to move between stages, move between investment project stages #422
  • Add middleware for storing information under a namespace in the session
  • Add date component pattern Date Fieldset component #425

TODO

  • There are a number of UX issues to address, this will be addressed in the next piece of work.
    • what you need to do to proceed to the next stage
    • position of stage info/message box
    • Requirements and Value forms asking to much
    • forms too big
  • Please note stronger test coverage will be coming in a future PR.

Create Investment project journey flow diagram

create-investment-porject-journey-flow

Investment project journey (uk and foreign)

investment-project

@feedmypixel feedmypixel requested a review from tyom July 31, 2017 12:46
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 July 31, 2017 12:46 Inactive
@feedmypixel feedmypixel force-pushed the feature/investment-project-stages branch from e3f28ce to 56479d7 Compare July 31, 2017 12:47
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 July 31, 2017 12:48 Inactive
z-index: 20;
}

&.c-progress__bar--prospect-stage {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be tempted not to use class names that relate to investment progress only. Maybe modifiers that relate to the percentage complete?

}
}

.c-progress__stage--active {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels more like a state class than a modifier. Maybe just is-active.

left: $section-width * 4;
}

@include media($min-width: 1060px) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does 1060px relate to? Don't think we've used this breakpoint before.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might also be worth looking at on smaller screens. Feels like the center aligned text for first and last items could get cut off at certain resolutions too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1060px is when they can become centre aligned. The declaration on line 88 controls how they behave on smaller screens (pulling them in)

}

.c-progress__stage--active {
@include bold-font(16);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the font size jump for current item. Think bold font weight might be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah was thinking about colourblind people and making it apparent enough that something has changed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need more than colour change on the icon. Could be filled for current state and empty for other states?

@tyom
Copy link
Contributor

tyom commented Jul 31, 2017

Wonder if the investor company and code should be flipped to be consistent with investment projects pipeline layout.

@tyom
Copy link
Contributor

tyom commented Jul 31, 2017

Initial sorting selection seems to have gone in investment pipeline.
image

max-width: 4em;
}

.c-form-control--small {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should tweak the current .c-form-control--short to be .c-form-control--long, add .c-form-control--medium and then set .c-form-control--short to be 2.6em?

Avoids us mixing short and small then.

max-width: 4em;
}

.c-form-control--small {
Copy link
Contributor

@tyom tyom Jul 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use small and smaller to adjust input size, e.g. radio buttons and checkboxes.

image

You should pick something different. We already have short. Maybe shorter and shortest?
See above for existing rule .c-form-control--short.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do

  • short
  • shorter
  • shortest

provide enough meaning when they are by themselves?

}
}

.status-bar__section-title {
font-weight: 700;
color: $grey-1;
font-size: 16px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently we're using core-font mixin until we do a review of our typography.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enforced 👮 🚨

@@ -14,28 +13,18 @@
#}

{% if projectCode %}
<div class="status-bar grid-row">
<dl class="status-bar__section column-one-quarter">
<div class="status-bar l-container">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if we can reuse c-meta-item here which is used on investment collection page and do away with status-bar altogether?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds like a refactor/alignment for after this PR is in

{% from "_macros/form.njk" import Fieldset, TextField, MultipleChoiceField, HiddenField %}
{% from "_macros/form.njk" import DateField %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge it with the line above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was wondering if we need to denote a difference between form elements and form patterns. The DateField felt more "patterny" (for want of a real word) than the others

Copy link
Contributor

@tyom tyom Jul 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need that kind of separation at this point. MultipleChoiceField is also quite "patterny" but to the end user (developer) it just a component/macro with certain inputs.

# @param {string} props.text - Anchor text
# @param {string} [props.target=_self] - Anchor target
#}
{% macro Link(props) %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how useful this macro is. It's just an HTML element with a couple of attributes that are already restricted to certain values. I think you could justify having it if it had custom classes or wrapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed - the reason it was built is the having to send it in to the hint for the radios on the investment-type page. I initially just sent in a html string with | safe but it felt really hacky. This felt a little cleaner. Open to changing if your good with that.

{% set buttonText = props.buttonText or 'Submit' %}

{{ ErrorSummary(props.errors) }}
<form
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reuse existing Form macro here?

Copy link
Contributor Author

@feedmypixel feedmypixel Jul 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So differences from Form:

  • Error summary outside of form
  • Button displayed inside form (not in a form group)

It felt like adding flags to the existing form to handle this was the wrong approach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. But you're forking the form here so every time there are global changes to form we must remember to update this one as well. Perhaps we should add a flag to disable ErrorSummary. You can already disable form submit button.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should add a flag to disable ErrorSummary.

yeah sure could do it was more then wrapping of the submit button. But same could add a flag to not wrap it in c-form-group c-form-group--actions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the InlineForm macro has now gone, after a rethink there is no need for this macro

{
value: form.options.investmentTypesObj.fdi.value,
label: form.options.investmentTypesObj.fdi.label,
hint: Link({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could just save that link in a variable and pass it along to macro to avoid creating a new macro.

{% set investmentTypeFdiLink %}
  <a href="/investment-projects/create/investment-type/info#fdi">Is this an FDI project?</a>
{% endset %}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what is info target? The target is meant to be a frame name. I think you meant _blank to open in a new window. Maybe we can do an XHR to open inline? Perhaps a follow-up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target: 'info' is to open in new window named info so that it doesn't just open different blank pages when clicking different links

Copy link
Contributor Author

@feedmypixel feedmypixel Jul 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could just save that link in a variable and pass it along to macro to avoid creating a new macro.

This answers the above around creating a macro - will do

@feedmypixel
Copy link
Contributor Author

Wonder if the investor company and code should be flipped to be consistent with investment projects pipeline layout.

is there a component that can be shared with this?

@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 July 31, 2017 15:41 Inactive
@feedmypixel feedmypixel force-pushed the feature/investment-project-stages branch from 2fe7354 to ab13e05 Compare July 31, 2017 15:42
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 July 31, 2017 15:43 Inactive
@feedmypixel feedmypixel force-pushed the feature/investment-project-stages branch from ab13e05 to 27be423 Compare July 31, 2017 15:44
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 July 31, 2017 15:44 Inactive
@feedmypixel
Copy link
Contributor Author

Initial sorting selection seems to have gone in investment pipeline.

@tyom where is this? I can't track it down

@ztolley ztolley had a problem deploying to datahub-beta2-pr-395 July 31, 2017 16:44 Failure
@feedmypixel feedmypixel force-pushed the feature/investment-project-stages branch from 1e2264b to 98473e7 Compare July 31, 2017 16:53
@feedmypixel feedmypixel force-pushed the feature/investment-project-stages branch from 260c8a1 to 662195d Compare August 10, 2017 13:18
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 August 10, 2017 14:19 Inactive
@feedmypixel feedmypixel force-pushed the feature/investment-project-stages branch from e33a194 to 6e70288 Compare August 11, 2017 09:22
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 August 11, 2017 09:22 Inactive
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 August 11, 2017 09:38 Inactive
@feedmypixel feedmypixel force-pushed the feature/investment-project-stages branch from 2595104 to 92ffa00 Compare August 11, 2017 09:42
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 August 11, 2017 09:42 Inactive
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 August 11, 2017 09:49 Inactive
label: 'Type of investment',
value: form.state['investment_type'],
error: form.errors.messages['investment_type'],
children: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need children. You can just call that macro and nest stuff in it. We should avoid multiple ways of doing the same thing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@feedmypixel feedmypixel Aug 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need children.

do you mean use caller?

We should avoid multiple ways of doing the same thing.

This select pattern is the same pattern used for radio and checkbox when using the MultipleChoiceField macro

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use case is on the create form

business

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will align this work to use caller rather than children

@@ -429,6 +438,10 @@
</option>
{% endfor %}
</select>

{% for child in fieldChildren %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced this is needed.

@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 August 11, 2017 11:40 Inactive
@feedmypixel feedmypixel force-pushed the feature/investment-project-stages branch from 2b59a39 to 385ee23 Compare August 11, 2017 11:48
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 August 11, 2017 11:48 Inactive
@feedmypixel feedmypixel force-pushed the feature/investment-project-stages branch from 385ee23 to 7401ccc Compare August 11, 2017 11:57
@ztolley ztolley temporarily deployed to datahub-beta2-pr-395 August 11, 2017 11:57 Inactive

.c-meta-list {
.c-meta-item {
margin-right: $default-spacing-unit;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A left margin when there is a sibling might be better here. But could be addressed later during a spacing review.

.c-meta-item + .c-meta-item {
  margin-left: $default-spacing-unit;
}

added new form macros,
improved url structure,
added new controllers, views and routes,
updated tests
… session under a namespace,

provide accessors for this infromation
updates to global styles,
display in /components,
tests,
added date pattern into investment-projects flow
tests,
display in /components,
@feedmypixel feedmypixel force-pushed the feature/investment-project-stages branch from 7401ccc to 1c6470e Compare August 11, 2017 12:46
@feedmypixel feedmypixel changed the title Base branch: Investment project stages Investment project stages Aug 11, 2017
@feedmypixel feedmypixel merged commit 75ef34e into develop Aug 11, 2017
@feedmypixel feedmypixel deleted the feature/investment-project-stages branch August 11, 2017 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants