Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button reworks and navigation updates #2344

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1e2a590
feat: Update references to org public profile -> gallery (#2330)
SuaYoo Jan 27, 2025
4b627e3
Remove duplicate dialogue actions from collections
Shrinks99 Jan 28, 2025
012b9d3
Add remaining icon buttons
Shrinks99 Jan 28, 2025
e07922d
Remove share item from menu
Shrinks99 Jan 28, 2025
cb9dc7f
Remove button group
Shrinks99 Jan 28, 2025
57c4089
Move edit button for logged in users
Shrinks99 Jan 28, 2025
9f27135
fix eslint error
Shrinks99 Jan 28, 2025
a0d5035
Add dashboard link
Shrinks99 Jan 28, 2025
4a5ed2f
Simplify collection grid action dropdown → edit button
Shrinks99 Jan 28, 2025
8cf56fd
Button casing & consistency fixes
Shrinks99 Jan 28, 2025
e36a67f
Align pageHeader actions to bottom of container
Shrinks99 Jan 28, 2025
e663c0f
Adds org description and url to dashboard
Shrinks99 Jan 28, 2025
4458ae9
Re-remove duped menu item
Shrinks99 Jan 28, 2025
756eebd
Restore pencil and fix primary action buttons
Shrinks99 Jan 28, 2025
e866ca4
Remove view public button from share-collection
Shrinks99 Jan 29, 2025
d18339d
feat: Update references to org public profile -> gallery (#2330)
SuaYoo Jan 27, 2025
24ae991
Remove duplicate dialogue actions from collections
Shrinks99 Jan 28, 2025
f687ba9
Add remaining icon buttons
Shrinks99 Jan 28, 2025
8d34347
hook up edit button to edit dialog
emma-sg Jan 29, 2025
4944dd9
wip: broken logic for moving public collection view to top right
Shrinks99 Jan 29, 2025
1b0802e
refactor shareLink into separate fn
emma-sg Jan 29, 2025
3ca6726
Remove view public from share-collection controls
Shrinks99 Jan 29, 2025
594569b
temp: Move collection gallery link to icon button
Shrinks99 Jan 29, 2025
2eb4881
lint & format
emma-sg Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions frontend/docs/docs/user-guide/org-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ Settings that apply to the entire organization are found in the **Settings** pag

## General

### Name and URL
### Name, URL, and other basic information

Choose a display name for your org that's unique and memorable, like the name of your company, organization, or personal project. This name will be visible in the org's [public profile](#profile), if that page is enabled.
Your org name appears throughout the web application and in email notifications. Choose a display name for your org that's unique and memorable, like the name of your company, organization, or personal project.

The org URL is where you and other org members will go to view the dashboard, configure org settings, and manage all other org-related activities. Changing this URL will also update the URL of your org's public profile, if enabled.
The org URL is where you and other org members will go to view the dashboard, configure org settings, and manage all other org-related activities. If your org has a [public collections gallery](#public-collections-gallery) enabled, changing this will also update the URL to the gallery.

Org name and URLs are unique to each Browsertrix instance (for example, on `app.browsertrix.com`) and you may be prompted to change the org name or URL identifier if either are already in use by another org.
Org name and URLs are unique to each Browsertrix instance (for example, on `app.browsertrix.com`) and you may be prompted to change the org name or URL if either are already in use by another org.

### Profile
??? info "What information will be visible to the public?"
All org information is private until you make the org visible. Once your org is made visible to the public, the org name, description, and website will appear on the org's public gallery page. You can preview how information appears to the public by clicking **View as public**.

Enable and configure a public profile page for your org. Once enabled, anyone on the internet with a link to your org's profile page will be able to view public information like the org name, description, and public collections.
### Public Collections Gallery

Enable a homepage for your public collections to easily share all public collections in your org. Once enabled, anyone on the internet with a link to your org's public collections gallery will be able to browse public collections and view general information like the org name, description, and website.

## Billing

Expand Down
1 change: 1 addition & 0 deletions frontend/src/decorators/needLogin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ describe("needLogin", () => {
}

const Element = needLogin(
// @ts-expect-error not stubbing full BtrixElement
class TestElement extends LiteElementMock {
appState = appState;
} as unknown as {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { DEFAULT_THUMBNAIL } from "./collection-thumbnail";
import { BtrixElement } from "@/classes/BtrixElement";
import type { Dialog } from "@/components/ui/dialog";
import type { SelectCollectionAccess } from "@/features/collections/select-collection-access";
import { alerts } from "@/strings/collections/alerts";
import { CollectionAccess, type Collection } from "@/types/collection";
import { isApiError } from "@/utils/api";
import { maxLengthValidator } from "@/utils/form";
Expand Down Expand Up @@ -170,12 +171,10 @@ export class CollectionMetadataDialog extends BtrixElement {
<btrix-alert variant="warning" class="mt-2">
${org.enablePublicProfile
? msg(
"This collection will be visible on the org public profile, even without archived items. You may want to set visibility to 'Unlisted' until archived items have been added.",
"This collection will be visible in the org public collection gallery, even without archived items. You may want to set visibility to 'Unlisted' until archived items have been added.",
)
: html`
${msg(
"This collection will be visible on the org profile page, which isn't public yet. To make the org profile and this collection visible to the public, update org profile settings.",
)}
${alerts.orgNotPublicWarning}
<a
class="ml-auto flex items-center gap-1.5 font-medium underline hover:no-underline"
href=${`${this.navigate.orgBasePath}/settings`}
Expand Down
27 changes: 10 additions & 17 deletions frontend/src/features/collections/collections-grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class CollectionsGrid extends BtrixElement {
html`<btrix-collection-edit-dialog
.collectionId=${this.collectionBeingEdited ?? undefined}
?open=${!!this.collectionBeingEdited}
@sl-hide=${() => {
@sl-after-hide=${() => {
this.collectionBeingEdited = null;
// TODO propagate an event back up & refresh collections
// void this.fetchCollection();
Expand All @@ -121,22 +121,15 @@ export class CollectionsGrid extends BtrixElement {
private readonly renderActions = (collection: PublicCollection) => html`
<div class="pointer-events-none absolute left-0 right-0 top-0 aspect-video">
<div class="pointer-events-auto absolute bottom-2 right-2">
<btrix-overflow-dropdown raised>
<sl-menu>
<sl-menu-item
@click=${() => (this.collectionBeingEdited = collection.id)}
>
<sl-icon name="pencil" slot="prefix"></sl-icon>
${msg("Edit Collection")}
</sl-menu-item>
<btrix-menu-item-link
href=${`/${RouteNamespace.PublicOrgs}/${this.orgSlugState}/collections/${collection.slug}`}
>
<sl-icon slot="prefix" name="globe2"></sl-icon>
${msg("Visit Public Page")}
</btrix-menu-item-link>
</sl-menu>
</btrix-overflow-dropdown>
<btrix-button raised>
<sl-icon
label=${msg("Edit Collection")}
name="pencil"
@click=${() => {
this.collectionBeingEdited = collection.id;
}}
></sl-icon>
</btrix-button>
</div>
</div>
`;
Expand Down
16 changes: 6 additions & 10 deletions frontend/src/features/collections/edit-dialog/sharing-section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { customElement, property } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
import { when } from "lit/directives/when.js";

import { collectionShareLink } from "../helpers/share-link";
import { type SelectCollectionAccess } from "../select-collection-access";

import { BtrixElement } from "@/classes/BtrixElement";
import { viewStateContext, type ViewStateContext } from "@/context/view-state";
import { RouteNamespace } from "@/routes";
import { CollectionAccess, type Collection } from "@/types/collection";

@customElement("btrix-collection-share-settings")
Expand All @@ -39,15 +39,11 @@ export class CollectionShareSettings extends BtrixElement {
}

private get shareLink() {
const baseUrl = `${window.location.protocol}//${window.location.hostname}${window.location.port ? `:${window.location.port}` : ""}`;
if (this.collection) {
return `${baseUrl}/${
this.collection.access === CollectionAccess.Private
? `${RouteNamespace.PrivateOrgs}/${this.orgSlugState}/collections/view/${this.collection.id}`
: `${RouteNamespace.PublicOrgs}/${this.viewState?.params.slug || ""}/collections/${this.collection.slug}`
}`;
}
return "";
return collectionShareLink(
this.collection,
this.orgSlugState,
this.viewState?.params.slug || "",
);
}

private get publicReplaySrc() {
Expand Down
20 changes: 20 additions & 0 deletions frontend/src/features/collections/helpers/share-link.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { RouteNamespace } from "@/routes";
import { CollectionAccess, type Collection } from "@/types/collection";

export function collectionShareLink(
collection:
| (Pick<Collection, "id" | "slug"> & Partial<Pick<Collection, "access">>)
| undefined,
privateSlug: string | null,
publicSlug: string | null,
) {
const baseUrl = `${window.location.protocol}//${window.location.hostname}${window.location.port ? `:${window.location.port}` : ""}`;
if (collection) {
return `${baseUrl}/${
collection.access === CollectionAccess.Private
? `${RouteNamespace.PrivateOrgs}/${privateSlug}/collections/view/${collection.id}`
: `${RouteNamespace.PublicOrgs}/${publicSlug}/collections/${collection.slug}`
}`;
}
return "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class SelectCollectionAccess extends BtrixElement {
[CollectionAccess.Public]: {
label: msg("Public"),
icon: "globe2",
detail: msg("Anyone can view on the org's public profile"),
detail: msg("Anyone can view from the org public collections gallery"),
},
};

Expand Down
Loading
Loading