Skip to content

Commit

Permalink
Merge pull request #3883 from nulib/deploy/staging
Browse files Browse the repository at this point in the history
Deploy v9.2.3 to production
  • Loading branch information
mbklein authored Apr 25, 2024
2 parents 93b6aa6 + 2f7d94b commit 699b346
Show file tree
Hide file tree
Showing 11 changed files with 2,928 additions and 2,203 deletions.
8 changes: 4 additions & 4 deletions app/assets/js/components/IngestSheet/List.test.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { render, cleanup } from "@testing-library/react";
import { cleanup, render } from "@testing-library/react";

import IngestSheetList from "./List";
import "@testing-library/jest-dom/extend-expect";
import React from "react";
import { renderWithRouter } from "../../services/testing-helpers";

const projectId = "abcdefg123";
Expand All @@ -10,7 +10,7 @@ afterEach(cleanup);

xtest("IngestSheetList component renders", () => {
const { container } = renderWithRouter(
<IngestSheetList projectId={projectId} />
<IngestSheetList projectId={projectId} />,
);
expect(container).toBeTruthy();
});
Expand Down
3 changes: 3 additions & 0 deletions app/assets/js/components/UI/IIIF/Viewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ const IIIFViewer = ({ fileSets, iiifContent, workTypeId }) => {

const options = {
canvasHeight: 480,
informationPanel: {
open: false,
},
openSeadragon: {
gestureSettingsMouse: {
scrollToZoom: false,
Expand Down
7 changes: 3 additions & 4 deletions app/assets/js/screens/Home/Home.test.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from "react";
import { render, cleanup } from "@testing-library/react";
// this adds custom jest matchers from jest-dom
import "@testing-library/jest-dom/extend-expect";
import { cleanup, render } from "@testing-library/react";

import HomePage from "./Home";
import React from "react";
import { renderWithRouter } from "../../services/testing-helpers";

jest.mock("../../services/elasticsearch");
Expand Down
6 changes: 3 additions & 3 deletions app/assets/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"jsx": "react", // Allow command-click open components in a new file in VSCode
"baseUrl": ".",
"paths": {
"@js/*": ["js/*"],
},
"@js/*": ["js/*"]
}
},
"exclude": ["node_modules", "static"],
"exclude": ["node_modules", "static"]
}
5,027 changes: 2,868 additions & 2,159 deletions app/assets/package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions app/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
"@honeybadger-io/react": "^6.1.7",
"@nulib/design-system": "^1.5.1",
"@radix-ui/react-dialog": "^1.0.5",
"@samvera/clover-iiif": "2.4.0",
"@samvera/clover-iiif": "^2.8.0",
"@samvera/image-downloader": "^1.1.1",
"bulma": "^0.9.4",
"bulma-checkradio": "^2.1.3",
"bulma-pageloader": "^0.3.0",
"bulma-switch": "^2.0.0",
"bulma-toast": "^2.4.4",
"classnames": "^2.5.1",
"downshift": "^8.5.0",
"downshift": "^9.0.4",
"edtf": "^4.6.0",
"esbuild-plugin-svgr": "^2.1.0",
"faker": "^5.5.3",
Expand All @@ -53,7 +53,7 @@
"node-webvtt": "^1.9.4",
"phoenix": "^1.7.11",
"prop-types": "^15.8.1",
"rc-progress": "^3.5.1",
"rc-progress": "^4.0.0",
"react-beautiful-dnd": "^13.1.0",
"react-csv": "^2.2.2",
"react-device-detect": "^2.2.3",
Expand All @@ -63,19 +63,19 @@
"react-hook-form": "^7.33.1",
"react-icons": "^5.0.1",
"react-json-pretty": "^2.2.0",
"recharts": "^2.12.1",
"recharts": "^2.12.6",
"use-clipboard-copy": "^0.2.0"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/core": "^7.24.4",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/plugin-proposal-object-rest-spread": "^7.17.3",
"@babel/plugin-proposal-optional-chaining": "^7.16.7",
"@babel/plugin-transform-async-to-generator": "^7.22.5",
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/runtime": "^7.24.0",
"@babel/runtime": "^7.24.4",
"@creativebulma/bulma-divider": "^1.1.0",
"@creativebulma/bulma-tooltip": "^1.2.0",
"@elastic/elasticsearch-mock": "^2.0.0",
Expand All @@ -84,9 +84,9 @@
"@graphql-typed-document-node/core": "^3.2.0",
"@nulib/dcapi-types": "^2.1.0",
"@nulib/prettier-config": "^1.2.0",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.2.1",
"@testing-library/dom": "^10.0.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.4",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"@types/react-beautiful-dnd": "^13.1.8",
Expand All @@ -104,7 +104,7 @@
"lodash.isnull": "^3.0.0",
"lodash.isundefined": "3.0.1",
"node-fetch": "^2.6.1",
"prettier": "^3.2.4",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.3.0",
Expand Down
10 changes: 5 additions & 5 deletions app/assets/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@
"noUnusedParameters": false,
"paths": {
"@/*": ["*"],
"@js/*": ["js/*"],
"@js/*": ["js/*"]
},
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "ES6",
"types": ["jest", "node", "@testing-library/jest-dom"],
"types": ["jest", "node", "@testing-library/jest-dom"]
},
"include": [
"js/**/*.ts",
"js/**/*.js",
"js/**/*.jsx",
"js/**/*.tsx",
"types/**/*.d.ts",
"./jest.setup.ts",
"./jest.setup.ts"
],
"exclude": [
"node_modules",
"node_modules/@honeybadger-io/react/honeybadger-react.d.ts",
],
"node_modules/@honeybadger-io/react/honeybadger-react.d.ts"
]
}
18 changes: 13 additions & 5 deletions app/lib/meadow/ark_listener.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,25 @@ defmodule Meadow.ArkListener do

@impl true
def handle_notification(:works, :delete, %{id: id}, state) do
Arks.work_deleted(id)
{:noreply, state}
with_log_metadata module: __MODULE__, id: id do
Logger.info("Received DELETE notification for ARK on work #{id}")
Arks.work_deleted(id)
{:noreply, state}
end
end

def handle_notification(:works, :insert, %{id: id}, state) do
Works.get_work(id) |> Arks.mint_ark()
{:noreply, state}
with_log_metadata module: __MODULE__, id: id do
Logger.info("Received INSERT notification for ARK on work #{id}")
Works.get_work(id) |> Arks.mint_ark()
{:noreply, state}
end
end

def handle_notification(:works, _op, %{id: id}, state) do
def handle_notification(:works, op, %{id: id}, state) do
with_log_metadata module: __MODULE__, id: id do
Logger.info("Received #{String.upcase(to_string(op))} notification for ARK on work #{id}")

case Works.get_work!(id) do
nil -> :noop
work -> update_ark_metadata(work)
Expand Down
6 changes: 6 additions & 0 deletions app/lib/meadow/utils/arks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@ defmodule Meadow.Arks do
"""
def mint_ark(%Work{descriptive_metadata: %{ark: ark}} = work)
when not is_nil(ark) do
Logger.warn("Not minting ARK for work #{work.id} because it already has one: #{ark}")
{:noop, work}
end

def mint_ark(nil), do: {:noop, nil}

def mint_ark(%Work{} = work) do
Logger.info("Minting ARK for work #{work.id}")

case work |> initial_ark() |> Ark.mint() do
{:ok, result} ->
Logger.info("Minted ARK #{result.ark} for work #{work.id}")
Works.update_work(work, %{descriptive_metadata: %{ark: result.ark}})

{:error, error_message} ->
Expand Down Expand Up @@ -106,6 +110,8 @@ defmodule Meadow.Arks do
end

defp update_existing_ark(work, _, ark) do
Logger.info("Updating ARK #{ark.ark} for work #{work.id}")

case Ark.put(ark) do
{:ok, result} ->
Logger.info("Ark successfully updated. #{inspect(result)}")
Expand Down
4 changes: 2 additions & 2 deletions 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 "9.2.2"
@app_version "9.2.3"

def project do
[
Expand Down Expand Up @@ -102,7 +102,7 @@ defmodule Meadow.MixProject do
{:sigaws, git: "https://github.com/nulib/sigaws.git", branch: "otp-24", override: true},
{:sitemapper, "~> 0.8.0"},
{:sweet_xml, "~> 0.6"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_metrics, "~> 1.0"},
{:telemetry_poller, "~> 0.5"},
{:tzdata, "~> 1.1.0"},
{:ueberauth_nusso, "~> 1.0"},
Expand Down
Loading

0 comments on commit 699b346

Please sign in to comment.