Merge pull request #439 from dod-ccpo/requests-search-no-results

Add placeholder when request filters match no requests
This commit is contained in:
patricksmithdds 2018-11-08 14:34:36 -05:00 committed by GitHub
commit c63423a942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 6 deletions

View File

@ -117,7 +117,7 @@
{% endif %} {% endif %}
<div class='responsive-table-wrapper'> <div class='responsive-table-wrapper'>
<table> <table v-if="filteredRequests.length">
<thead> <thead>
<tr> <tr>
<th @click.prevent="updateSortValue(column.attr)" v-for="column in getColumns()"scope="col"> <th @click.prevent="updateSortValue(column.attr)" v-for="column in getColumns()"scope="col">
@ -157,6 +157,15 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div v-else>
{{ EmptyState(
'No requests found.',
action_label=None,
action_href=None,
sub_message='Please try a different search.',
icon=None
) }}
</div>
</div> </div>
</div> </div>
{% endif %} {% endif %}

View File

@ -25,6 +25,10 @@ from atst.domain.workspaces import Workspaces
from atst.domain.invitations import Invitations from atst.domain.invitations import Invitations
def random_service_branch():
return random.choice([k for k, v in SERVICE_BRANCHES if k])
class Base(factory.alchemy.SQLAlchemyModelFactory): class Base(factory.alchemy.SQLAlchemyModelFactory):
@classmethod @classmethod
def dictionary(cls, **attrs): def dictionary(cls, **attrs):
@ -54,9 +58,7 @@ class UserFactory(Base):
phone_number = factory.LazyFunction( phone_number = factory.LazyFunction(
lambda: "".join(random.choices(string.digits, k=10)) lambda: "".join(random.choices(string.digits, k=10))
) )
service_branch = factory.LazyFunction( service_branch = factory.LazyFunction(random_service_branch)
lambda: random.choices([k for k, v in SERVICE_BRANCHES if k is not None])[0]
)
citizenship = "United States" citizenship = "United States"
designation = "military" designation = "military"
date_latest_training = factory.LazyFunction( date_latest_training = factory.LazyFunction(
@ -147,7 +149,7 @@ class RequestFactory(Base):
start_date=datetime.date(2050, 1, 1), start_date=datetime.date(2050, 1, 1),
cloud_native="yes", cloud_native="yes",
dollar_value=dollar_value, dollar_value=dollar_value,
dod_component=SERVICE_BRANCHES[2][1], dod_component=random_service_branch(),
data_transfers="Less than 100GB", data_transfers="Less than 100GB",
expected_completion_date="Less than 1 month", expected_completion_date="Less than 1 month",
jedi_migration="yes", jedi_migration="yes",
@ -167,7 +169,7 @@ class RequestFactory(Base):
email_request=user.email, email_request=user.email,
fname_request=user.first_name, fname_request=user.first_name,
lname_request=user.last_name, lname_request=user.last_name,
service_branch=SERVICE_BRANCHES[1][1], service_branch=random_service_branch(),
date_latest_training=datetime.date(2018, 8, 6), date_latest_training=datetime.date(2018, 8, 6),
) )