Skip to content

Commit afc7e61

Browse files
committed
Merge branch 'main' into dont_orphan_asset_on_annotation_patch
2 parents 032abae + 59d0f5d commit afc7e61

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+925
-923
lines changed

PhotoUploadDevNotes.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Photo Upload
2+
3+
There are currently three places to change the default photo upload size and default max count amount. These three places affect these pages or modals: `Submit -> Report an Encounter`, `Submit -> Report an Encounter (classic)`, `Submit -> Bulk Import`, `Submit -> Bulk Import -> See Instructions`.
4+
5+
This is linked from comments in the relevant files which say: `Refer to PhotoUploadDevNotes.md for information/where else to change`. Non-development properties files are not annotated with this comment since those files will be changed by users.
6+
7+
Order of using:
8+
1. `commonConfiguration.properties`, which each production Wildbook can change if needed
9+
- ./devops/deploy/.dockerfiles/tomcat/commonConfiguration.properties
10+
- ./devops/development/.dockerfiles/tomcat/commonConfiguration.properties
11+
- ./src/main/resources/bundles/commonConfiguration.properties
12+
2. `org/ecocean/CommonConfiguration.java`, first fallback if properties are not initialized
13+
3. `frontend/src/constants/photoUpload.js`, second fallback if SiteSettings is not accessible

devops/deploy/.dockerfiles/tomcat/commonConfiguration.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ biologicalMeasurementSamplingProtocols2 = No lipids extracted, uncorrected
329329

330330
#Maximum uploadable media size in megabytes (MB)
331331
#This value is used for encounter images and videos as well as for file associations added to a MarkedIndividual.
332-
maxMediaSize = 40
332+
maxMediaSize = 3
333+
#Maximum number of media per encounter
334+
maximumMediaCountEncounter = 200
333335

334336
#allow video download for not logged in users
335337
videoDLNotLoggedIn = false

devops/development/.dockerfiles/tomcat/commonConfiguration.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ biologicalMeasurementSamplingProtocols2 = No lipids extracted, uncorrected
329329

330330
#Maximum uploadable media size in megabytes (MB)
331331
#This value is used for encounter images and videos as well as for file associations added to a MarkedIndividual.
332-
maxMediaSize = 40
332+
# Refer to PhotoUploadDevNotes.md for information/where else to change
333+
maxMediaSize = 3
334+
#Maximum number of media per encounter
335+
maximumMediaCountEncounter = 200
333336

334337
#allow video download for not logged in users
335338
videoDLNotLoggedIn = false

frontend/src/__tests__/pages/BulkImport/BulkImportTask.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ describe("BulkImportTask", () => {
112112
expect(
113113
screen.getByText("BULK_IMPORT_TASK_STATUS_in_progress"),
114114
).toBeInTheDocument();
115-
expect(screen.getByText("RESULTS_PER_PAGE")).toBeInTheDocument();
116115
expect(screen.getByTestId("simple-table")).toBeInTheDocument();
117116
expect(screen.getByText("E123")).toBeInTheDocument();
118117
});
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import React from "react";
2-
import { FormattedMessage } from "react-intl";
1+
import React from 'react';
2+
import { FormattedMessage } from 'react-intl';
33

44
export const AttributesAndValueComponent = ({ attributeId, value }) => {
5-
return (
6-
<div className="mb-2 d-flex align-items-baseline gap-1">
7-
<h6 className="mb-0 me-1">
8-
<FormattedMessage id={attributeId} />
9-
{":"}
10-
</h6>
11-
<p className="mb-0">{value}</p>
12-
</div>
13-
);
14-
};
5+
return (
6+
<div className="mb-2 d-flex align-items-baseline gap-1">
7+
<h6 className="mb-0 me-1">
8+
<FormattedMessage id={attributeId} />{":"}
9+
</h6>
10+
<p className="mb-0">{value}</p>
11+
</div>
12+
);
13+
}
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import React from "react";
1+
import React from 'react';
22

33
export const Divider = () => {
4-
return (
5-
<div
6-
style={{
7-
width: "100%",
8-
height: "10px",
9-
borderBottom: "1px solid #ccc",
10-
marginTop: "10px",
11-
marginBottom: "20px",
12-
}}
13-
></div>
14-
);
15-
};
4+
return (
5+
<div style={{
6+
width: '100%',
7+
height: "10px",
8+
borderBottom: '1px solid #ccc',
9+
marginTop: '10px',
10+
marginBottom: '20px',
11+
}}></div>
12+
);
13+
}

frontend/src/components/FollowUpSection.jsx

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const FollowUpSection = observer(({ store }) => {
3030
store.setSubmitterName(e.target.value);
3131
}}
3232
value={store.followUpSection?.submitter?.name}
33-
></Form.Control>
33+
/>
3434
</Form.Group>
3535
</Col>
3636
<Col>
@@ -39,13 +39,20 @@ export const FollowUpSection = observer(({ store }) => {
3939
<FormattedMessage id="CONTACT_EMAIL" />
4040
</Form.Label>
4141
<Form.Control
42-
type="text"
42+
type="email"
4343
placeholder={intl.formatMessage({ id: "TYPE_HERE" })}
4444
onChange={(e) => {
4545
store.setSubmitterEmail(e.target.value);
46+
if (store.followUpSection?.submitter?.emailError) {
47+
store.setSubmitterEmailError(false);
48+
}
4649
}}
4750
value={store.followUpSection?.submitter?.email}
48-
></Form.Control>
51+
isInvalid={store.followUpSection?.submitter?.emailError}
52+
/>
53+
<Form.Control.Feedback type="invalid">
54+
<FormattedMessage id="INVALID_EMAIL_FORMAT" />
55+
</Form.Control.Feedback>
4956
</Form.Group>
5057
</Col>
5158
</Row>
@@ -66,7 +73,7 @@ export const FollowUpSection = observer(({ store }) => {
6673
store.setPhotographerName(e.target.value);
6774
}}
6875
value={store.followUpSection?.photographer?.name}
69-
></Form.Control>
76+
/>
7077
</Form.Group>
7178
</Col>
7279
<Col>
@@ -75,13 +82,20 @@ export const FollowUpSection = observer(({ store }) => {
7582
<FormattedMessage id="CONTACT_EMAIL" />
7683
</Form.Label>
7784
<Form.Control
78-
type="text"
85+
type="email"
7986
placeholder={intl.formatMessage({ id: "TYPE_HERE" })}
8087
onChange={(e) => {
8188
store.setPhotographerEmail(e.target.value);
89+
if (store.followUpSection?.photographer?.emailError) {
90+
store.setPhotographerEmailError(false);
91+
}
8292
}}
8393
value={store.followUpSection?.photographer?.email}
84-
></Form.Control>
94+
isInvalid={store.followUpSection?.photographer?.emailError}
95+
/>
96+
<Form.Control.Feedback type="invalid">
97+
<FormattedMessage id="INVALID_EMAIL_FORMAT" />
98+
</Form.Control.Feedback>
8599
</Form.Group>
86100
</Col>
87101
</Row>
@@ -100,9 +114,16 @@ export const FollowUpSection = observer(({ store }) => {
100114
placeholder={intl.formatMessage({ id: "CSL_EMAILS_EXAMPLE" })}
101115
onChange={(e) => {
102116
store.setAdditionalEmails(e.target.value);
117+
if (store.followUpSection?.additionalEmailsError) {
118+
store.setAdditionalEmailsError(false);
119+
}
103120
}}
104121
value={store.followUpSection?.additionalEmails}
122+
isInvalid={store.followUpSection?.additionalEmailsError}
105123
/>
124+
<Form.Control.Feedback type="invalid">
125+
<FormattedMessage id="INVALID_EMAIL_FORMAT" />
126+
</Form.Control.Feedback>
106127
</Form.Group>
107128
</div>
108129
);

frontend/src/components/IdentifyIcon.jsx

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,21 @@ import React from "react";
22
import ThemeColorContext from "../ThemeColorProvider";
33

44
export default function IdentifyIcon() {
5-
const theme = React.useContext(ThemeColorContext);
6-
return (
7-
<div
8-
style={{
9-
display: "flex",
10-
width: "36px",
11-
height: " 36px",
12-
justifyContent: "center",
13-
alignItems: "center",
14-
borderRadius: "50%",
15-
backgroundColor: theme.primaryColors.primary50,
16-
}}
17-
>
18-
<svg
19-
xmlns="http://www.w3.org/2000/svg"
20-
width="18"
21-
height="18"
22-
viewBox="0 0 18 18"
23-
fill="none"
24-
>
25-
<path
26-
d="M13.9081 11.454V14.7267C13.9081 15.1767 13.5399 15.5449 13.0899 15.5449H3.27175C2.82175 15.5449 2.45356 15.1767 2.45356 14.7267V4.90851C2.45356 4.45851 2.82175 4.09033 3.27175 4.09033H5.74265C6.19265 4.09033 6.56084 3.72214 6.56084 3.27214C6.56084 2.82214 6.19265 2.45396 5.74265 2.45396H2.45356C1.55356 2.45396 0.8172 3.19033 0.8172 4.09033V15.5449C0.8172 16.4449 1.55356 17.1812 2.45356 17.1812H13.9081C14.8081 17.1812 15.5445 16.4449 15.5445 15.5449V11.454C15.5445 11.004 15.1763 10.6358 14.7263 10.6358C14.2763 10.6358 13.9081 11.004 13.9081 11.454ZM11.8627 13.9085H4.51538C4.17175 13.9085 3.98356 13.5158 4.19629 13.2458L5.61993 11.4212C5.78356 11.2167 6.09447 11.2085 6.25811 11.4131L7.53447 12.9512L9.4572 10.4803C9.62084 10.2676 9.94811 10.2676 10.1036 10.4885L12.1899 13.2621C12.3945 13.524 12.1981 13.9085 11.8627 13.9085ZM14.9717 6.45487C15.3645 5.82487 15.5854 5.08851 15.5363 4.27851C15.4299 2.51942 14.0308 1.03033 12.2881 0.842144C10.0627 0.59669 8.18084 2.32305 8.18084 4.49942C8.18084 6.53669 9.82538 8.18124 11.8545 8.18124C12.5745 8.18124 13.2454 7.96851 13.8099 7.60851L15.7817 9.58033C16.1008 9.89942 16.6245 9.89942 16.9436 9.58033C17.2627 9.26124 17.2627 8.7376 16.9436 8.41851L14.9717 6.45487ZM11.8627 6.54487C10.7336 6.54487 9.8172 5.62851 9.8172 4.49942C9.8172 3.37033 10.7336 2.45396 11.8627 2.45396C12.9917 2.45396 13.9081 3.37033 13.9081 4.49942C13.9081 5.62851 12.9917 6.54487 11.8627 6.54487Z"
27-
fill="#00ACCE"
28-
/>
29-
</svg>
30-
</div>
31-
);
32-
}
5+
const theme = React.useContext(ThemeColorContext);
6+
return (
7+
<div
8+
style={{
9+
display: "flex",
10+
width: "36px",
11+
height: " 36px",
12+
justifyContent: "center",
13+
alignItems: "center",
14+
borderRadius: "50%",
15+
backgroundColor: theme.primaryColors.primary50,
16+
}}>
17+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
18+
<path d="M13.9081 11.454V14.7267C13.9081 15.1767 13.5399 15.5449 13.0899 15.5449H3.27175C2.82175 15.5449 2.45356 15.1767 2.45356 14.7267V4.90851C2.45356 4.45851 2.82175 4.09033 3.27175 4.09033H5.74265C6.19265 4.09033 6.56084 3.72214 6.56084 3.27214C6.56084 2.82214 6.19265 2.45396 5.74265 2.45396H2.45356C1.55356 2.45396 0.8172 3.19033 0.8172 4.09033V15.5449C0.8172 16.4449 1.55356 17.1812 2.45356 17.1812H13.9081C14.8081 17.1812 15.5445 16.4449 15.5445 15.5449V11.454C15.5445 11.004 15.1763 10.6358 14.7263 10.6358C14.2763 10.6358 13.9081 11.004 13.9081 11.454ZM11.8627 13.9085H4.51538C4.17175 13.9085 3.98356 13.5158 4.19629 13.2458L5.61993 11.4212C5.78356 11.2167 6.09447 11.2085 6.25811 11.4131L7.53447 12.9512L9.4572 10.4803C9.62084 10.2676 9.94811 10.2676 10.1036 10.4885L12.1899 13.2621C12.3945 13.524 12.1981 13.9085 11.8627 13.9085ZM14.9717 6.45487C15.3645 5.82487 15.5854 5.08851 15.5363 4.27851C15.4299 2.51942 14.0308 1.03033 12.2881 0.842144C10.0627 0.59669 8.18084 2.32305 8.18084 4.49942C8.18084 6.53669 9.82538 8.18124 11.8545 8.18124C12.5745 8.18124 13.2454 7.96851 13.8099 7.60851L15.7817 9.58033C16.1008 9.89942 16.6245 9.89942 16.9436 9.58033C17.2627 9.26124 17.2627 8.7376 16.9436 8.41851L14.9717 6.45487ZM11.8627 6.54487C10.7336 6.54487 9.8172 5.62851 9.8172 4.49942C9.8172 3.37033 10.7336 2.45396 11.8627 2.45396C12.9917 2.45396 13.9081 3.37033 13.9081 4.49942C13.9081 5.62851 12.9917 6.54487 11.8627 6.54487Z" fill="#00ACCE" />
19+
</svg>
20+
</div>
21+
);
22+
}

frontend/src/components/InactivePill.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
import React from "react";
24
import PropTypes from "prop-types";
35
import ThemeColorContext from "../ThemeColorProvider";
@@ -14,7 +16,7 @@ export default function InactivePill({ text, onClick, style }) {
1416
color: "#000",
1517
borderRadius: "20px",
1618
cursor: "pointer",
17-
...style,
19+
...style,
1820
}}
1921
>
2022
{text}
@@ -24,4 +26,4 @@ export default function InactivePill({ text, onClick, style }) {
2426
InactivePill.propTypes = {
2527
text: PropTypes.string.isRequired,
2628
onClick: PropTypes.func.isRequired,
27-
};
29+
};

frontend/src/components/MainButton.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export default function MainButton({
1414
className = "",
1515
children,
1616
style,
17-
noArrow,
18-
target = false, // If true, opens link in a new tab
17+
noArrow,
18+
target = false, // If true, opens link in a new tab
1919
...rest
2020
}) {
2121
const [isHovered, setIsHovered] = useState(false);
@@ -56,7 +56,6 @@ export default function MainButton({
5656
target={target ? "_blank" : "_self"}
5757
className="d-flex align-items-center justify-content-center text-decoration-none w-100 h-100"
5858
style={{ color: "inherit" }}
59-
rel="noreferrer"
6059
>
6160
{children}
6261
<span className="ms-2"></span>

0 commit comments

Comments
 (0)