Skip to content

Commit

Permalink
file queue has files but that is it, no good news
Browse files Browse the repository at this point in the history
documents seems to be selected and ready for upload on the FE

new attachements conponent and supporting files, and file changes / updates

tentative use of randown UUIDs to address bug

using letter uuid for letter filetype
  • Loading branch information
horatiorosa committed Nov 26, 2024
1 parent 5557f51 commit d0fbfaa
Show file tree
Hide file tree
Showing 19 changed files with 455 additions and 92 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
deploy-server:
name: 🚀 Deploy server
needs: test-client
environment:
environment:
name: production
url: https://applicants-api.nycplanningdigital.com
runs-on: ubuntu-latest
Expand All @@ -46,6 +46,7 @@ jobs:
appdir: server
env:
HD_FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HD_LETTER_FILETYPE_UUID: ${{ vars.LETTER_FILETYPE_UUID }}
HD_ADO_PRINCIPAL: ${{ secrets.ADO_PRINCIPAL }}
HD_AUTHORITY_HOST_URL: ${{ secrets.AUTHORITY_HOST_URL }}
HD_CITYPAY_AGENCYID: ${{ secrets.CITYPAY_AGENCYID }}
Expand Down Expand Up @@ -107,7 +108,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 12.x
- name: Install application dependencies
- name: Install application dependencies
working-directory: client
run: yarn install --immutable --immutable-cache --check-cache
- name: Build client
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
appdir: server
env:
HD_FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HD_LETTER_FILETYPE_UUID: ${{ vars.LETTER_FILETYPE_UUID }}
HD_ADO_PRINCIPAL: ${{ secrets.ADO_PRINCIPAL }}
HD_AUTHORITY_HOST_URL: ${{ secrets.AUTHORITY_HOST_URL }}
HD_CITYPAY_AGENCYID: ${{ secrets.CITYPAY_AGENCYID }}
Expand Down Expand Up @@ -102,7 +103,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 12.x
- name: Install application dependencies
- name: Install application dependencies
working-directory: client
run: yarn install --immutable --immutable-cache --check-cache
- name: Build client
Expand All @@ -119,4 +120,3 @@ jobs:
--site ${{secrets.NETLIFY_SITE_ID}} \
--auth ${{secrets.NETLIFY_AUTH_TOKEN}} \
--message "${{ github.event.head_commit.message }}"
3 changes: 2 additions & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
appdir: server
env:
HD_FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HD_LETTER_FILETYPE_UUID: ${{ vars.LETTER_FILETYPE_UUID }}
HD_ADO_PRINCIPAL: ${{ secrets.ADO_PRINCIPAL }}
HD_AUTHORITY_HOST_URL: ${{ secrets.AUTHORITY_HOST_URL }}
HD_CLIENT_ID: ${{ secrets.CLIENT_ID }}
Expand Down Expand Up @@ -94,7 +95,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 12.x
- name: Install application dependencies
- name: Install application dependencies
working-directory: client
run: yarn install
- name: Build client
Expand Down
13 changes: 10 additions & 3 deletions client/app/components/projects/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,24 @@
@selectedApplicantType={{this.selectedApplicantType}}
@applicantOptions={{this.applicantOptions}}
/>

<Projects::ProjectsNewAddContacts
@form={{saveableProjectsNewForm}} />

<Projects::ProjectsNewProjectDescription
@form={{saveableProjectsNewForm}} />

<Projects::ProjectsNewAttachedDocuments
@artifact={{saveableProjectsNewForm.data}}
@form={{saveableProjectsNewForm}}
@model={{@package}} />
</div>
<div class="cell large-4 sticky-sidebar">
<saveableProjectsNewForm.PageNav>
<saveableProjectsNewForm.SubmitButton @isEnabled={{saveableProjectsNewForm.isSubmittable}} data-test-save-button />
</saveableProjectsNewForm.PageNav>
<Messages::Assistance class="large-margin-top" />

<saveableProjectsNewForm.ConfirmationModal @action={{component saveableProjectsNewForm.SubmitButton
isEnabled=saveableProjectsNewForm.isSubmittable onClick=this.submitProject class="no-margin" }}
@continueButtonTitle="Continue Editing" data-test-confirm-submit-button={{true}}>
Expand All @@ -48,9 +56,8 @@
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.
Before submitting, ensure that your answers are accurate and complete, and that necessary attachments have been uploaded. If NYC Planning does not receive enough accurate information to provide guidance, the Lead Planner will notify you and request that this form be resubmitted with necessary materials, corrections, or
clarifications.
</p>
</saveableProjectsNewForm.ConfirmationModal>
</div>
Expand Down
6 changes: 5 additions & 1 deletion client/app/components/projects/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,18 @@ export default class ProjectsNewFormComponent extends Component {
dcpApplicanttype: this.args.package.applicantType.code,
dcpProjectbrief: this.args.package.projectBrief,
_dcpApplicantadministratorCustomerValue:
verifiedPrimaryContact.id,
verifiedPrimaryContact.id,
_dcpApplicantCustomerValue: verifiedApplicant.id,
},
},
}),
});
const { data: project } = await response.json();

this.args.package.saveAttachedFiles(project.attributes['dcp-artifactsid']);

this.router.transitionTo('project', project.id);

} catch {

Check failure on line 111 in client/app/components/projects/new.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Block must not be padded by blank lines

Check failure on line 111 in client/app/components/projects/new.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Block must not be padded by blank lines
/* eslint-disable-next-line no-console */
console.error('Error while creating project');
Expand Down
22 changes: 22 additions & 0 deletions client/app/components/projects/projects-new-attached-documents.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{#let @form as |form|}}
<@form.Section @title='Attached Documents'>
<p>
Please attach the required items list on the
<Ui::ExternalLink @href="https://www.nyc.gov/assets/planning/download/pdf/applicants/applicant-portal/interest_checklist.pdf">
Informational Interest Meeting checklist
</Ui::ExternalLink> &nbsp;in one PDF document. The maximum
size for a document is 50MB.
</p>

<SaveableForm::FieldValidationMessage
@attribute='documents'
@validation={{@form.errors.documents.validation}} />

<Projects::ProjectsNewAttachments
@package={{@form.data}}
@artifact={{@artifact}}
@fileManager={{@model.fileManager}}
data-test-section='attachments' />
</@form.Section>

{{/let}}
132 changes: 132 additions & 0 deletions client/app/components/projects/projects-new-attachments.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<div ...attributes>
<fieldset class="fieldset">
<Ui::Legend>
Attachments
</Ui::Legend>

<ul class="no-bullet">
{{#each @fileManager.existingFiles as |file idx|}}
<li class="slide-in-bottom">
<div class="grid-x">
<div class="cell auto">
<a
href={{concat (get-env-variable 'host') '/documents' file.serverRelativeUrl}}
target="_blank"
rel="noopener noreferrer"
data-test-document-name={{idx}}
>
{{file.name}}
</a>
</div>
<div class="cell shrink medium-padding-left">
<small>
{{file.timeCreated}}
</small>
</div>
<div class="cell shrink medium-padding-left">
<button
type="button"
class="text-red-dark"
{{on "click" (fn this.markFileForDeletion file)}}
data-test-delete-file-button={{idx}}
>
<FaIcon @icon="times" @prefix="fas" @fixedWidth={{true}} />
</button>
</div>
</div>
</li>
{{/each}}
</ul>

{{#if (or @fileManager.filesToDelete @fileManager.filesToUpload.files)}}
{{#if @fileManager.existingFiles}}
<hr>
{{/if}}

<h6 class="medium-margin-bottom slide-in-top">
To be
{{if @fileManager.filesToUpload.files 'uploaded'}}
{{if (and @fileManager.filesToDelete @fileManager.filesToUpload.files) '/'}}
{{if @fileManager.filesToDelete 'deleted'}}
when you save the project:
</h6>
{{/if}}

<ul class="no-bullet">
{{#each @fileManager.filesToDelete as |file idx|}}
<li class="slide-in-top">
<div class="grid-x">
<div class="cell auto">
<b
data-test-document-to-be-deleted-name={{idx}}
>
{{file.name}}
</b>
</div>
<div class="cell shrink medium-padding-left">
<small>
TO BE DELETED
</small>
</div>
<div class="cell shrink medium-padding-left">
<button
type="button"
{{on "click" (fn this.unmarkFileForDeletion file)}}
data-test-undo-delete-file-button={{idx}}
>
<FaIcon @icon="undo" @prefix="fas" @fixedWidth={{true}} />
</button>
</div>
</div>
</li>
{{/each}}
</ul>

<ul class="no-bullet">
{{#each @fileManager.filesToUpload.files as |file idx|}}
<li class="slide-in-top">
<div class="grid-x">
<div class="cell auto">
<b
data-test-document-to-be-uploaded-name={{idx}}
>
{{file.name}}
</b>
</div>
<div class="cell shrink medium-padding-left">
<small>
TO BE ADDED
</small>
</div>
<div class="cell shrink medium-padding-left">
<button
type="button"
class="text-red-dark"
{{on "click" (fn this.deselectFileForUpload file)}}
data-test-deselect-file-button={{idx}}
>
<FaIcon @icon="times" @prefix="fas" @fixedWidth={{true}} />
</button>
</div>
</div>
</li>
{{/each}}
</ul>

<FileUpload
id={{concat "FileUploader" @artifact.id}}
@name={{concat "artifact" @artifact.id}}
@accept='*/*'
@multiple={{true}}
@onfileadd={{this.trackFileForUpload}}
class="button secondary expanded"
>
<FaIcon @icon="upload" @prefix="fas" />
Choose Files
</FileUpload>

<p class="text-small tiny-margin-bottom text-dark-gray">
The size limit for each file is 50 MB. You can upload up to 1 GB of files.
</p>
</fieldset>
</div>
49 changes: 49 additions & 0 deletions client/app/components/projects/projects-new-attachments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';

/**
* This component wires a fileManager to the attachments UI.
* @param {Artifact Model} artifact
*/
export default class ProjectsNewAttachmentsComponent extends Component {
get fileManager() {
// should be an instance of FileManager
return this.args.fileManager;
}

@action
markFileForDeletion(file) {
this.fileManager.markFileForDeletion(file);

this.args.package.documents = this.fileManager.existingFiles;
}

@action
unmarkFileForDeletion(file) {
this.fileManager.unMarkFileForDeletion(file);
}

// This action doesn't perform any file selection.
// That part is automatically handled by the
// ember-file-upload addon.
// Here we manually increment the number of files to
// upload to update the fileManager isDirty state.
@action
trackFileForUpload() {
/* eslint-disable-next-line no-console */
this.fileManager.trackFileForUpload();
this.args.package.documents = [
...this.args.package.documents,
...this.fileManager.filesToUpload.files,
];
}

@action
deselectFileForUpload(file) {
this.fileManager.deselectFileForUpload(file);

this.args.package.documents = this.args.package.documents.filter(
(document) => document !== file,
);
}
}
22 changes: 11 additions & 11 deletions client/app/components/projects/projects-new-project-description.hbs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{#let @form as |form|}}
<form.Section @title="Project Description">
<Ui::Question @required={{true}} as |Q|>
<Q.Label>
Please replace information in the brackets to the best of your ability.
</Q.Label>
<Ui::Question @required={{true}} as |Q|>
<Q.Label>
Please replace information in the brackets to the best of your ability.
</Q.Label>

<form.Field
@attribute="projectBrief"
@type="text-area"
id={{Q.questionId}}
@maxlength='500'
value={{"A [action(s)] [ZR#'s for ZR, ZS, ZA] to facilitate a [new] [# of max stories], [total zsf, (# DU's)], [use] development, including [sf for each use, sf open space], is being sought by [public/private] [applicant] at [address] in [neighborhood], [Community District], [Borough]."}} />
</Ui::Question>
<form.Field
@attribute="projectBrief"
@type="text-area"
id={{Q.questionId}}
@maxlength='500'
value={{"A [action(s)] [ZR#'s for ZR, ZS, ZA] to facilitate a [new] [# of max stories], [total zsf, (# DU's)], [use] development, including [sf for each use, sf open space], is being sought by [public/private] [applicant] at [address] in [neighborhood], [Community District], [Borough]."}} />
</Ui::Question>
</form.Section>
{{/let}}
3 changes: 3 additions & 0 deletions client/app/models/artifact.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export default class ArtifactModel extends Model {
@belongsTo('project', { async: false })
project;

@belongsTo('project-new', { async: false })
projectNew

@attr()
dcpName;

Expand Down
Loading

0 comments on commit d0fbfaa

Please sign in to comment.