Skip to content

Commit

Permalink
Merge branch 'beta' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyDo committed Feb 1, 2024
2 parents 6dc2071 + fd9d3ee commit 3842088
Show file tree
Hide file tree
Showing 101 changed files with 5,416 additions and 436 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ test/
.gitignore
.gitmodules
.tern-project
.travis-yml
LICENSE
README.md
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ insert_final_newline = true
trim_trailing_whitespace = true

# The YAML spec explicitly forbids tabs; we use YAML for ESLint
[{package.json,.eslintrc,.travis.yml}]
[{package.json,.eslintrc}]
indent_size = 2
indent_style = space
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
uses: actions/setup-node@v1
with:
# We could also test on multiple Node versions if needed: https://github.com/actions/setup-node#matrix-testing
node-version: '16'
node-version: '18'
# Enables caching NPM dependencies (uses https://github.com/actions/cache under the hood)
cache: 'yarn'

Expand Down
61 changes: 0 additions & 61 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM metabrainz/node:16 as bookbrainz-base
FROM metabrainz/node:18 as bookbrainz-base

ARG DEPLOY_ENV
ARG GIT_COMMIT_SHA
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dupreport": "npx jsinspect src/ || true"
},
"engines": {
"node": ">= 16.16.0"
"node": ">= 18"
},
"browserslist": "> 0.25%, not dead",
"dependencies": {
Expand All @@ -36,7 +36,7 @@
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/react-fontawesome": "^0.1.11",
"array-move": "^3.0.1",
"bookbrainz-data": "4.0.0",
"bookbrainz-data": "4.1.1",
"chart.js": "^2.9.4",
"chartjs-adapter-date-fns": "^1.0.0",
"classnames": "^2.3.2",
Expand Down Expand Up @@ -129,7 +129,7 @@
"eslint-webpack-plugin": "^2.4.1",
"faker": "^4.1.0",
"file-loader": "^6.2.0",
"jsdom": "20.0.0",
"jsdom": "22.1.0",
"jsdom-global": "3.0.2",
"mini-css-extract-plugin": "^2.7.4",
"mocha": "^9.1.3",
Expand Down
6 changes: 6 additions & 0 deletions sql/migrations/2023-05-29-admin_logs/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BEGIN TRANSACTION;

DROP TABLE IF EXISTS bookbrainz.admin_log;
DROP TYPE IF EXISTS bookbrainz.admin_action_type;

COMMIT;
25 changes: 25 additions & 0 deletions sql/migrations/2023-05-29-admin_logs/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BEGIN TRANSACTION;

CREATE TYPE bookbrainz.admin_action_type AS ENUM (
'Change Privileges'
);

COMMIT;

BEGIN TRANSACTION;

CREATE TABLE bookbrainz.admin_log (
id SERIAL PRIMARY KEY,
admin_id INT NOT NULL,
target_user_id INT NOT NULL,
old_privs INT,
new_privs INT,
action_type bookbrainz.admin_action_type NOT NULL,
time TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT timezone('UTC'::TEXT, now()),
note VARCHAR NOT NULL
);

ALTER TABLE bookbrainz.admin_log ADD FOREIGN KEY (admin_id) REFERENCES bookbrainz.editor(id);
ALTER TABLE bookbrainz.admin_log ADD FOREIGN KEY (target_user_id) REFERENCES bookbrainz.editor(id);

COMMIT;
5 changes: 5 additions & 0 deletions sql/migrations/2023-05-29-user_privileges/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN TRANSACTION;

ALTER TABLE bookbrainz.editor ADD COLUMN privs INT NOT NULL DEFAULT 1;

COMMIT;
3 changes: 3 additions & 0 deletions sql/migrations/2023-08-23-identifier-types-sequence/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BEGIN TRANSACTION;
SELECT SETVAL('identifier_type_id_seq', (SELECT MAX(id) FROM identifier_type));
COMMIT;
19 changes: 19 additions & 0 deletions sql/schemas/bookbrainz.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ CREATE TYPE bookbrainz.external_service_oauth_type AS ENUM (
'critiquebrainz'
);

CREATE TYPE bookbrainz.admin_action_type AS ENUM (
'Change Privileges'
);

CREATE TABLE bookbrainz.editor_type (
id SERIAL PRIMARY KEY,
label VARCHAR(255) NOT NULL CHECK (label <> '')
Expand All @@ -37,6 +41,7 @@ CREATE TABLE bookbrainz.editor (
type_id INT NOT NULL,
gender_id INT,
area_id INT,
privs INT NOT NULL DEFAULT 1,
revisions_applied INT NOT NULL DEFAULT 0 CHECK (revisions_applied >= 0),
revisions_reverted INT NOT NULL DEFAULT 0 CHECK (revisions_reverted >= 0),
total_revisions INT NOT NULL DEFAULT 0 CHECK (total_revisions >= 0),
Expand All @@ -56,6 +61,20 @@ CREATE TABLE bookbrainz.editor__language (
)
);

CREATE TABLE bookbrainz.admin_log (
id SERIAL PRIMARY KEY,
admin_id INT NOT NULL,
target_user_id INT NOT NULL,
old_privs INT,
new_privs INT,
action_type bookbrainz.admin_action_type NOT NULL,
time TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT timezone('UTC'::TEXT, now()),
note VARCHAR NOT NULL
);

ALTER TABLE bookbrainz.admin_log ADD FOREIGN KEY (admin_id) REFERENCES bookbrainz.editor (id);
ALTER TABLE bookbrainz.admin_log ADD FOREIGN KEY (target_user_id) REFERENCES bookbrainz.editor (id);

CREATE TABLE bookbrainz.entity (
bbid UUID PRIMARY KEY DEFAULT public.uuid_generate_v4(),
type bookbrainz.entity_type NOT NULL
Expand Down
31 changes: 19 additions & 12 deletions src/client/components/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,31 @@ function Footer(props) {
</small>
</Col>
<Col className="text-right" xs={4}>
<small>
<div className="small">
<a href="/admin-logs">
Admin Logs
</a>
</div>
<div className="small">
<a href="/privacy">
Privacy & Terms
</a>
</div>
</Col>
</Row>
<Row>
<Col className="text-center" xs={12}>
<small>
Alpha Software —{' '}
<a href={`${repositoryUrl}tree/${siteRevision || 'master'}`}>
{siteRevision || 'unknown revision'}
</a> —&nbsp;
<a href="https://tickets.metabrainz.org/projects/BB/issues/">
Report a Bug
</a>
</small>
</Col>
</Row>
<div className="text-center">
<small>
Alpha Software —{' '}
<a href={`${repositoryUrl}tree/${siteRevision || 'master'}`}>
{siteRevision || 'unknown revision'}
</a> —&nbsp;
<a href="https://tickets.metabrainz.org/projects/BB/issues/">
Report a Bug
</a>
</small>
</div>
</Container>
</footer>
);
Expand Down
Loading

0 comments on commit 3842088

Please sign in to comment.