Skip to content

Commit

Permalink
chore: prepare release v24.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nimdanitro committed May 28, 2024
2 parents e9b3ee6 + c0bdb9c commit c515487
Show file tree
Hide file tree
Showing 53 changed files with 3,795 additions and 2,113 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: f-eld-ch
11 changes: 10 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
build:
runs-on: ubuntu-latest
name: "Test and Build"
steps:
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
Expand All @@ -24,6 +24,9 @@ jobs:
node-version-file: ".nvmrc"
cache: yarn
cache-dependency-path: "ui/yarn.lock"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand Down Expand Up @@ -70,8 +73,11 @@ jobs:
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.meta.outputs.version }}
GIT_SHA=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
Expand All @@ -97,6 +103,9 @@ jobs:
with:
context: .
file: Dockerfile.hasura
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-hasura.outputs.tags }}
labels: ${{ steps.meta-hasura.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

## Demo-Environment

The current develop version is automatically deployed to: [https://sitrep-dev.zso-uri.ch](https://sitrep-dev.zso-uri.ch)
Login is possible with your Github account.
The current develop version is automatically deployed to: [https://demo.sitrep.ch](https://demo.sitrep.ch)
Login is possible with your Github account or sign-up for a new account at Auth0.

### Local Development Environment

Expand Down Expand Up @@ -48,5 +48,9 @@ cd ui && yarn start

### Translations

- To correct or add **translations** we invite you to help us out [on Weblate](https://hosted.weblate.org/projects/sitrep).<br>
[![Translation status](https://hosted.weblate.org/widgets/sitrep/-/287x66-grey.png)](https://hosted.weblate.org/engage/sitrep/)
To correct or add **translations** we invite you to help us out [on Transifex](https://explore.transifex.com/f-eld/sitrep/).
We currently support the following languages:
- German (de)
- English (en)
- Italian (it)
- French (fr)
2 changes: 1 addition & 1 deletion config.yaml → hasura/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 3
endpoint: http://localhost:8080
admin_secret: myadminsecretkey
admin_secret: 388HMfQ00gEyg636O63S1jxRODTSoAiu_XHa0fXhtRo=
metadata_directory: metadata
actions:
kind: synchronous
Expand Down
1 change: 1 addition & 0 deletions hasura/metadata/backend_configs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
54 changes: 54 additions & 0 deletions hasura/metadata/databases/Postgres/tables/public_features.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
table:
name: features
schema: public
object_relationships:
- name: layer
using:
foreign_key_constraint_on: layer_id
insert_permissions:
- role: editor
permission:
check: {}
columns:
- created_at
- geometry
- id
- layer_id
- properties
comment: ""
select_permissions:
- role: editor
permission:
columns:
- geometry
- properties
- created_at
- deleted_at
- updated_at
- id
- layer_id
filter: {}
comment: ""
- role: viewer
permission:
columns:
- geometry
- properties
- created_at
- deleted_at
- updated_at
- id
- layer_id
filter: {}
comment: ""
update_permissions:
- role: editor
permission:
columns:
- deleted_at
- geometry
- properties
- updated_at
filter: {}
check: null
comment: ""
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ array_relationships:
table:
name: journals
schema: public
- name: layers
using:
foreign_key_constraint_on:
column: incident_id
table:
name: layers
schema: public
insert_permissions:
- role: editor
permission:
Expand Down
58 changes: 58 additions & 0 deletions hasura/metadata/databases/Postgres/tables/public_layers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
table:
name: layers
schema: public
object_relationships:
- name: incident
using:
foreign_key_constraint_on: incident_id
array_relationships:
- name: features
using:
foreign_key_constraint_on:
column: layer_id
table:
name: features
schema: public
insert_permissions:
- role: editor
permission:
check: {}
columns:
- created_at
- id
- incident_id
- name
comment: ""
select_permissions:
- role: editor
permission:
columns:
- name
- created_at
- deleted_at
- updated_at
- id
- incident_id
filter: {}
comment: ""
- role: viewer
permission:
columns:
- name
- created_at
- deleted_at
- updated_at
- id
- incident_id
filter: {}
comment: ""
update_permissions:
- role: editor
permission:
columns:
- deleted_at
- name
- updated_at
filter: {}
check: null
comment: ""
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@ select_permissions:
delete_permissions:
- role: editor
permission:
backend_only: false
filter: {}
2 changes: 2 additions & 0 deletions hasura/metadata/databases/Postgres/tables/tables.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
- "!include public_divisions.yaml"
- "!include public_features.yaml"
- "!include public_incidents.yaml"
- "!include public_journals.yaml"
- "!include public_layers.yaml"
- "!include public_locations.yaml"
- "!include public_medium.yaml"
- "!include public_message_division.yaml"
Expand Down
1 change: 1 addition & 0 deletions hasura/metadata/metrics_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions hasura/metadata/opentelemetry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."layers";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE "public"."layers" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "incident_id" uuid NOT NULL, "name" text NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id") , FOREIGN KEY ("incident_id") REFERENCES "public"."incidents"("id") ON UPDATE restrict ON DELETE cascade, UNIQUE ("id"));COMMENT ON TABLE "public"."layers" IS E'Layers for Maps';
CREATE EXTENSION IF NOT EXISTS pgcrypto;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."layers" drop constraint "layers_incident_id_name_key";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."layers" add constraint "layers_incident_id_name_key" unique ("incident_id", "name");
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."features";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE "public"."features" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "geometry" jsonb NOT NULL, "properties" jsonb NOT NULL, "layer_id" uuid NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id") , FOREIGN KEY ("layer_id") REFERENCES "public"."layers"("id") ON UPDATE restrict ON DELETE no action, UNIQUE ("id"));COMMENT ON TABLE "public"."features" IS E'Features for Layers';
CREATE EXTENSION IF NOT EXISTS pgcrypto;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- CREATE TRIGGER set_public_layers_updated_at BEFORE UPDATE ON public.layers FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at();
-- CREATE TRIGGER set_public_features_updated_at BEFORE UPDATE ON public.features FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at();
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TRIGGER set_public_layers_updated_at BEFORE UPDATE ON public.layers FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at();
CREATE TRIGGER set_public_features_updated_at BEFORE UPDATE ON public.features FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at();
18 changes: 18 additions & 0 deletions scripts/cleanup-closed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,26 @@ WHERE incident_id IN (
SELECT id FROM incidents WHERE closed_at IS NOT NULL
);

DELETE FROM features
WHERE layer_id IN (
SELECT id FROM layers
WHERE incident_id IN (
SELECT id FROM incidents WHERE closed_at IS NOT NULL
)
);

DELETE FROM layers
WHERE incident_id IN (
SELECT id FROM incidents WHERE closed_at IS NOT NULL
);

DELETE FROM incidents
WHERE closed_at IS NOT NULL;

COMMIT;

BEGIN TRANSACTION;
UPDATE incidents SET closed_at = now()
WHERE closed_at IS NULL AND created_at <= now() - interval '24 hours';
COMMIT;

Loading

0 comments on commit c515487

Please sign in to comment.