Skip to content

Commit

Permalink
Merge pull request #4107 from mathesar-foundation/4053_db_object_type…
Browse files Browse the repository at this point in the history
…_in_page_title

Add entity type names to database and schema pages
  • Loading branch information
pavish authored Jan 8, 2025
2 parents 1d42750 + f1f07ef commit 9115c1c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mathesar_ui/src/components/AppSecondaryHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
.content {
padding: var(
--AppSecondaryHeader__padding,
var(--size-x-large) var(--page-padding-x)
var(--size-large) var(--page-padding-x)
);
}
.content.restrict-width {
Expand Down
18 changes: 15 additions & 3 deletions mathesar_ui/src/components/PageTitleAndMeta.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
export let icon: IconProps;
export let name: string;
export let description: string | undefined = undefined;
export let entityTypeName: string | undefined = undefined;
export let subText: string | undefined = undefined;
</script>

<div class="container">
Expand All @@ -15,9 +16,12 @@
<Icon {...icon} size="1.5em" />
</div>
<div class="left-meta-container">
{#if entityTypeName}
<span class="entity-type-name">{entityTypeName}</span>
{/if}
<span class="entity-name">{name}</span>
{#if description}
<span class="entity-description">{description}</span>
{#if subText}
<span>{subText}</span>
{/if}
</div>
</div>
Expand Down Expand Up @@ -67,6 +71,14 @@
gap: var(--size-super-ultra-small);
}
.entity-type-name {
font-size: var(--text-size-x-small);
font-weight: 500;
line-height: 1;
color: var(--sand-700);
text-transform: uppercase;
}
.entity-name {
font-weight: 500;
font-size: var(--text-size-xx-large);
Expand Down
5 changes: 2 additions & 3 deletions mathesar_ui/src/pages/database/DatabasePageWrapper.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@
slot="secondary-header"
pageTitleAndMetaProps={{
name: database.name,
entityTypeName: $_('database'),
icon: iconDatabase,
description: `${$_(
'db_server',
)}: ${database.server.getConnectionString()}`,
subText: `${$_('db_server')}: ${database.server.getConnectionString()}`,
}}
>
<div slot="action">
Expand Down
1 change: 1 addition & 0 deletions mathesar_ui/src/pages/schema/SchemaPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
pageTitleAndMetaProps={{
name: $name,
icon: iconSchema,
entityTypeName: $_('schema'),
}}
>
<div slot="action">
Expand Down

0 comments on commit 9115c1c

Please sign in to comment.