Skip to content

Conversation

@psrpinto
Copy link
Member

@psrpinto psrpinto commented Dec 16, 2024

Fixes #155

There are no user-visible changes.

@psrpinto psrpinto self-assigned this Dec 16, 2024
Comment on lines 16 to 23
// Pages get a specific button.
if ( subjectType === SubjectType.Page ) {
importButtons.push( {
text: `Import Pages`,
url: Screens.importPagesStart( session.id ),
} );
return;
}
Copy link
Member Author

@psrpinto psrpinto Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that we maintain the behavior that was in place before this PR, which is that pages have a custom flow, where you manually import them one by one. I would like to not change this behavior in this PR, so that's why this code is here.

We can revisit this behavior in the future if we deem it necessary to change it.


const schema = schemas[ subjectType ];
importButtons.push( {
text: `Import ${ schema.title }s`,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted for keeping the plural like this, we can revisit this when we tackle #158.

@psrpinto psrpinto marked this pull request as ready for review December 16, 2024 14:56
@psrpinto psrpinto requested review from akirk and ashfame December 16, 2024 14:56
Copy link
Member

@ashfame ashfame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@psrpinto psrpinto merged commit 5b82ade into trunk Dec 16, 2024
3 checks passed
@psrpinto psrpinto deleted the import-buttons-schema branch December 16, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamically display import buttons for all registered subjects

3 participants