Skip to content

Commit

Permalink
1252 Link to New Project Form from Projects Page
Browse files Browse the repository at this point in the history
 - added LinkTo `projects/new`
 - added instructional copy with link  for new project initiation
 - wrapped link and copy in env flag to hode feature while still in development
  • Loading branch information
horatiorosa authored and TangoYankee committed Nov 12, 2024
1 parent cf0bee6 commit 5557f51
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
20 changes: 13 additions & 7 deletions client/app/controllers/projects.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Controller from '@ember/controller';
import { sort } from '@ember/object/computed';
import config from 'client/config/environment';
import { tracked } from '@glimmer/tracking';
import {
STATUSCODE,
DCPVISIBILITY,
Expand All @@ -20,19 +22,23 @@ export function packageIsToDo(projectPackages) {
}

export default class ProjectsController extends Controller {
@tracked
selfServiceFlagOn = config.featureFlagSelfService;
// TODO: organize this business logic as computed properties on the projects model

// Projects awaiting the applicant's submission
// (includes active projects with packages that haven't been submitted)
get toDoProjects() {
// Check that at least ONE of the packages is currently editable
return this.model.filter((project) => packageIsToDo(project.pasPackages)
|| packageIsToDo(project.rwcdsPackages)
|| (packageIsToDo(project.landusePackages))
|| (packageIsToDo(project.easPackages))
|| (packageIsToDo(project.scopeOfWorkDraftPackages))
|| (packageIsToDo(project.eisPackages))
|| (packageIsToDo(project.technicalMemoPackages)));
return this.model.filter(
(project) => packageIsToDo(project.pasPackages)
|| packageIsToDo(project.rwcdsPackages)
|| packageIsToDo(project.landusePackages)
|| packageIsToDo(project.easPackages)
|| packageIsToDo(project.scopeOfWorkDraftPackages)
|| packageIsToDo(project.eisPackages)
|| packageIsToDo(project.technicalMemoPackages),
);
}

// Projects in NYC Planning's hands
Expand Down
19 changes: 18 additions & 1 deletion client/app/templates/projects.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,25 @@

{{/if}}

</div>{{! end left/main column }}
</div>
<div class="cell large-4 sticky-sidebar">
{{#if this.selfServiceFlagOn}}
<p class="text-dark-gray">
To initiate a new project engagement with the Department, complete this form with as many
<a href="https://home.nyc.gov/assets/planning/download/pdf/applicants/applicant-portal/interest_checklist.pdf">
checklist items </a>
as possible.
</p>

<LinkTo @route="projects/new">
<button type="button" class="button no-margin">
<FaIcon @icon="edit" />
<strong>
Initiate New Project
</strong>
</button>
</LinkTo>
{{/if}}

<Messages::Assistance class="large-margin-top" />

Expand Down

0 comments on commit 5557f51

Please sign in to comment.