Commit Graph

2591 Commits

Author SHA1 Message Date
leigh-mil
b927ef1b0e Create utility function for the pattern of committing to the database or raising AlreadyExistsError 2019-12-16 14:39:32 -05:00
leigh-mil
afad5362a1 Update name of UniqueContraint to include the table name 2019-12-16 14:39:32 -05:00
leigh-mil
ffbf612290 Update route to catch error when app name uniqueness is violated and display a error message 2019-12-16 14:39:32 -05:00
leigh-mil
22dd5d7b85 Add migration for enforcing uniqueness of an application name within a portfolio and update create/update Applicaiton domain methods. 2019-12-16 14:39:32 -05:00
dandds
1968d458db Display names for subscriptions are passed to create_subscription.
We don't need to generate the display name for a new subscription inside
the _create_subscription method.
2019-12-16 10:12:35 -05:00
leigh-mil
f0505ee122 Remove unused imports
Use remove_empty_string filter for TaskOrderForm.number instead of declaring the data property
Update display of TOs without a number
2019-12-13 14:53:58 -05:00
leigh-mil
78ef47f649 Update TO route helper function to catch error and display flash message when a user tries to save a TO with an existing number.
Update TaskOrderForm so that it converts empty string for number into None, this was causing an issue where new TOs were being saved with an empty string for the number, which violated the unique constraint.
2019-12-13 14:53:58 -05:00
leigh-mil
9caef2883a migration fix 2019-12-13 14:53:58 -05:00
leigh-mil
6446b4fbd0 Raise AlreadyExistsError if a task order is created or updated with a number of an existing task order 2019-12-13 14:53:58 -05:00
leigh-mil
85252812e0 Update number column on task orders table to have a unique constraint 2019-12-13 14:53:58 -05:00
graham-dds
cbea71259c Move checkbox validation message to translations 2019-12-13 13:17:30 -05:00
graham-dds
a097a0ce61 Refactor New Portfolio page according to designs.
New designs call for a streamlined New Portfolio page, with far
fewer input options. This commit refactors that page according to those
designs.

Some of the route functions in this commit refer to a "step 1" of creating
a new Portfolio. Though there is no "step 2" right now, the designs call
for a multistep flow for Portfolio creation process, so this commit sets
the stage for that.
2019-12-13 13:17:30 -05:00
leigh-mil
1550f32b4c Merge branch 'staging' into to-index-page-redesign_part-3 2019-12-13 13:01:11 -05:00
leigh-mil
2552d4c700 Styling for empty status accordion and update Not signed to Unsigned 2019-12-13 11:49:50 -05:00
dandds
8f94d9e6ec Log any CSP errors that occur when disabling a user.
When one user disables another's environment role in Azure, sometimes an
exception will be raised. Since we catch the exception and display an
error message to the user, we should also log the exception so that the
error is traceable later.
2019-12-13 11:41:18 -05:00
leigh-mil
2c2b69affe Fix TO index blank states and number type issue 2019-12-13 11:26:58 -05:00
tomdds
8a1ed5b193 Sketch in Management Group integration for Azure
Add mocks and real implementations for creating nested management groups that reflect the Portfolio->Application->Environment->Subscription hierarchy.
2019-12-13 10:53:24 -05:00
leigh-mil
4d7af1bab4 Remove extra details from expired TO display, small refactors in TO methods 2019-12-12 16:05:47 -05:00
leigh-mil
b49208ca57 Remove unused imports and formatting, fake TaskOrder.invoiced_funds with hard coded percentage instead of random number 2019-12-12 09:40:18 -05:00
leigh-mil
ac8dd662d1 Fake task order's expended funds, default task order start and end date to None, fix how task orders are sorted by status 2019-12-12 09:40:18 -05:00
leigh-mil
e32bad0d30 Display TOs grouped by status 2019-12-12 09:40:18 -05:00
leigh-mil
d3f757c649 Update test_for_user to make variables clearer and add in a test case that should not be included in the list returned.
Use list comprehension in portfolio_applications route to get list of all environments for a user
2019-12-11 10:35:42 -05:00
leigh-mil
02efa33e49 Display users env role if they have environment access 2019-12-11 10:07:09 -05:00
graham-dds
3b265b0eb6 Flash message for insufficient funding 2019-12-10 11:23:53 -05:00
graham-dds
cde3d7f6aa A CLINs TO should be signed in order to be active 2019-12-10 11:23:53 -05:00
graham-dds
c14ad9fdd3 Move reports fixture data to dir at project root 2019-12-10 11:23:53 -05:00
graham-dds
dc9a21a501 Refactor mock reporting data and class methods
All mock reporting data was moved to a JSON file. The concept of
what JEDI CLIN a particular environment drew money from was added to the
data.

This change had a cascade effect to the reporting class methods,
templates, and Vue components that ingested that reporting data. Many of
these files were modified to adapt to these changes. This also included
modifying the obligated funding bar graphs to reflect new design
changes.
2019-12-10 11:23:53 -05:00
dandds
f8c31e4dcf Add function for Flask app to read config from a directory.
The application now checks for an environment variable,
OVERRIDE_CONFIG_DIRECTORY. If that value is set, it loops all the files
in the specified directory and checks if their names correspond to known
configuration settings. The contents of any matching files are read and
set as the new configuration value for that setting. This will allow us
to read mounted Azure Key Vault items as config values.

This also moves the functionality for applying environment variables to
the config into an analogous function.
2019-12-10 10:14:53 -05:00
leigh-mil
8330b4de24 Check to see if the env_role has been provisioned before disabling env_role in the csp 2019-12-06 09:59:56 -05:00
leigh-mil
c501431719 Check to see if the environment has been provisioned before disabling the env role in the csp 2019-12-06 09:53:36 -05:00
leigh-mil
f7c1d403c7 Merge branch 'staging' into to-blank-state 2019-12-04 14:56:12 -05:00
dandds
20c7e943c8 Compose REDIS_URI from component parts.
This updates the configuration handling for the Redis connection string.
The motivation is so that the Redis password can be managed separately
via Azure Key Vault and eventually be rotated independently of the rest
of the connection URI.

This also tweaks the method we use to build the DATABASE_URI and removes
some stale config from the CI config file.
2019-12-04 13:28:26 -05:00
leigh-mil
74ff581570 Remove route for /portfolios 2019-12-03 15:43:06 -05:00
leigh-mil
57b00715d3 Remove optional validator from CLINField number because it is a required column 2019-12-02 14:46:11 -05:00
leigh-mil
614514d6a2 Update tables to match business logic 2019-12-02 14:46:11 -05:00
graham-dds
4e0af139cc Style and refactor components for expired funding
- modify Accordion component to be able to customize classes and tags
that it uses to build markup
- modify the shape of the object that the mock CSP returns for data that
builds this section.
 - Also ensures that the CLINs TOs and CLINS are sorted
- add appropriate css for styling
2019-11-27 15:52:48 -05:00
dandds
55e95b09af Merge pull request #1212 from dod-ccpo/document-config
Configuration Guide
2019-11-27 11:10:58 -05:00
dandds
9d7e54c1f5 Remove mappings for unused RQ values. 2019-11-27 10:34:56 -05:00
richard-dds
2f8135ecd1 Remove CLASSIFIED param 2019-11-27 10:30:42 -05:00
graham-dds
51f1261db0 Order CLINs on reporting page and refactor labels
In order to more easily sort JEDI Clins for the obligated funds section,
the JEDI CLIN enum values were used in the output dict instead of their
verbose labels. And in order to bring the labels in line with designs,
the JEDI CLIN labels were DRYed up in the translations file, which
required making small changes in a few other places across the project.
2019-11-26 16:17:22 -05:00
graham-dds
60ad0d1844 Add datetime.now() as a reports view variable
This mocks the datetime of data retrieval from the CSP
2019-11-26 16:16:32 -05:00
graham-dds
92ae191f37 Merge pull request #1199 from dod-ccpo/reporting-refactor-part-1
Reporting refactor part 1
2019-11-25 16:37:49 -05:00
graham-dds
0303434561 First pass at new reporting designs
This commit lays out the genral structure and provides necessary
data for the new reporting page designs.

Some of the data generated by the report domain classes (including
the mock CSP reporting class) was modified to fit new designs. This also
included removing data that was no longer necessary. Part of the newly
mocked data includes the idea of "expended" data per CLIN or task order.
This was was mocked simply by using a 75% of the obligated funds fo a
given object. Tests were also written for these new/ modifed reporting
functions.

As for the front end, this commit only focuses on the high-level markup
layout. This includes splitting the large reporting index page into
smaller component templates for each of the major sections of the report.
2019-11-25 13:12:35 -05:00
graham-dds
7a0dc4d264 Add properties to portfolio model
1. Funding duration

Returns a tuple of the earliest period of performance start date and
latest period of performance end date for all active task order in a  portfolio.

2. Days to funding expiration
Returns the numbei of days between today and the lastest
period performance end date of all active task orders

3. Active task orders
Returns a list of a portfolio's active task orders a
2019-11-25 13:12:35 -05:00
graham-dds
4f2a75b64f Add active CLINS property to portfolio model 2019-11-25 13:12:34 -05:00
graham-dds
06600a8237 Add "is_active" property to CLIN model 2019-11-25 13:12:34 -05:00
dandds
9ae20b4a2a JSON logging for Celery workers.
This enables JSON logging for Celery workers if the LOG_JSON conig value
is set. It uses the same JsonFormatter class used by the Flask
applications. That class has been updated in two ways:

- It takes a `source` kwarg to define the log source for the formatter.
- The `msg` attribute of the log record is formatted with any arguments
  that may have been passed. This is necessary for Celery to render task
  type, completion time, etc. into the log output.
2019-11-25 10:13:37 -05:00
dandds
e56e0d8619 Log DOD ID for user when available. 2019-11-25 09:47:01 -05:00
leigh-mil
6de93d7181 Merge pull request #1203 from dod-ccpo/new-portfolio-validation
Bugfixes
2019-11-25 09:46:27 -05:00
leigh-mil
25a5cb136c Merge pull request #1196 from dod-ccpo/revoke-env-access
Catch CSP exceptions and display a flash message with the error
2019-11-22 14:46:34 -05:00