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
Navigate to linked table via cell context menu #3526
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hitenvidhani this is a good start. I have some changes to request:
-
In
ColumnHeaderContextMenu.svelte
-
Don't use
router.goto
. Instead, useLinkMenuItem
like we are using inRowCell.svelte
. -
You have:
{$_('open')} <Identifier>{column.name}</Identifier> {$_('table')}
This structure might be problematic when translated into other languages and thus does not follow best-practices for i18n. Apologies that we don't yet have any documented code standards which explain this. (We only recently enabled i18n.) The problem here is that some languages might follow different grammatical structures to translate this same text and the words might become rearranged or split depending on context. For this reason, translation needs to take place at a less granular level. We need to translate pieces of text at a higher level than this.
For this particular string you'll need to make use of the
RichText.svelte
component. Look at the documentation within the component to understand how it works, and check other usages of it too. You'll need to add a new string tosrc/i18n/languages/en/dict.json
like this:{ // ... "open_named_table": "Open [tableName] table", // ... }
Then pass that string into
RichText.svelte
with the other props and child components as necessary. -
In that string above, don't use the column name. Instead use the the table name.
-
-
In
RowCell.svelte
, you've added code which uses the following expression:$recordSummaries.get(String(column.id))?.get(String(value))
Because this expression is also present higher up in the component, it would be nice to extract up into a common
recordSummary
variable that gets used in both places. This would improve code cleanliness.
recordSummary={$recordSummaries | ||
.get(String(column.id)) | ||
?.get(String(value))} | ||
recordSummary={recordName} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract up into a common recordSummary variable that gets used in both places.
Throws lint error hence making this change
175:36 error 'recordSummary' is already declared in the upper scope on line 105 column 6 @typescript-eslint/no-shadow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same reason to keep the variable as recordName
and not recordSummary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed 9609d37 which fixes this problem at the lower scope instead of the higher. This way we get the preferred name across more lines of the file. And we use the rs
name in a very small scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hitenvidhani.
I added a few other commits to clean things up. Please look over them and make sure you understand them. Ask questions if anything I did seems concerning or doesn't make sense.
cd33b4f
Thank you @seancolsen . Also I don't see these features on the demo site https://demo.mathesar.org/, is it only after the release it would reflect here? |
Good questions, @hitenvidhani
|
Sure @seancolsen |
@hitenvidhani I opened #3542 with some clearer requirements. We can continue to discuss there. |
Fixes #2350
Screenshots
On clicking a record which is inked
On clicking a record which is not linked
On clicking column name which is linked
On clicking column name not linked
Checklist
Update index.md
).develop
branch of the repositoryvisible errors.
Developer Certificate of Origin
Developer Certificate of Origin