-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize the parts required for a new project form closes #1245 Co-authored-by: tangoyankee <[email protected]>
- Loading branch information
1 parent
225b9e7
commit 6371b25
Showing
11 changed files
with
205 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<SaveableForm | ||
@model={{@package}} | ||
@validators={{array (hash) this.validations.SubmittableProjectsNewForm }} | ||
as |saveableProjectsNewForm| | ||
> | ||
<div class="grid-x grid-margin-x"> | ||
<div class="cell large-8"> | ||
<section class="form-section"> | ||
<h1 class="header-large"> | ||
Project Initiation Form | ||
</h1> | ||
<p> | ||
The <b>Project Initiation Form</b> begins the project tracking process and gives NYC Planning the necessary | ||
details before the Informational Interest meeting. By submitting this form, you confirm your intent to file a | ||
Land Use Application with NYC Planning. | ||
</p> | ||
<p> | ||
While some projects might still be in the early stages, all required fields (*) on this form must be completed. | ||
Once submitted, your project will be available to view in this portal. After reviewing your submission, NYC | ||
Planning will contact you with the next steps. | ||
</p> | ||
</section> | ||
<Packages::Projects::ProjectsNewInformation @form={{saveableProjectsNewForm}} /> | ||
</div> | ||
|
||
<div class="cell large-4 sticky-sidebar"> | ||
<saveableProjectsNewForm.PageNav> | ||
<saveableProjectsNewForm.SubmitButton @isEnabled={{saveableProjectsNewForm.isSubmittable}} data-test-save-button /> | ||
</saveableProjectsNewForm.PageNav> | ||
<saveableProjectsNewForm.ConfirmationModal @action={{component saveableProjectsNewForm.SubmitButton | ||
isEnabled=saveableProjectsNewForm.isSubmittable onClick=this.submitPackage class="no-margin" }} | ||
@continueButtonTitle="Continue Editing" data-test-confirm-submit-button={{true}}> | ||
<h6>Confirm New Project Submission</h6> | ||
<p class="header-large medium-margin-top small-margin-bottom"> | ||
Are you sure? | ||
</p> | ||
<p> | ||
Before submitting, ensure that your answers are accurate and complete, and that necessary attachments (including | ||
the | ||
signature form) have been uploaded. | ||
</p> | ||
</saveableProjectsNewForm.ConfirmationModal> | ||
</div> | ||
</div> | ||
</SaveableForm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Component from '@glimmer/component'; | ||
import { action } from '@ember/object'; | ||
import { inject as service } from '@ember/service'; | ||
import SubmittableProjectsNewForm from '../../../validations/submittable-projects-new-form'; | ||
|
||
|
||
export default class ProjectsNewFormComponent extends Component { | ||
validations = { | ||
SubmittableProjectsNewForm, | ||
}; | ||
|
||
@service | ||
router; | ||
|
||
@service | ||
store; | ||
|
||
@action | ||
async submitPackage() { | ||
try { | ||
await this.args.package.submit(); | ||
} catch (error) { | ||
console.log('Save new project package error:', error); | ||
Check warning on line 23 in client/app/components/packages/projects/new.js GitHub Actions / 🧪 Test client code
|
||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
client/app/components/packages/projects/projects-new-information.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{#let @form as |form|}} | ||
<form.Section @title="Project Information"> | ||
|
||
<Ui::Question @required={{true}} as |Q|> | ||
<Q.Label> | ||
Project Name | ||
</Q.Label> | ||
|
||
<form.Field | ||
@attribute="dcpProjectname" | ||
@type="text-input" | ||
id={{Q.questionId}} | ||
@showCounter={{true}} | ||
@maxlength="50" | ||
/> | ||
</Ui::Question> | ||
</form.Section> | ||
{{/let}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; | ||
|
||
export default class ProjectsNewRoute extends Route.extend(AuthenticatedRouteMixin) { | ||
@service store; | ||
|
||
async model() { | ||
return await this.store.createRecord('project'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Ui::Breadcrumbs as | Crumb |> | ||
<Crumb @text="My Projects" @route="projects" /> | ||
<Crumb @text="New" @current={{true}} /> | ||
</Ui::Breadcrumbs> | ||
|
||
<Packages::Projects::New | ||
@package={{@model}} | ||
/> | ||
|
||
{{outlet}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { | ||
validateLength, | ||
validatePresence, | ||
} from 'ember-changeset-validations/validators'; | ||
|
||
export default { | ||
dcpProjectname: [ | ||
validateLength({ | ||
min: 0, | ||
max: 50, | ||
message: 'Text is too long (max {max} characters)', | ||
}), | ||
validatePresence({ | ||
presence: true, | ||
message: 'This field is required', | ||
}), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
module('Unit | Route | projects/new', function(hooks) { | ||
setupTest(hooks); | ||
|
||
test('it exists', function(assert) { | ||
const route = this.owner.lookup('route:projects/new'); | ||
assert.ok(route); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters