Skip to content

CB-4707 move connection shield logic to separate component#2478

Merged
Wroud merged 5 commits intodevelfrom
CB-4707-connection-shield
Mar 22, 2024
Merged

CB-4707 move connection shield logic to separate component#2478
Wroud merged 5 commits intodevelfrom
CB-4707-connection-shield

Conversation

@devnaumov
Copy link
Copy Markdown
Member

No description provided.


const connection = useResource(ConnectionShield, ConnectionInfoResource, connectionKey);

const [connecting, setConnecting] = useState(false);
Copy link
Copy Markdown
Contributor

@sergeyteleshev sergeyteleshev Mar 19, 2024

Choose a reason for hiding this comment

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

I suggest to move this flag to ConnectionsManagerService and make it observable. from this point connecting state will be available not only here but wherever it is needed in future

}
}

if (connection.data && !connection.data.connected) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I dont like we have drawing logic here and in the parent component. Lets make it in one place here

we can add extra prop something like noDataPlaceholderText

and if there is no connectcion.data we draw placeholder here.

if noDataPlaceholderText is not provided, draw a default defined placeholder

after that you can safely remove this code from the parent component:
<TextPlaceholder>{translate('plugin_object_viewer_table_no_items')}</TextPlaceholder>

@Wroud Wroud merged commit affbe44 into devel Mar 22, 2024
@Wroud Wroud deleted the CB-4707-connection-shield branch March 22, 2024 17:33
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.

4 participants