Skip to content

Commit

Permalink
Merge branch 'v5' into bug/pdf-grover
Browse files Browse the repository at this point in the history
  • Loading branch information
briri committed Jun 25, 2024
2 parents ff575d4 + dcf0226 commit a52fd28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/models/draft.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Draft < ApplicationRecord
validates_uniqueness_of :dmp_id, allow_blank: true

# Validate that the attachment is a PDF and that it is less than 250KB
validates :narrative, size: { less_than: 250.kilobytes , message: 'PDF too large, must be less than 350KB' },
validates :narrative, size: { less_than: 2.megabytes , message: 'PDF too large, must be less than 2MB' },
content_type: { in: ['application/pdf'], message: 'must be a PDF document' }

def self.by_org(org_id:)
Expand Down
10 changes: 5 additions & 5 deletions react-client/src/pages/plan/setup/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "./setup.scss";
function DmpSetup() {
let navigate = useNavigate();

const {dmpId} = useParams();
const { dmpId } = useParams();
const [dmp, setDmp] = useState(new DmpModel({}));
const [errors, setErrors] = useState(new Map());
const [working, setWorking] = useState(false);
Expand All @@ -31,9 +31,9 @@ function DmpSetup() {
function isValid(fdata) {
let err = new Map();

const sizeLimit = 1000000;
const sizeLimit = 2000000;
if (fdata.get("narrative").size > sizeLimit) {
err.set("narrative", "File size cannot exceed 1 Mb");
err.set("narrative", "File size cannot exceed 2 Mb");
}

if (!fdata.get("title")) {
Expand Down Expand Up @@ -141,10 +141,10 @@ function DmpSetup() {
<div className="dmpui-form-cols">
<div className="dmpui-form-col">
<div className={"dmpui-field-group"}>
<label className="dmpui-field-label" for="dmpNarrative">Upload DMP</label>
<label className="dmpui-field-label" htmlFor="dmpNarrative">Upload DMP</label>
<p className="dmpui-field-help">
Only PDFs may be uploaded, and files should be no more than
1MB.
2MB.
</p>
{errors.get("narrative") && (
<p className="dmpui-field-error"> {errors.get("narrative")} </p>
Expand Down

0 comments on commit a52fd28

Please sign in to comment.