From b0920a621c01f255753f3a878c0851d2addc861e Mon Sep 17 00:00:00 2001 From: BlackDex Date: Thu, 12 Dec 2024 00:04:16 +0100 Subject: [PATCH] Small changes for v2024.12.0 Signed-off-by: BlackDex --- src/api/core/organizations.rs | 17 +++++++++++++++-- src/static/templates/scss/vaultwarden.scss.hbs | 7 ++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index 0f91e1c2..b31efb63 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -78,6 +78,7 @@ pub fn routes() -> Vec { restore_organization_user, bulk_restore_organization_user, get_groups, + get_groups_details, post_groups, get_group, put_group, @@ -99,6 +100,7 @@ pub fn routes() -> Vec { get_org_export, api_key, rotate_api_key, + get_billing_metadata, ] } @@ -1369,7 +1371,7 @@ async fn edit_user( ) -> EmptyResult { let mut data: EditUserData = data.into_inner(); - // HACK: We need the raw user-type be be sure custom role is selected to determine the access_all permission + // HACK: We need the raw user-type be be sure custom role is selected to determine the access_all permission // The from_str() will convert the custom role type into a manager role type let raw_type = &data.r#type.into_string(); // UserOrgType::from_str will convert custom (4) to manager (3) @@ -1981,6 +1983,12 @@ fn get_plans_tax_rates(_headers: Headers) -> Json { Json(_empty_data_json()) } +#[get("/organizations/<_org_id>/billing/metadata")] +fn get_billing_metadata(_org_id: &str, _headers: Headers) -> Json { + // Prevent a 404 error, which also causes Javascript errors. + Json(_empty_data_json()) +} + fn _empty_data_json() -> Value { json!({ "object": "list", @@ -2379,6 +2387,11 @@ async fn get_groups(org_id: &str, _headers: ManagerHeadersLoose, mut conn: DbCon }))) } +#[get("/organizations//groups/details", rank = 1)] +async fn get_groups_details(org_id: &str, headers: ManagerHeadersLoose, conn: DbConn) -> JsonResult { + get_groups(org_id, headers, conn).await +} + #[derive(Deserialize)] #[serde(rename_all = "camelCase")] struct GroupRequest { @@ -2628,7 +2641,7 @@ async fn bulk_delete_groups( Ok(()) } -#[get("/organizations//groups/")] +#[get("/organizations//groups/", rank = 2)] async fn get_group(org_id: &str, group_id: &str, _headers: AdminHeaders, mut conn: DbConn) -> JsonResult { if !CONFIG.org_groups_enabled() { err!("Group support is disabled"); diff --git a/src/static/templates/scss/vaultwarden.scss.hbs b/src/static/templates/scss/vaultwarden.scss.hbs index 944c0c93..0f707b3a 100644 --- a/src/static/templates/scss/vaultwarden.scss.hbs +++ b/src/static/templates/scss/vaultwarden.scss.hbs @@ -54,7 +54,12 @@ app-organization-plans > form > bit-section:nth-child(2) { /* Hide Collection Management Form */ app-org-account form.ng-untouched:nth-child(6) { - display:none !important + @extend %vw-hide; +} + +/* Hide 'Member Access' Report Card from Org Reports */ +app-org-reports-home > app-report-list > div.tw-inline-grid > div:nth-child(6) { + @extend %vw-hide; } /* Hide Device Verification form at the Two Step Login screen */