Merge branch 'master' into ui/reports-spend-table

This commit is contained in:
andrewdds
2018-08-23 08:26:41 -04:00
committed by GitHub
66 changed files with 1160 additions and 362 deletions

View File

@@ -1,7 +1,3 @@
{# TODO: set this context elsewhere #}
{# set context='workspace' #}
{% set context=g.navigationContext %}
<!DOCTYPE html>
<html lang="en">
<head>

View File

@@ -2,8 +2,8 @@
{% macro Tooltip(message,title='Help') -%}
<span class="icon-tooltip" v-tooltip.top="{content: '{{message}}'}">
<button type="button" tabindex="0" class="icon-tooltip" v-tooltip.top="{content: '{{message}}', container: false}">
{{ Icon('help') }}<span>{{ title }}</span>
</span>
</button>
{%- endmacro %}

View File

@@ -1,7 +1,3 @@
{# TODO: set this context elsewhere #}
{# set context='workspace' #}
{% set context=g.navigationContext %}
<!DOCTYPE html>
<html>
<head>

View File

@@ -1,6 +1,6 @@
{% from "components/sidenav_item.html" import SidenavItem %}
<div class="global-navigation sidenav global-navigation__context--{{context}}">
<div class="global-navigation sidenav">
<ul>
{% if g.dev %}
{{ SidenavItem("Styleguide",

View File

@@ -6,9 +6,9 @@
{{ Icon('shield', classes='topbar__link-icon') }}
</a>
<div class="topbar__context topbar__context--{{context}}">
<div class="topbar__context {% if workspace %}topbar__context--workspace{% endif %}">
<a href="/" class="topbar__link">
<span class="topbar__link-label">{{ "Workspace 123456" if context == 'workspace' else "JEDI" }}</span>
<span class="topbar__link-label">{{ ("Workspace " + workspace.name) if workspace else "JEDI" }}</span>
{{ Icon('caret_down', classes='topbar__link-icon icon--tiny') }}
</a>

View File

@@ -4,13 +4,13 @@
<ul>
{{ SidenavItem(
"Projects",
href=url_for("workspaces.workspace_projects", workspace_id=123456),
active=g.matchesPath('\/workspaces\/[A-Za-z0-9]*\/projects'),
href=url_for("workspaces.workspace_projects", workspace_id=workspace.id),
active=request.url_rule.rule.startswith('/workspaces/<workspace_id>/projects'),
subnav=[
{
"label": "Add New Project",
"href":"/",
"active": g.matchesPath('workspaces/projects/new'),
"href": url_for('workspaces.new_project', workspace_id=workspace.id),
"active": g.matchesPath('\/workspaces\/[A-Za-z0-9-]*\/projects'),
"icon": "plus"
}
]
@@ -18,8 +18,8 @@
{{ SidenavItem(
"Members",
href=url_for("workspaces.workspace_members", workspace_id=123456),
active=g.matchesPath('\/workspaces\/[A-Za-z0-9]*\/members'),
href=url_for("workspaces.workspace_members", workspace_id=workspace.id),
active=request.url_rule.rule.startswith('/workspaces/<workspace_id>/members'),
subnav=[
{
"label": "Add New Member",
@@ -32,8 +32,8 @@
{{ SidenavItem(
"Funding & Reports",
href='/workspaces/123456/reports',
active=g.matchesPath('\/workspaces\/[A-Za-z0-9]*\/reports')
href=url_for("workspaces.workspace_reports", workspace_id=workspace.id),
active=request.url_rule.rule.startswith('/workspaces/<workspace_id>/reports')
) }}
</ul>
</nav>

View File

@@ -88,7 +88,7 @@
<footer class='block-list__footer'>
<a href='/' class='icon-link'>
{% module Icon('plus') %}
<span>Add another environment</span>
<span class="icon-link">Add another environment</span>
</a>
</footer>
</section>

View File

@@ -9,6 +9,24 @@
<financial inline-template v-bind:initial-data='{{ f.data|tojson }}'>
<div class="col">
{% if extended %}
{{ Alert('Task Order not found in EDA',
message="Since the Task Order (TO) number was not found in our system of record, EDA, please populate the additional fields in the form below.",
level='warning'
) }}
{% endif %}
{% if f.is_missing_task_order_number %}
{% set extended_url = url_for('requests.financial_verification', request_id=request_id, extended=True) %}
{{ Alert('Task Order not found in EDA',
message="We could not find your Task Order in our system of record, EDA.
Please confirm that you have entered it correctly.
<a href=\"%s\">Otherwise enter TO information manually.</a>
"|format(extended_url),
level='warning'
) }}
{% endif %}
<div class="panel">
<div class="panel__heading">
@@ -19,7 +37,11 @@
<div class="panel__content">
{% block form_action %}
<form method='POST' action="{{ url_for('requests.financial_verification', request_id=request_id) }}" autocomplete="off">
{% if extended %}
<form method='POST' action="{{ url_for('requests.financial_verification', request_id=request_id, extended=True) }}" autocomplete="off">
{% else %}
<form method='POST' action="{{ url_for('requests.financial_verification', request_id=request_id) }}" autocomplete="off">
{% endif %}
{% endblock %}
{{ f.csrf_token }}
@@ -35,8 +57,48 @@
<p>In order to get you access to the JEDI Cloud, we will need you to enter the details below that will help us verify and account for your Task Order.</p>
{% if extended %}
<fieldset class="form__sub-fields form__sub-fields--warning">
{{ OptionsInput(f.funding_type) }}
<template v-if="funding_type == 'OTHER'" v-cloak>
{{ TextInput(f.funding_type_other) }}
</template>
{{ TextInput(
f.clin_0001,placeholder="50,000",
validation='integer'
) }}
{{ TextInput(
f.clin_0003,placeholder="13,000",
validation='integer'
) }}
{{ TextInput(
f.clin_1001,placeholder="30,000",
validation='integer'
) }}
{{ TextInput(
f.clin_1003,placeholder="7,000",
validation='integer'
) }}
{{ TextInput(
f.clin_2001,placeholder="30,000",
validation='integer'
) }}
{{ TextInput(
f.clin_2003,placeholder="7,000",
validation='integer'
) }}
</fieldset>
{% endif %}
{{ TextInput(
f.task_order_id,
f.task_order_number,
placeholder="e.g.: 1234567899C0001",
tooltip="A Contracting Officer will likely be the best source for this number.",
validation="anything"
@@ -83,51 +145,6 @@
{{ TextInput(f.office_cor,placeholder="e.g.: WHS") }}
<hr>
{{ Alert('Task Order not found in EDA',
message="Since the Task Order (TO) number was not found in our system of record, EDA, please populate the additional fields in the form below.",
level='warning'
) }}
<fieldset class="form__sub-fields form__sub-fields--warning">
{{ OptionsInput(f.funding_type) }}
<template v-if="funding_type == 'OTHER'" v-cloak>
{{ TextInput(f.funding_type_other) }}
</template>
{{ TextInput(
f.clin_0001,placeholder="50,000",
validation='integer'
) }}
{{ TextInput(
f.clin_0003,placeholder="13,000",
validation='integer'
) }}
{{ TextInput(
f.clin_1001,placeholder="30,000",
validation='integer'
) }}
{{ TextInput(
f.clin_1003,placeholder="7,000",
validation='integer'
) }}
{{ TextInput(
f.clin_2001,placeholder="30,000",
validation='integer'
) }}
{{ TextInput(
f.clin_2003,placeholder="7,000",
validation='integer'
) }}
</fieldset>
{% endautoescape %}
{% endblock form %}

View File

@@ -65,7 +65,7 @@
</div>
<transition name='slide'>
<template v-if="annualSpend > 1000000">
<template v-if="annualSpend > {{ annual_spend_threshold }}">
<fieldset class='form__sub-fields'>
<h3>Because the approximate annual spend is over $1,000,000, please answer a few additional questions.</h3>
{{ TextInput(f.number_user_sessions, validation='integer', placeholder="0") }}

View File

@@ -143,7 +143,7 @@
</dd>
</div>
{% if jedi_request and jedi_request.annual_spend > 1000000 %}
{% if jedi_request and jedi_request.annual_spend > annual_spend_threshold %}
<div>
<dt>Number of User Sessions</dt>

View File

@@ -15,9 +15,9 @@
<h2 id="financial-verification">Financial Verification</h2>
<p>In order to get you access to the JEDI Cloud, we will need you to enter the details below that will help us verify and account for your Task Order.</p>
{{ f.task_order_id.label }}
{{ f.task_order_id(placeholder="Example: 1234567899C0001") }}
{% for e in f.task_order_id.errors %}
{{ f.task_order_number.label }}
{{ f.task_order_number(placeholder="Example: 1234567899C0001") }}
{% for e in f.task_order_number.errors %}
<div class="usa-input-error-message">
{{ e }}
</div>

View File

@@ -4,7 +4,7 @@
{% block workspace_content %}
{% if not members %}
{% if not workspace.members %}
{{ EmptyState(
'There are currently no members in this Workspace.',
@@ -58,7 +58,7 @@
</tr>
</thead>
<tbody>
{% for m in members %}
{% for m in workspace.members %}
<tr>
<td><a href="/workspaces/123456/members/789/edit" class="icon-link icon-link--large">{{ m['first_name'] }} {{ m['last_name'] }}</a></td>
<td class='table-cell--shrink'>{% if m['num_projects'] == '0' %} <span class="label label--info">No Project Access</span> {% endif %}</td>

View File

@@ -0,0 +1,59 @@
{% from "components/icon.html" import Icon %}
{% from "components/text_input.html" import TextInput %}
{% from "components/tooltip.html" import Tooltip %}
{% extends "base_workspace.html" %}
{% block workspace_content %}
<new-project inline-template v-bind:initial-data='{{ form.data|tojson }}'>
<form method="POST" action="{{ url_for('workspaces.update_project', workspace_id=workspace.id) }}" >
{{ form.csrf_token }}
<div class="panel">
<div class="panel__heading panel__heading--grow">
<h1>Add a new project</h1>
{{ Tooltip(
"AT-AT allows you to organize your workspace into multiple projects, each of which may have environments.",
title="learn more"
)}}
</div>
<div class="panel__content">
{{ TextInput(form.name) }}
{{ TextInput(form.description, paragraph=True) }}
</div>
</div>
<div class="block-list project-list-item">
<header class="block-list__header">
<h2 class="block-list__title">Project Environments</h2>
{{ Tooltip(
"Each environment created within a project is an enclave of cloud resources that is logically separated from each other for increased security.",
title="learn more"
)}}
</header>
<ul>
<li v-for="(_, i) in environments" class="block-list__item">
{{ TextInput(form.environment_name) }}
<span class="icon-link icon-link--danger icon-link--vertical" v-on:click="removeEnvironment(i)">{{ Icon('x') }} Remove</span>
</li>
</ul>
<div class="block-list__footer">
<a v-on:click="addEnvironment" class="icon-link">Add another environment</a>
</div>
</div>
<div class="action-group">
<input type="submit" value="Create Project" class="usa-button usa-button-primary">
<a href="{{ url_for('workspaces.workspace_projects', workspace_id=workspace.id) }}" class="action-group__action">Cancel</a>
</div>
</div>
</form>
</new-project>
{% endblock %}

View File

@@ -1,24 +1,34 @@
{% from "components/icon.html" import Icon %}
{% from "components/alert.html" import Alert %}
{% extends "base_workspace.html" %}
{% block workspace_content %}
{% for project in projects %}
{% if request.args.get("newWorkspace") %}
{{ Alert('Workspace created!',
message="\
<p>You are now ready to create projects and environments within the JEDI Cloud.</p>
",
level='success'
) }}
{% endif %}
{% for project in workspace.projects %}
<div class='block-list project-list-item'>
<header class='block-list__header'>
<h2 class='block-list__title'>{{ project['name'] }} ({{ project['environments']|length }} environments)</h2>
<h2 class='block-list__title'>{{ project.name }} ({{ project.environments|length }} environments)</h2>
<a class='icon-link' href='/workspaces/123456/projects/789/edit'>
{{ Icon('edit') }}
<span>edit</span>
</a>
</header>
<ul>
{% for environment in project['environments'] %}
{% for environment in project.environments %}
<li class='block-list__item project-list-item__environment'>
<a href='/' target='_blank' rel='noopener noreferrer' class='project-list-item__environment__link'>
{{ Icon('link') }}
<span>{{ environment["name"]}}</span>
<span>{{ environment.name }}</span>
</a>
<div class='project-list-item__environment__members'>

View File

@@ -5,7 +5,7 @@
{% block workspace_content %}
{{ Alert("Funding Information & Reports for Workspace " + workspace_id,
{{ Alert("Funding Information & Reports for Workspace " + workspace.name,
message="<p>On this screen you'll find detailed reporting information on this workspace. This message needs to be written better and be dismissable.</p>",
actions=[
{"label": "Learn More", "href": "/", "icon": "info"},

View File

@@ -11,16 +11,16 @@
</tr>
</thead>
<tbody>
{% for w in workspaces %}
{% for workspace in workspaces %}
<tr>
<td>
<a class='icon-link icon-link--large' href="/workspaces/{{w['task_order']['number']}}/projects">{{ w['name'] }}</a><br>
<a class='icon-link icon-link--large' href="/workspaces/{{ workspace.id }}/projects">{{ workspace.name }}</a><br>
</td>
<td>
#{{ w['task_order']['number'] }}
#{{ workspace.task_order.number }}
</td>
<td>
<span class="label">{{ w['user_count'] }}</span><span class='h6'>Users</span>
<span class="label">{{ workspace.user_count }}</span><span class='h6'>Users</span>
</td>
</tr>
{% endfor %}

View File

@@ -1,12 +0,0 @@
{% extends "base.html.to" %}
{% block content %}
<div class="usa-width-one-whole empty-state">
<p>There are currently no JEDI workspaces</p>
<a href="" class="usa-button">New Workspace</a>
</div>
{% end %}