Add a warning message when there are no other projects to choose.

This commit is contained in:
Shane Kilkelly 2018-06-25 11:48:05 +01:00
parent f6424ada40
commit b3d17fc753
2 changed files with 7 additions and 0 deletions

View file

@ -94,6 +94,9 @@ script(type='text/ng-template', id='newFileModalTemplate')
ng-repeat="project in data.projects"
value="{{ project._id }}"
) {{ project.name }}
small(ng-if="hasNoProjects() && shouldEnableProjectSelect() ")
| No other projects found
.form-controls.row-spaced-small(ng-if="!state.isOutputFilesMode")
label(for="project-entity-select") Select a File

View file

@ -280,6 +280,10 @@ define [
{ state, data } = $scope
return !state.inFlight.projects && data.projects
$scope.hasNoProjects = () ->
{ state, data } = $scope
return !state.inFlight.projects && (data.projects.length == 0 || !data.projects?)
$scope.shouldEnableProjectEntitySelect = () ->
{ state, data } = $scope
return !state.inFlight.projects && !state.inFlight.entities && data.projects && data.selectedProjectId