-
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.
file queue has files but that is it, no good news
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
1 parent
5557f51
commit d0fbfaa
Showing
19 changed files
with
455 additions
and
92 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
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
22 changes: 22 additions & 0 deletions
22
client/app/components/projects/projects-new-attached-documents.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,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> 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
132
client/app/components/projects/projects-new-attachments.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,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
49
client/app/components/projects/projects-new-attachments.js
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,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
22
client/app/components/projects/projects-new-project-description.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 |
---|---|---|
@@ -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}} |
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
Oops, something went wrong.