diff --git a/webapp/channels/src/components/integrations/__snapshots__/abstract_command.test.tsx.snap b/webapp/channels/src/components/integrations/__snapshots__/abstract_command.test.tsx.snap
index 82f849c5a0..3e06bac1cc 100644
--- a/webapp/channels/src/components/integrations/__snapshots__/abstract_command.test.tsx.snap
+++ b/webapp/channels/src/components/integrations/__snapshots__/abstract_command.test.tsx.snap
@@ -471,6 +471,475 @@ exports[`components/integrations/AbstractCommand should match snapshot 1`] = `
`;
+exports[`components/integrations/AbstractCommand should match snapshot when header/footer/loading is a string 1`] = `
+
+
+
+
+
+
+ Header as string
+
+
+
+
+
+
+`;
+
exports[`components/integrations/AbstractCommand should match snapshot, displays client error 1`] = `
{
expect(wrapper).toMatchSnapshot();
});
+ test('should match snapshot when header/footer/loading is a string', () => {
+ const wrapper = shallow(
+ ,
+ );
+ expect(wrapper).toMatchSnapshot();
+ });
+
test('should match snapshot, displays client error', () => {
const newSeverError = 'server error';
const props = {...baseProps, serverError: newSeverError};
diff --git a/webapp/channels/src/components/integrations/abstract_command.tsx b/webapp/channels/src/components/integrations/abstract_command.tsx
index f32f0c1751..d907f6233c 100644
--- a/webapp/channels/src/components/integrations/abstract_command.tsx
+++ b/webapp/channels/src/components/integrations/abstract_command.tsx
@@ -31,17 +31,17 @@ type Props = {
/**
* The header text to render, has id and defaultMessage
*/
- header: MessageDescriptor;
+ header: MessageDescriptor | string;
/**
* The footer text to render, has id and defaultMessage
*/
- footer: MessageDescriptor;
+ footer: MessageDescriptor | string;
/**
* The spinner loading text to render, has id and defaultMessage
*/
- loading: MessageDescriptor;
+ loading: MessageDescriptor | string;
/**
* Any extra component/node to render
@@ -103,6 +103,32 @@ export default class AbstractCommand extends React.PureComponent {
};
};
+ getBackstageHeader = () => {
+ if (typeof this.props.header === 'string') {
+ return {this.props.header};
+ }
+
+ return (
+
+ );
+ };
+
+ getBackstageFooter = () => {
+ if (typeof this.props.footer === 'string') {
+ return {this.props.footer};
+ }
+
+ return (
+
+ );
+ };
+
handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
@@ -362,10 +388,7 @@ export default class AbstractCommand extends React.PureComponent {
defaultMessage='Slash Commands'
/>
-
+ {this.getBackstageHeader()}