Skip to content

Commit

Permalink
Remove sequences (#906)
Browse files Browse the repository at this point in the history
* feat(database): create migration for extensions

* build(backend): add uuid feature

* feat(database): migrations to change primary keys to uuid

* build(backend): add uuid deps

* feat(backend): change id columns to uuid

* build(backend): upgrade uuid deps

* chore(database): order of columns

* chore(database): re-order columns

* chore(backend): do not include uuid in response

* chore(backend): do not include uuid in async gql features

* build(backend): upgrade deps

* build(frontend): upgrade deps

* feat(frontend): allow customizing oidc button label

* feat(config): add config param for oidc button label
  • Loading branch information
IgnisDa authored Jul 10, 2024
1 parent 72476a9 commit 776ce8e
Show file tree
Hide file tree
Showing 21 changed files with 248 additions and 119 deletions.
67 changes: 37 additions & 30 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ sea-orm = { version = "=1.0.0-rc.5", features = [
"with-chrono",
"with-json",
"with-rust_decimal",
"with-uuid",
], default-features = false }
sea-orm-migration = "=1.0.0-rc.5"
serde = { version = "=1.0.202", features = ["derive"] }
Expand Down
11 changes: 6 additions & 5 deletions apps/backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ apalis = { version = "=0.5.3", features = ["cron", "limit"] }
argon2 = "=0.6.0-pre.0"
async-graphql = { workspace = true }
async-graphql-axum = "=7.0.6"
async-trait = "=0.1.80"
aws-sdk-s3 = { version = "=1.38.0", features = ["behavior-version-latest"] }
async-trait = "=0.1.81"
aws-sdk-s3 = { version = "=1.40.0", features = ["behavior-version-latest"] }
axum = { version = "=0.7.5", features = ["macros", "multipart"] }
boilermates = "=0.3.0"
cached = { version = "=0.51.4", features = ["disk_store"] }
cached = { version = "=0.52.0", features = ["disk_store"] }
chrono = { workspace = true }
chrono-tz = "=0.9.0"
compile-time = "=0.2.0"
Expand Down Expand Up @@ -48,7 +48,7 @@ lettre = { version = "=0.11.7", features = [
"smtp-transport",
"builder",
], default-features = false }
markdown = "=1.0.0-alpha.17"
markdown = "=1.0.0-alpha.18"
nanoid = { workspace = true }
openidconnect = "=3.5.0"
paginate = "=1.1.11"
Expand All @@ -71,7 +71,7 @@ sea-orm-migration = { workspace = true }
sea-query = "=0.31.0-rc.8"
serde = { workspace = true }
serde_json = { workspace = true }
serde_with = { version = "=3.8.1", features = ["chrono_0_4"] }
serde_with = { version = "=3.8.3", features = ["chrono_0_4"] }
serde-xml-rs = "=0.6.0"
slug = "=0.1.5"
strum = { workspace = true }
Expand All @@ -83,3 +83,4 @@ tower-http = { version = "=0.5.2", features = ["catch-panic", "cors", "trace"] }
tracing = { workspace = true }
tracing-subscriber = "=0.3.18"
logs-wheel = "=0.3.1"
uuid = "=1.10.0"
3 changes: 2 additions & 1 deletion apps/backend/src/entities/collection_to_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "collection_to_entity")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub id: Uuid,
pub created_on: DateTimeUtc,
pub last_updated_on: DateTimeUtc,
pub collection_id: String,
Expand Down
3 changes: 2 additions & 1 deletion apps/backend/src/entities/metadata_to_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
use database::MetadataToMetadataRelation;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "metadata_to_metadata")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub id: Uuid,
pub from_metadata_id: String,
pub relation: MetadataToMetadataRelation,
pub to_metadata_id: String,
Expand Down
4 changes: 3 additions & 1 deletion apps/backend/src/entities/user_to_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use async_graphql::SimpleObject;
use database::UserToMediaReason;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

use crate::models::fitness::UserToExerciseExtraInformation;

Expand All @@ -12,7 +13,8 @@ use crate::models::fitness::UserToExerciseExtraInformation;
#[graphql(name = "UserToEntity")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
#[graphql(skip)]
pub id: Uuid,
pub created_on: DateTimeUtc,
pub last_updated_on: DateTimeUtc,
pub user_id: String,
Expand Down
3 changes: 3 additions & 0 deletions apps/frontend/app/lib/utilities.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ const expectedServerVariables = z.object({
FRONTEND_UMAMI_SCRIPT_URL: z.string().optional(),
FRONTEND_UMAMI_WEBSITE_ID: z.string().optional(),
FRONTEND_UMAMI_DOMAINS: z.string().optional(),
FRONTEND_OIDC_BUTTON_LABEL: z
.string()
.default("Continue with OpenID Connect"),
});

/**
Expand Down
4 changes: 3 additions & 1 deletion apps/frontend/app/routes/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
processSubmission,
redirectWithToast,
serverGqlService,
serverVariables,
} from "~/lib/utilities.server";

const searchParamsSchema = z.object({
Expand All @@ -71,6 +72,7 @@ export const loader = unstable_defineLoader(async ({ request }) => {
return {
intent: query.intent || "login",
oidcEnabled: coreDetails.oidcEnabled,
oidcButtonLabel: serverVariables.FRONTEND_OIDC_BUTTON_LABEL,
localAuthDisabled: coreDetails.localAuthDisabled,
tokenValidForDays: coreDetails.tokenValidForDays,
signupAllowed: enabledFeatures.signupAllowed,
Expand Down Expand Up @@ -270,7 +272,7 @@ export default function Page() {
type="submit"
leftSection={<IconAt size={16} />}
>
Continue with OpenID Connect
{loaderData.oidcButtonLabel}
</Button>
</Form>
</>
Expand Down
10 changes: 5 additions & 5 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"@ryot/generated": "workspace:*",
"@ryot/graphql": "workspace:*",
"@ryot/ts-utils": "workspace:*",
"@tabler/icons-react": "3.8.0",
"@tanstack/react-query": "5.49.2",
"@tanstack/react-query-devtools": "5.49.2",
"@tabler/icons-react": "3.10.0",
"@tanstack/react-query": "5.50.1",
"@tanstack/react-query-devtools": "5.50.1",
"buffer": "6.0.3",
"clsx": "2.1.1",
"cookie": "0.6.0",
Expand All @@ -40,8 +40,8 @@
"howler": "2.2.4",
"humanize-duration-ts": "2.1.1",
"immer": "10.1.1",
"isbot": "5.1.11",
"jotai": "2.8.4",
"isbot": "5.1.12",
"jotai": "2.9.0",
"js-cookie": "3.0.5",
"mantine-datatable": "7.11.1",
"react": "18.3.1",
Expand Down
4 changes: 4 additions & 0 deletions docs/includes/backend-config-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ file_storage:

# Settings related to frontend storage.
frontend:
# The button label for OIDC authentication.
# @envvar FRONTEND_OIDC_BUTTON_LABEL
oidc_button_label: "Continue with OpenID Connect"

# The number of items to display in a list view.
# @envvar FRONTEND_PAGE_SIZE
page_size: 20
Expand Down
Loading

0 comments on commit 776ce8e

Please sign in to comment.