Skip to content

Commit

Permalink
Allow markdown in stage descriptions (#8018)
Browse files Browse the repository at this point in the history
* feat(core/presentation): Expose the <Markdown/> component to AngularJS

* feat(core/pipeline): Allow stage descriptions to include markdown

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
christopherthielen and mergify[bot] committed Mar 10, 2020
1 parent b89a1a4 commit 1376b7d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h4 ng-bind="stage.name || '[new stage]'"></h4>
<p class="small" ng-if="stage.type && label">
<strong>Stage type:</strong> {{label}}<br />
{{description}}
<markdown message="description"></markdown>
</p>
<p class="small" ng-if="extendedDescription" ng-bind-html="extendedDescription"></p>
<p class="small" ng-if="!stage.type">No stage type selected</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { module } from 'angular';
import { react2angular } from 'react2angular';
import { Markdown } from './Markdown';

export const CORE_PRESENTATION_MARKDOWN = 'core.presentation.markdown';
module(CORE_PRESENTATION_MARKDOWN, []).component(
'markdown',
react2angular(Markdown, ['message', 'tag', 'trim', 'className', 'options']),
);
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { CORE_PRESENTATION_COLLAPSIBLESECTION_COLLAPSIBLESECTION_DIRECTIVE } fro
import { CORE_PRESENTATION_ISVISIBLE_ISVISIBLE_DIRECTIVE } from './isVisible/isVisible.directive';
import { CORE_PRESENTATION_SORTTOGGLE_SORTTOGGLE_DIRECTIVE } from './sortToggle/sorttoggle.directive';
import { CORE_PRESENTATION_PERCENT_FILTER } from './percent.filter';
import { CORE_PRESENTATION_MARKDOWN } from './markdown.component';

export const CORE_PRESENTATION_PRESENTATION_MODULE = 'spinnaker.core.presentation';
export const name = CORE_PRESENTATION_PRESENTATION_MODULE; // for backwards compatibility
Expand All @@ -30,6 +31,7 @@ module(CORE_PRESENTATION_PRESENTATION_MODULE, [
PAGE_SECTION_COMPONENT,
CORE_PRESENTATION_COLLAPSIBLESECTION_COLLAPSIBLESECTION_DIRECTIVE,
CORE_PRESENTATION_ISVISIBLE_ISVISIBLE_DIRECTIVE,
CORE_PRESENTATION_MARKDOWN,
ROBOT_TO_HUMAN_FILTER,
CORE_PRESENTATION_SORTTOGGLE_SORTTOGGLE_DIRECTIVE,
CORE_PRESENTATION_PERCENT_FILTER,
Expand Down

0 comments on commit 1376b7d

Please sign in to comment.