Skip to content

Commit

Permalink
Merge pull request #4156 from nulib/deploy/staging
Browse files Browse the repository at this point in the history
Deploy v9.4.12 to production
  • Loading branch information
mbklein authored Oct 11, 2024
2 parents 4a10a9e + 5aa7406 commit 9f7515c
Show file tree
Hide file tree
Showing 24 changed files with 2,633 additions and 1,764 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,22 @@ jobs:
ports:
- 9200:9200
localstack:
image: localstack/localstack-pro:2.1.0
image: localstack/localstack
env:
DOCKER_HOST: unix:///var/run/docker.sock
GATEWAY_LISTEN: 0.0.0.0:4566
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
ports:
- 4566:4566
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
steps:
- uses: actions/checkout@v2
- name: Provision Localstack using Cloud Pod
- uses: hashicorp/setup-terraform@v3
- name: Provision Localstack using Terraform
run: |
pip install localstack==2.1.0
curl -O https://nul-public.s3.amazonaws.com/meadow/test/localstack.pod
localstack pod load file://$PWD/localstack.pod
terraform init
terraform apply -auto-approve -var-file test.tfvars -var localstack_endpoint=https://localhost.localstack.cloud:4566
working-directory: ./infrastructure/localstack
- uses: actions/setup-node@v3
with:
node-version-file: ./.tool-versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const S3ObjectPicker = ({
case ChonkyActions.ChangeSelection.id:
if (
action.payload.selection.size == 0 &&
files.find(({ id }) => selectedFile == id)
files?.find(({ id }) => selectedFile == id)
) {
fileBrowserRef.current.setFileSelection(new Set([selectedFile]));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ const S3ObjectProvider = forwardRef(
useImperativeHandle(ref, () => ({
findFileSetByUri: (value) => {
const objects = data?.ListIngestBucketObjects?.objects;
if (!objects) return null;
const found = objects?.find(({ uri }) => uri == value);
if (!found) return null;

const found = objects.find(({ uri }) => uri == value);
return { ...found, key: found.uri, uri: undefined };
},
}));
Expand Down
3,198 changes: 1,486 additions & 1,712 deletions app/assets/package-lock.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions app/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@apollo/react-hooks": "^4.0.0",
"@apollo/react-testing": "^4.0.0",
"@appbaseio/reactivesearch": "3.23.1",
"@aws-sdk/client-s3": "^3.650.0",
"@aws-sdk/client-s3": "^3.669.0",
"@emotion/react": "^11.13.3",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
Expand All @@ -30,7 +30,7 @@
"@honeybadger-io/js": "^6.10.0",
"@honeybadger-io/react": "^6.1.7",
"@nulib/design-system": "^1.5.1",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.2",
"@samvera/clover-iiif": "^2.10.1",
"@samvera/image-downloader": "^1.1.1",
"bulma": "^0.9.4",
Expand All @@ -48,7 +48,7 @@
"file-saver": "^2.0.5",
"graphql": "^16.9.0",
"graphql-tag": "^2.12.6",
"hls.js": "^1.5.15",
"hls.js": "^1.5.16",
"inflection": "^3.0.0",
"jest-environment-jsdom": "^29.7.0",
"js-cookie": "^3.0.5",
Expand All @@ -60,38 +60,38 @@
"react-beautiful-dnd": "^13.1.0",
"react-csv": "^2.2.2",
"react-device-detect": "^2.2.3",
"react-dropzone": "^14.2.1",
"react-dropzone": "^14.2.9",
"react-error-boundary": "^4.0.13",
"react-helmet": "^6.1.0",
"react-hook-form": "^7.33.1",
"react-icons": "^5.3.0",
"react-json-pretty": "^2.2.0",
"recharts": "^2.12.7",
"recharts": "^2.13.0",
"use-clipboard-copy": "^0.2.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/core": "^7.25.8",
"@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.24.7",
"@babel/preset-env": "^7.25.4",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/runtime": "^7.25.6",
"@babel/plugin-transform-async-to-generator": "^7.25.7",
"@babel/preset-env": "^7.25.8",
"@babel/preset-react": "^7.25.7",
"@babel/preset-typescript": "^7.25.7",
"@babel/runtime": "^7.25.7",
"@creativebulma/bulma-divider": "^1.1.0",
"@creativebulma/bulma-tooltip": "^1.2.0",
"@elastic/elasticsearch-mock": "^2.0.0",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^4.3.3",
"@graphql-codegen/cli": "^5.0.3",
"@graphql-codegen/client-preset": "^4.4.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@nulib/dcapi-types": "^2.5.0",
"@nulib/prettier-config": "^1.2.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"@types/jest": "^29.5.13",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-router-dom": "^5.3.3",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
Expand All @@ -112,9 +112,9 @@
"react-dom": "^18.3.1",
"react-router-dom": "^5.3.0",
"react-router-prop-types": "^1.0.5",
"sass": "^1.78.0",
"sass": "^1.79.4",
"ts-node": "^10.9.2",
"typescript": "^5.6.2",
"typescript": "^5.6.3",
"use-phoenix-channel": "^1.1.1"
}
}
1 change: 1 addition & 0 deletions app/lib/meadow/data/csv/import.ex
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ defmodule Meadow.Data.CSV.Import do
defp add_scheme(value, _), do: value

defp decode_field({:array, _}, nil), do: []
defp decode_field({type, {schema, spec}}, value), do: decode_field({type, schema, spec}, value)
defp decode_field({_, _, %Ecto.Embedded{cardinality: :many, related: _}}, nil), do: []
defp decode_field({_, _, %Ecto.Embedded{cardinality: :one, related: _}}, nil), do: nil
defp decode_field(_, nil), do: nil
Expand Down
4 changes: 3 additions & 1 deletion app/lib/meadow/data/schemas/types/edtf_date.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ defmodule Meadow.Data.Types.EDTFDate do

defp humanize(%{edtf: edtf}), do: humanize(edtf)

defp humanize(""), do: {:error, message: "cannot be blank"}

defp humanize(edtf) when is_binary(edtf) do
case EDTF.humanize(edtf) do
{:error, error} -> {:error, message: error}
{:error, _} -> :error
result -> {:ok, %{edtf: edtf, humanized: result}}
end
end
Expand Down
19 changes: 12 additions & 7 deletions app/lib/meadow/data/schemas/validations.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@ defmodule Meadow.Data.Schemas.Validations do
"""
def prepare_embed(%Ecto.Changeset{data: data, params: params} = change, field)
when is_atom(field) do
empty_struct = fn ->
{:parameterized, _type, field_spec} = data.__struct__.__schema__(:type, field)
field_spec.related.__struct__ |> Map.from_struct()
end

with f <- to_string(field),
current <- Enum.find([field, f], &Map.get(data, &1)) do
value =
cond do
Map.has_key?(params, f) and is_nil(Map.get(params, f)) -> empty_struct.()
Map.has_key?(params, f) and is_nil(Map.get(params, f)) -> empty_struct(data, field)
Map.has_key?(params, f) -> Map.get(params, f)
is_nil(current) -> empty_struct.()
is_nil(current) -> empty_struct(data, field)
true -> nil
end

Expand All @@ -35,4 +30,14 @@ defmodule Meadow.Data.Schemas.Validations do
end
end
end

defp empty_struct(data, field) do
field_spec =
case data.__struct__.__schema__(:type, field) do
{:parameterized, _type, f} -> f
{:parameterized, {_type, f}} -> f
end

field_spec.related.__struct__ |> Map.from_struct()
end
end
6 changes: 3 additions & 3 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.4.11"
@app_version "9.4.12"

def project do
[
Expand Down Expand Up @@ -58,13 +58,13 @@ defmodule Meadow.MixProject do
{:briefly, "~> 0.5.0"},
{:broadway_dashboard, "~> 0.3.0"},
{:broadway_sqs, "~> 0.7.0"},
{:cachex, "~> 3.2"},
{:cachex, "~> 4.0"},
{:configparser_ex, "~> 4.0.0"},
{:credo, "~> 1.7.0", only: [:dev, :test], runtime: false},
{:dataloader, "~> 1.0.6"},
{:ecto_enum, "~> 1.4.0"},
{:ecto_psql_extras, "~> 0.2"},
{:ecto_ranked, "~> 0.5.0"},
{:ecto_ranked, "~> 0.5"},
{:ecto_sql, "~> 3.0 and >= 3.4.4"},
{:elastix, "~> 0.10.0"},
{:ets, "~> 0.9.0"},
Expand Down
Loading

0 comments on commit 9f7515c

Please sign in to comment.