Skip to content

Commit

Permalink
Merge pull request #699 from NYCPlanning/12355-lu-housing-plans
Browse files Browse the repository at this point in the history
12355 Set up LU Housing Plans section
  • Loading branch information
godfreyyeung committed Sep 14, 2020
2 parents 4853c40 + aafed57 commit 3eaedfc
Show file tree
Hide file tree
Showing 7 changed files with 226 additions and 6 deletions.
4 changes: 4 additions & 0 deletions client/app/components/packages/landuse-form/edit.hbs
Expand Up @@ -64,6 +64,10 @@
@validations={{this.validations}}
/>

<Packages::LanduseForm::HousingPlans
@form={{saveableForm}}
/>

<Packages::LanduseForm::AttachedDocuments
@form={{saveableForm}}
@model={{@package.landuseForm}}
Expand Down
103 changes: 103 additions & 0 deletions client/app/components/packages/landuse-form/housing-plans.hbs
@@ -0,0 +1,103 @@
{{#let @form as |form|}}
<form.Section
@title="Housing Plans"
data-test-section="housing-plans"
>
<p>
The following questions relate to Housing Plans,
Urban Renewal Areas, and Urban Development Action
Areas Program (UDAAP) and the follwoing Actions: HA,
HC, HD, HG, HN, HO, HP, HU

</p>

<Ui::Question
as |dcpDesignationQ|>
<dcpDesignationQ.Label>
Is a Designation being proposed?
</dcpDesignationQ.Label>

<form.Field
@attribute="dcpDesignation"
@type="radio-group"
as |DcpDesignationRadioGroup|>
<DcpDesignationRadioGroup
@options={{optionset 'landuseForm' 'dcpDesignation' 'list'}}
/>
</form.Field>
</Ui::Question>

<Ui::Question
as |dcpProjecthousingplanudaapQ|>
<dcpProjecthousingplanudaapQ.Label>
Is a Housing Project Plan being proposed?
</dcpProjecthousingplanudaapQ.Label>

<form.Field
@attribute="dcpProjecthousingplanudaap"
@type="radio-group"
as |DcpProjecthousingplanudaapRadioGroup|>
<DcpProjecthousingplanudaapRadioGroup
@options={{optionset 'landuseForm' 'dcpProjecthousingplanudaap' 'list'}}
/>
</form.Field>
</Ui::Question>

<Ui::Question
as |dcpDispositionQ|>
<dcpDispositionQ.Label>
Is a Disposition being proposed?
</dcpDispositionQ.Label>

<form.Field
@attribute="dcpDisposition"
@type="radio-group"
as |DcpDispositionRadioGroup|>
<DcpDispositionRadioGroup
@options={{optionset 'landuseForm' 'dcpDisposition' 'list'}}
as |dcpDisposition|>
{{#if (eq
dcpDisposition
(optionset 'landuseForm' 'dcpDisposition' 'code' 'YES')
)}}
<Ui::Question
as |dcpMannerofdispositionQ|>
<dcpMannerofdispositionQ.Label>
Manner of Disposition
</dcpMannerofdispositionQ.Label>

<form.Field
@attribute="dcpMannerofdisposition"
@type="radio-group"
as |DcpMannerofdispositionRadioGroup|>
<DcpMannerofdispositionRadioGroup
@options={{optionset 'landuseForm' 'dcpMannerofdisposition' 'list'}}
/>
</form.Field>
</Ui::Question>

<Ui::Question
as |dcpRestrictandconditionQ|>
<dcpRestrictandconditionQ.Label>
Restrictions and Conditions
</dcpRestrictandconditionQ.Label>
<p class="text-small">
If there are restrictions, attach a project description
in the documents section that describes the restrictions.
</p>

<form.Field
@attribute="dcpRestrictandcondition"
@type="radio-group"s
as |DcpRestrictandconditionRadioGroup|>
<DcpRestrictandconditionRadioGroup
@options={{optionset 'landuseForm' 'dcpRestrictandcondition' 'list'}}
/>
</form.Field>
</Ui::Question>
{{/if}}
</DcpDispositionRadioGroup>
</form.Field>
</Ui::Question>
</form.Section>
{{/let}}
14 changes: 8 additions & 6 deletions client/app/helpers/optionset.js
Expand Up @@ -15,10 +15,7 @@ import {
AFFECTED_ZONING_RESOLUTION_ACTION,
} from '../optionsets/affected-zoning-resolution';
import PACKAGE_OPTIONSETS from '../optionsets/package';
import {
CEQR_TYPE,
DCPDEVSIZE,
} from '../optionsets/landuse-form';
import LANDUSE_FORM_OPTIONSETS from '../optionsets/landuse-form';
import {
DCPCONSTRUCTIONPHASING,
} from '../optionsets/rwcds-form';
Expand Down Expand Up @@ -58,16 +55,21 @@ const OPTIONSET_LOOKUP = {
statuscode: PROJECT_OPTIONSETS.STATUSCODE,
},
landuseForm: {
dcpCeqrtype: CEQR_TYPE,
dcpCeqrtype: LANDUSE_FORM_OPTIONSETS.CEQR_TYPE,
dcpWholecity: YES_NO,
dcpEntiretyboroughs: YES_NO,
dcpEntiretycommunity: YES_NO,
dcpNotaxblock: YES_NO,
dcp500kpluszone: YES_NO,
dcpDevsize: DCPDEVSIZE,
dcpDevsize: LANDUSE_FORM_OPTIONSETS.DCPDEVSIZE,
dcpSitedatasiteisinnewyorkcity: YES_NO,
dcpStateczm: YES_NO,
dcpHistoricdistrict: YES_NO,
dcpDesignation: LANDUSE_FORM_OPTIONSETS.DCPDESIGNATION,
dcpDisposition: LANDUSE_FORM_OPTIONSETS.DCPDISPOSITION,
dcpProjecthousingplanudaap: LANDUSE_FORM_OPTIONSETS.DCPPROJECTHOUSINGPLANUDAAP,
dcpMannerofdisposition: LANDUSE_FORM_OPTIONSETS.DCPMANNEROFDISPOSITION,
dcpRestrictandcondition: LANDUSE_FORM_OPTIONSETS.DCPRESTRICTANDCONDITION,
},
rwcdsForm: {
dcpHasprojectchangedsincesubmissionofthepas: YES_NO,
Expand Down
10 changes: 10 additions & 0 deletions client/app/models/landuse-form.js
Expand Up @@ -69,6 +69,16 @@ export default class LanduseFormModel extends Model {

@attr dcpSitedataidentifylandmark;

@attr dcpDesignation;

@attr dcpProjecthousingplanudaap;

@attr dcpDisposition;

@attr dcpMannerofdisposition;

@attr dcpRestrictandcondition;

@attr dcpLeadagency;

@attr dcpCeqrnumber;
Expand Down
8 changes: 8 additions & 0 deletions client/app/optionsets/common.js
Expand Up @@ -38,3 +38,11 @@ export const YES_NO_DONT_KNOW = {
label: 'Don\u2019t Know',
},
};

const COMMON_OPTIONSETS = {
YES_NO,
YES_NO_UNSURE,
YES_NO_DONT_KNOW,
};

export default COMMON_OPTIONSETS;
69 changes: 69 additions & 0 deletions client/app/optionsets/landuse-form.js
@@ -1,3 +1,5 @@
import COMMON_OPTIONSETS from './common';

export const CEQR_TYPE = {
TYPE_I: {
code: 717170000,
Expand Down Expand Up @@ -27,3 +29,70 @@ export const DCPDEVSIZE = {
label: 'At least 2,500,000 zoning sq ft',
},
};

export const DCPMANNEROFDISPOSITION = {
GENERAL: {
code: 717170000,
label: 'General',
},
DIRECT: {
code: 717170001,
label: 'Direct',
},
};

const DCPRESTRICTANDCONDITION = {
NONE: {
code: 717170000,
label: 'None (Pursuant to Zoning)',
},
RESTRICTED: {
code: 717170001,
label: 'Restricted',
},
};

export const DCPDESIGNATION = {
YES: {
code: COMMON_OPTIONSETS.YES_NO.YES.code,
label: 'Yes (HA, HN, HG, possibly HU)',
},
NO: {
code: COMMON_OPTIONSETS.YES_NO.NO.code,
label: 'No (HC, HD, HO, HP, possibly HU)',
},
};

export const DCPPROJECTHOUSINGPLANUDAAP = {
YES: {
code: COMMON_OPTIONSETS.YES_NO.YES.code,
label: 'Yes (HA, HN, HG)',
},
NO: {
code: COMMON_OPTIONSETS.YES_NO.NO.code,
label: 'No (HC, HD, HO, HP, HU)',
},
};

export const DCPDISPOSITION = {
YES: {
code: COMMON_OPTIONSETS.YES_NO.YES.code,
label: 'Yes (HA, HD)',
},
NO: {
code: COMMON_OPTIONSETS.YES_NO.NO.code,
label: 'No (HC, HD, HG, HN, HO, HP, HU)',
},
};

const LANDUSE_FORM_OPTIONSETS = {
CEQR_TYPE,
DCPDEVSIZE,
DCPMANNEROFDISPOSITION,
DCPRESTRICTANDCONDITION,
DCPDESIGNATION,
DCPPROJECTHOUSINGPLANUDAAP,
DCPDISPOSITION,
};

export default LANDUSE_FORM_OPTIONSETS;
24 changes: 24 additions & 0 deletions client/tests/acceptance/user-can-click-landuse-form-edit-test.js
Expand Up @@ -292,6 +292,30 @@ module('Acceptance | user can click landuse form edit', function(hooks) {
assert.equal(this.server.db.relatedActions.firstObject.dcpReferenceapplicationno, '12345678');
});

test('User can fill out and save first part of Housing Plans', async function(assert) {
this.server.create('project', 1, {
packages: [this.server.create('package', 'toDo', 'landuseForm')],
});

await visit('/landuse-form/1/edit');

await click('[data-test-radio="dcpDesignation"][data-test-radio-option="No (HC, HD, HO, HP, possibly HU)"]');
await click('[data-test-radio="dcpDesignation"][data-test-radio-option="Yes (HA, HN, HG, possibly HU)"]');

await click('[data-test-radio="dcpProjecthousingplanudaap"][data-test-radio-option="No (HC, HD, HO, HP, HU)"]');
await click('[data-test-radio="dcpProjecthousingplanudaap"][data-test-radio-option="Yes (HA, HN, HG)"]');

await click('[data-test-radio="dcpDisposition"][data-test-radio-option="No (HC, HD, HG, HN, HO, HP, HU)"]');

assert.dom('[data-test-radio="dcpMannerofdisposition"]').doesNotExist();
assert.dom('[data-test-radio="dcpRestrictandcondition"]').doesNotExist();

await click('[data-test-radio="dcpDisposition"][data-test-radio-option="Yes (HA, HD)"]');

assert.dom('[data-test-radio="dcpMannerofdisposition"]').exists();
assert.dom('[data-test-radio="dcpRestrictandcondition"]').exists();
});

test('user can remove applicants on landuse form', async function(assert) {
const project = this.server.create('project', 1, {
packages: [this.server.create('package', 'toDo', 'landuseForm')],
Expand Down

0 comments on commit 3eaedfc

Please sign in to comment.