Skip to content

Commit

Permalink
Merge pull request #3173 from nulib/deploy/staging
Browse files Browse the repository at this point in the history
Deploy v6.1.3 to production
  • Loading branch information
kdid authored Sep 22, 2022
2 parents 7d70003 + e6856ae commit 260f59a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 315 deletions.
12 changes: 7 additions & 5 deletions app/assets/js/components/BatchEdit/ModalRemove.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const modalContent = css`
`;

function setupCandidateList(items) {
if (items.length == 0) return [];

const newList = items.map((item) => {
const { label, role, term } = splitFacetKey(item.key);
return {
Expand Down Expand Up @@ -48,9 +50,7 @@ export default function BatchEditAboutModalRemove({
: [];

useEffect(() => {
if (items.length > 0) {
setCandidateList(setupCandidateList(items));
}
setCandidateList(setupCandidateList(items));
}, [items]);

function handleCheckboxChange({ key }) {
Expand All @@ -74,7 +74,9 @@ export default function BatchEditAboutModalRemove({
{currentRemoveField.label}
</h3>
<h4 className="subtitle">
Select values to remove from all batch Works
{items.length > 0
? `Select values to remove from all batch Works`
: `Selected batch Works do not have ${currentRemoveField.label} values`}
</h4>
</header>
<div className="my-4">
Expand Down Expand Up @@ -102,7 +104,7 @@ export default function BatchEditAboutModalRemove({
<footer>
<div className="buttons is-right">
<Button isLight onClick={closeModal} data-testid="close-button">
Save &amp; close
{items.length > 0 && `Save & `} Close
</Button>
</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion app/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Code.require_file("lib/env.ex")
defmodule Meadow.MixProject do
use Mix.Project

@app_version "6.1.2"
@app_version "6.1.3"

def project do
[
Expand Down
10 changes: 6 additions & 4 deletions lambdas/mime-type/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ const extractMimeType = async (event) => {
try {
const s3 = new AWS.S3();

const s3Stream = s3.getObject({
const { Body: firstK } = await s3.getObject({
Bucket: event.bucket,
Key: event.key,
}).createReadStream();
Range: "bytes=0-1023"
}).promise();

// response: {"ext":"jpg","mime":"image/jpeg"}
const fileType = await FileType.fromStream(s3Stream) || fallback(event);
const fileType = await FileType.fromBuffer(firstK);
if (fileType) {
console.log('identified file as', JSON.stringify(fileType));
return { ...fileType, verified: true };
} else {
return fallback(event);
}
return undefined;
} catch (e) {
console.error("Error extracting mime-type");
return Promise.reject(e);
Expand Down
306 changes: 1 addition & 305 deletions lambdas/mime-type/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 260f59a

Please sign in to comment.