Skip to content

Commit

Permalink
Add support for externalised attachments (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgoss authored Jun 21, 2024
1 parent 2c826b0 commit cb8feff
Show file tree
Hide file tree
Showing 25 changed files with 485 additions and 200 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- Support for externalised attachments ([#353](https://github.com/cucumber/react-components/pull/353))

## [22.1.0] - 2024-03-15
### Added
Expand Down
16 changes: 13 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"highlight-words": "1.2.2",
"mime": "^3.0.0",
"react-accessible-accordion": "5.0.0",
"react-error-boundary": "^4.0.13",
"react-markdown": "6.0.3",
"rehype-raw": "5.1.0",
"rehype-sanitize": "4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/CucumberReact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IProps {

export const CucumberReact: FunctionComponent<PropsWithChildren<IProps>> = ({
children,
theme = 'light',
theme = 'auto',
customRendering = {},
className,
}) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/customise/customRendering.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface AttachmentProps {
attachment: messages.Attachment
}

export type AttachmentClasses = Styles<'text' | 'icon' | 'image'>
export type AttachmentClasses = Styles<'text' | 'log' | 'icon' | 'image'>

export interface BackgroundProps {
background: messages.Background
Expand Down
184 changes: 0 additions & 184 deletions src/components/gherkin/Attachment.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/gherkin/GherkinStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import GherkinQueryContext from '../../GherkinQueryContext.js'
import { HighLight } from '../app/HighLight.js'
import { DefaultComponent, GherkinStepProps, useCustomRendering } from '../customise/index.js'
import { TestStepResultDetails } from '../results/index.js'
import { Attachment } from './Attachment.js'
import { Attachment } from './attachment/index.js'
import { DataTable as DataTableComponent } from './DataTable.js'
import { DocString as DocStringComponent } from './DocString.js'
import { Keyword } from './Keyword.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/gherkin/HookStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react'
import CucumberQueryContext from '../../CucumberQueryContext.js'
import { HookStepProps, useCustomRendering } from '../customise/index.js'
import { TestStepResultDetails } from '../results/index.js'
import { Attachment } from './Attachment.js'
import { Attachment } from './attachment/index.js'
import { StepItem } from './StepItem.js'
import { Title } from './Title.js'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import '../../styles/theming';
@import '../../../styles/theming';

.text {
position: relative;
white-space: pre-wrap;
font-family: $monoFamily;
font-size: 0.875em;
Expand All @@ -12,6 +13,21 @@
color: $codeTextColor;
}

.log {
padding-left: 3.25em;

&::before {
content: 'Log';
position: absolute;
top: 0.666em;
left: 0.75em;
text-transform: uppercase;
font-weight: bold;
color: $parameterColor;
opacity: 0.75;
}
}

.icon {
margin-right: 0.75em;
opacity: 0.333;
Expand Down
Loading

0 comments on commit cb8feff

Please sign in to comment.