Skip to content

Commit

Permalink
feat: add docs link to connector templates notification
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Jul 26, 2024
1 parent 5a991a5 commit 91c1117
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion client/src/plugins/connector-templates/ConnectorTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

import React, { Fragment, PureComponent } from 'react';

const DOCUMENTATION_URL = 'https://docs.camunda.io/docs/components/modeler/desktop-modeler/use-connectors/';

export default class ConnectorTemplates extends PureComponent {
constructor(props) {
super(props);
Expand Down Expand Up @@ -46,6 +48,8 @@ export default class ConnectorTemplates extends PureComponent {
<Fragment key={ index }>
{ warning }
{ index === warnings.length - 1 ? null : <br /> }
<br />
<a href={ DOCUMENTATION_URL }>Learn more</a>
</Fragment>
))
});
Expand All @@ -56,14 +60,19 @@ export default class ConnectorTemplates extends PureComponent {
displayNotification({
type: 'success',
title: hasNew ? 'Camunda Connector templates updated' : 'Camunda Connector templates up to date',
content: <a href={ DOCUMENTATION_URL }>Learn more</a>
});
});

getGlobal('backend').on('client:connector-templates-update-error', (_, message) => {
displayNotification({
type: 'error',
title: 'Error updating Camunda Connector templates',
content: message
content: <Fragment>
<span>{ message }</span>
<br />
<a href={ DOCUMENTATION_URL }>Learn more</a>
</Fragment>
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('<ConnectorTemplates>', () => {
backend.receive('client:connector-templates-update-success', null, true);

// then
expect(displayNotificationSpy).to.have.been.calledWith({ type: 'success', title: 'Camunda Connector templates updated' });
expect(displayNotificationSpy).to.have.been.calledWithMatch({ type: 'success', title: 'Camunda Connector templates updated' });

expect(triggerActionSpy).to.have.been.calledWith('elementTemplates.reload');
});
Expand All @@ -69,7 +69,7 @@ describe('<ConnectorTemplates>', () => {
backend.receive('client:connector-templates-update-success', null, false);

// then
expect(displayNotificationSpy).to.have.been.calledWith({ type: 'success', title: 'Camunda Connector templates up to date' });
expect(displayNotificationSpy).to.have.been.calledWithMatch({ type: 'success', title: 'Camunda Connector templates up to date' });

expect(triggerActionSpy).to.have.been.calledWith('elementTemplates.reload');
});
Expand Down

0 comments on commit 91c1117

Please sign in to comment.