Skip to content

Commit

Permalink
Help bubbles and UI string updates
Browse files Browse the repository at this point in the history
  • Loading branch information
seancolsen committed Dec 3, 2024
1 parent c7e5e78 commit d259c39
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 31 deletions.
1 change: 1 addition & 0 deletions mathesar_ui/src/components/DocsLink.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
rolesInheritance: '/user-guide/roles/#inheritance',
storedRolePasswords: '/user-guide/stored-role-passwords/',
collaborators: '/user-guide/collaborators/',
internalSchemas: '/user-guide/schemas/#internal',
};
type Page = keyof typeof pages;
Expand Down
17 changes: 10 additions & 7 deletions mathesar_ui/src/i18n/languages/en/dict.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"connect": "Connect",
"connect_and_create": "Connect + Create",
"connect_database": "Connect Database",
"connect_db_password_help": "See our [docsLink](documentation) to learn about how passwords are stored.",
"connect_existing_database": "Connect to an Existing Database",
"connect_with_community_help": "Connect with Mathesar users and contributors in our community chat. Share ideas, get help, and contribute to discussions.",
"constraint": "Constraint",
Expand Down Expand Up @@ -131,7 +132,7 @@
"create_new_pg_user": "Create a new PostgreSQL user",
"create_new_schema": "Create New Schema",
"create_record_from_search": "Create Record From Search Criteria",
"create_reference_help_info_2": "For existing columns, add foreign key constraints in the \"Advanced\" section to turn them into references.",
"create_reference_help_info_2": "Note: To turn an [italic](existing) column into a reference column, add a foreign key constraint by opening the \"Constraints\" dialog from the \"Advanced\" section of the table inspector.",
"create_relationship": "Create Relationship",
"create_relationship_between": "Create Relationship Between [tablePill] and",
"create_role": "Create Role",
Expand Down Expand Up @@ -428,6 +429,7 @@
"pick_table_record": "Pick a Record from [tableName]",
"port": "Port",
"port_invalid": "The port is invalid",
"postgresql_role_name": "PostgreSQL Role Name",
"prepare_downtime": "Prepare your users for up to five minutes of downtime.",
"preview": "Preview",
"preview_truncated_at_limit": "Preview is truncated at {limit} rows",
Expand Down Expand Up @@ -485,14 +487,13 @@
"remove_collaborator_body_2": "The user [userName] will still be able to log in to Mathesar and might still have access to other connected databases.",
"remove_collaborator_body_3": "The associated PostgreSQL role [roleName] will be unaffected.",
"remove_collaborator_name_from_database_question": "Remove [userName] as a collaborator on the [databaseName] database?",
"remove_configuration": "Remove Configuration",
"remove_filters": "{count, plural, one {Remove Filter} other {Remove {count} Filters}}",
"remove_grouping": "Remove Grouping",
"remove_old_link_create_new": "Remove old link and create a new link?",
"remove_sorting_type": "Remove {sortingType} Sorting",
"remove_stored_password": "Remove Stored Password",
"remove_stored_password_for_identifier": "Remove Stored Password for [identifier]?",
"removing_role_configuration_warning": "Removing this configuration will prevent collaborators assigned to this role from accessing databases on server ''{server}''.",
"remove_stored_password_help": "Removing this stored password will prevent collaborators assigned to this role from accessing databases on server ''{server}''.",
"reset": "Reset",
"restrict_to_unique": "Restrict to Unique",
"restrict_to_unique_help": "Ensures all values in this column are unique. Ideal for IDs, usernames, and other unique identifiers.",
Expand All @@ -501,7 +502,6 @@
"retry": "Retry",
"reuse_credentials_from_known_connection": "Reuse credentials from a known connection",
"role": "Role",
"role_configuration_removed": "The role configuration has been removed successfully",
"role_configured_all_databases_in_server": "The new password will be used for this role when connecting to any databases on server ''{server}''",
"role_configured_successfully": "Role configured successfully",
"role_configured_successfully_new_password": "Role configured successfully with new password",
Expand All @@ -510,6 +510,9 @@
"role_has_no_child_roles": "The Role does not have any Child Roles",
"role_inheritance_help": "In PostgreSQL, you can use \"role inheritance\" to grant all the privileges of one role (the parent) to another role (the child).",
"role_name": "Role Name",
"role_needs_create_connect_privileges": "Must have CONNECT and CREATE privileges",
"role_needs_create_connect_privileges_detail_1": "In order for Mathesar to function, this role needs CONNECT privileges on the database.",
"role_needs_create_connect_privileges_detail_2": "Additionally, in order for Mathesar to be [italic](installed), this role needs CREATE privileges to install Mathesar's internal schemas. You may revoke CREATE privileges after installing Mathesar if you choose. See our [docsLink](documentation) for more information.",
"role_privileges": "Role Privileges",
"roles": "Roles",
"roles_help": "PostgreSQL uses roles to manage access to data. All the roles within your PostgreSQL server are shown below.",
Expand Down Expand Up @@ -547,7 +550,7 @@
"search_tables": "Search Tables",
"search_users": "Search Users",
"seconds": "Seconds",
"section_affects_postgresql_config": "This configuration in this section is stored within the connected PostgreSQL database.",
"section_affects_postgresql_config": "The configuration in this section is stored within the connected PostgreSQL database.",
"see_docs_to_learn_more": "See our [link](documentation) to learn more.",
"select_cell_view_properties": "Select a cell to view it's properties.",
"select_cells_view_record_props": "Select one or more cells to view associated record properties.",
Expand Down Expand Up @@ -590,6 +593,7 @@
"static_record_summary_template_error": "Record summary cannot be static. Add at least one column field in order to save.",
"store_a_password": "Store a Password",
"stored_password": "Stored Password",
"stored_password_removed": "The stored password has been removed.",
"stored_role_passwords": "Stored Role Passwords",
"stored_role_passwords_help": "Mathesar stores passwords for any roles that you would like to use when authenticating with PostgreSQL to work with data. Roles with stored passwords can then be assigned to users via collaborators.",
"summarization": "Summarization",
Expand All @@ -608,7 +612,7 @@
"table_can_have_many": "With these relationships, one [tableName] record can have [bold](many) related records.",
"table_can_have_one": "With these relationships, one [tableName] record can have [bold](one) related record.",
"table_delete_permanent_warning": "Warning: This action is permanent and once deleted, the table cannot be recovered.",
"table_does_not_link": "This table does not link to any other tables",
"table_does_not_link": "There are no relationships between this table and other tables.",
"table_name": "Table Name",
"table_name_already_exists": "A table with that name already exists.",
"table_name_cannot_be_empty": "The table name cannot be empty.",
Expand Down Expand Up @@ -682,7 +686,6 @@
"use_text_for_all_columns": "Use \"Text\" for all column data types",
"user": "User",
"user_name": "User name",
"user_needs_create_connect_privileges": "The user needs CONNECT and CREATE privileges on the database.",
"user_not_found": "User not found",
"user_profile": "User Profile",
"user_type": "User type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
} from '@mathesar/components/form';
import Field from '@mathesar/components/form/Field.svelte';
import Identifier from '@mathesar/components/Identifier.svelte';
import WarningBox from '@mathesar/components/message-boxes/WarningBox.svelte';
import InfoBox from '@mathesar/components/message-boxes/InfoBox.svelte';
import RichText from '@mathesar/components/rich-text/RichText.svelte';
import {
type CombinedLoginRole,
Expand Down Expand Up @@ -62,13 +62,13 @@
}}
/>
<FieldLayout>
<WarningBox>
<InfoBox>
{$_('role_configured_all_databases_in_server', {
values: {
server: database.server.getConnectionString(),
},
})}
</WarningBox>
</InfoBox>
</FieldLayout>
</div>
<div use:portalToWindowFooter class="footer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
await $routeContext.removeConfiguredRole(
combinedLoginRole.configuredRole,
);
toast.success($_('role_configuration_removed'));
toast.success($_('stored_password_removed'));
} catch (err) {
toast.error(getErrorMessage(err));
}
Expand Down Expand Up @@ -119,14 +119,14 @@
),
},
},
body: $_('removing_role_configuration_warning', {
body: $_('remove_stored_password_help', {
values: {
server:
combinedLoginRole.configuredRole?.database.server.getConnectionString(),
},
}),
proceedButton: {
label: $_('remove_configuration'),
label: $_('remove_stored_password'),
icon: iconDeleteMajor,
},
})}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<script lang="ts">
import { _ } from 'svelte-i18n';
import Help from '@mathesar/component-library/help/Help.svelte';
import DocsLink from '@mathesar/components/DocsLink.svelte';
import {
FieldLayout,
FormSubmit,
makeForm,
requiredField,
} from '@mathesar/components/form';
import Field from '@mathesar/components/form/Field.svelte';
import { RichText } from '@mathesar/components/rich-text';
import type { Database } from '@mathesar/models/Database';
import { databasesStore } from '@mathesar/stores/databases';
import {
Expand Down Expand Up @@ -74,12 +77,27 @@
field={databaseName}
help={$_('make_sure_database_exists')}
/>
<Field
label={$_('username')}
layout="stacked"
field={role}
help={$_('user_needs_create_connect_privileges')}
/>
<Field label={$_('postgresql_role_name')} layout="stacked" field={role}>
<svelte:fragment slot="help">
{$_('role_needs_create_connect_privileges')}
<Help>
<p>{$_('role_needs_create_connect_privileges_detail_1')}</p>
<p>
<RichText
text={$_('role_needs_create_connect_privileges_detail_2')}
let:slotName
let:translatedArg
>
{#if slotName === 'italic'}
<em>{translatedArg}</em>
{:else if slotName === 'docsLink'}
<DocsLink page="internalSchemas">{translatedArg}</DocsLink>
{/if}
</RichText>
</p>
</Help>
</svelte:fragment>
</Field>
<Field
label={$_('password')}
layout="stacked"
Expand All @@ -88,7 +106,19 @@
component: PasswordInput,
props: { autocomplete: 'new-password' },
}}
/>
>
<svelte:fragment slot="help">
<RichText
text={$_('connect_db_password_help')}
let:slotName
let:translatedArg
>
{#if slotName === 'docsLink'}
<DocsLink page="storedRolePasswords">{translatedArg}</DocsLink>
{/if}
</RichText>
</svelte:fragment>
</Field>
<FieldLayout>
<InstallationSchemaSelector {installationSchemas} />
</FieldLayout>
Expand Down
19 changes: 9 additions & 10 deletions mathesar_ui/src/systems/table-view/link-table/LinkTableForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import InfoBox from '@mathesar/components/message-boxes/InfoBox.svelte';
import OutcomeBox from '@mathesar/components/message-boxes/OutcomeBox.svelte';
import { RichText } from '@mathesar/components/rich-text';
import SeeDocsToLearnMore from '@mathesar/components/SeeDocsToLearnMore.svelte';
import SelectTable from '@mathesar/components/SelectTable.svelte';
import { iconTableLink } from '@mathesar/icons';
import type { Table } from '@mathesar/models/Table';
Expand Down Expand Up @@ -227,15 +226,18 @@
let isNewColumnsOpen = false;
</script>

<div class="description">
{$_('references_help')}
<SeeDocsToLearnMore page="relationships" />
</div>

<div class="form" class:self-referential={isSelfReferential}>
<FieldLayout>
<InfoBox>
{$_('create_reference_help_info_2')}
<RichText
text={$_('create_reference_help_info_2')}
let:slotName
let:translatedArg
>
{#if slotName === 'italic'}
<em>{translatedArg}</em>
{/if}
</RichText>
</InfoBox>
</FieldLayout>

Expand Down Expand Up @@ -415,9 +417,6 @@
--target-fill: var(--base-fill);
--target-stroke: var(--base-stroke);
}
.description {
margin-bottom: 1rem;
}
.collapsible-detail {
padding: var(--size-xx-small);
margin-top: 0.25em;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script lang="ts">
import { _ } from 'svelte-i18n';
import Help from '@mathesar/component-library/help/Help.svelte';
import SeeDocsToLearnMore from '@mathesar/components/SeeDocsToLearnMore.svelte';
import { currentTable } from '@mathesar/stores/tables';
import {
ControlledModal,
Expand All @@ -13,7 +15,14 @@
</script>

{#if $currentTable}
<ControlledModal {controller} size="large" title={$_('create_relationship')}>
<ControlledModal {controller} size="large">
<span slot="title">
{$_('create_relationship')}
<Help>
{$_('references_help')}
<SeeDocsToLearnMore page="relationships" />
</Help>
</span>
<LinkTableForm base={$currentTable} close={() => controller.close()} />
</ControlledModal>
{/if}

0 comments on commit d259c39

Please sign in to comment.