Skip to content

Commit

Permalink
feat(screenshot-accepter): add more space for screenshot view
Browse files Browse the repository at this point in the history
  • Loading branch information
sipayRT committed Oct 4, 2023
1 parent 08a10fb commit b7ca56b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 deletions.
5 changes: 2 additions & 3 deletions lib/static/components/modals/screenshot-accepter/body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ class ScreenshotAccepterBody extends Component {
<div className='image-box__container'>
{
isNoRefImageError(image.error)
? this._renderImageBox('No reference image', image.actualImg)
? this._renderImageBox(image.actualImg)
: <StateFail image={image} />
}
</div>
);
}

_renderImageBox(label, image) {
_renderImageBox(image) {
return (
<div className="image-box__image">
<div className="image-box__title">{label}</div>
<ResizedScreenshot image={image} />
</div>
);
Expand Down
26 changes: 15 additions & 11 deletions lib/static/components/modals/screenshot-accepter/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
overflow-y: auto;
}

.screenshot-accepter__header {
.screenshot-accepter__header.container {
padding-left: 15px;
padding-right: 15px;
background-color: #fff;
}

.screenshot-accepter__controls.state-controls .progress-bar {
margin-left: auto;
margin-bottom: 20px;
margin-bottom: 15px;
}

.screenshot-accepter__controls.state-controls .progress-bar::after {
Expand All @@ -35,14 +37,14 @@
.state-controls.screenshot-accepter__controls {
display: flex;
flex-wrap: wrap;
margin-top: 20px;
margin-top: 15px;
}

.screenshot-accepter__controls .button,
.screenshot-accepter__controls .tab-switcher,
.screenshot-accepter__controls .select {
margin-right: 20px;
margin-bottom: 20px;
margin-right: 15px;
margin-bottom: 15px;
}

.button.screenshot-accepter__arrows-open-btn,
Expand Down Expand Up @@ -85,7 +87,7 @@

.button.screenshot-accepter__arrow-down-btn,
.button.screenshot-accepter__accept-btn {
margin-right: 20px;
margin-right: 15px;
}

.button.screenshot-accepter__arrow-down-btn .arrow-icon {
Expand All @@ -104,9 +106,9 @@

.screenshot-accepter__title {
font-size: 16px;
line-height: 20px;
margin-top: 20px;
margin-bottom: 20px;
line-height: 10px;
margin-top: 10px;
margin-bottom: 10px;
}

.screenshot-accepter__test-name {
Expand All @@ -124,8 +126,10 @@
font-size: 20px;
}

.screenshot-accepter__body {
margin-bottom: 30px;
.screenshot-accepter__body.container {
padding-left: 15px;
padding-right: 15px;
margin-bottom: 10px;
}

.screenshot-accepter__body .screenshot-accepter__icon_view-in-browser {
Expand Down
2 changes: 1 addition & 1 deletion lib/static/components/progress-bar/index.styl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.progress-bar {
position: relative;
display: flex;
outline: 1px solid #ccc;
border: 1px solid #ccc;
border-radius: 5px;

&__container {
Expand Down
2 changes: 1 addition & 1 deletion lib/static/components/state/state-fail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const StateFail = ({image, diffMode: diffModeProp, isScreenshotAccepterOpened})

return (
<div className="image-box__image" style={{flex: image.size.width}}>
{label && <div key={titleKey} ref={ref} className="image-box__title">{titleText}</div>}
{label && !isScreenshotAccepterOpened && <div key={titleKey} ref={ref} className="image-box__title">{titleText}</div>}
<ResizedScreenshot
image={image}
diffClusters={diffClusters}
Expand Down
4 changes: 2 additions & 2 deletions lib/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
}

.container {
padding-left: 30px;
padding-right: 30px;
padding-left: 20px;
padding-right: 20px;
}

main.container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('<ScreenshotAccepterBody/>', () => {
});

describe('no reference image error', () => {
it('should render screenshot with title', () => {
it('should render screenshot', () => {
const image = mkImage({
id: 'img',
parentId: 'res',
Expand All @@ -105,12 +105,8 @@ describe('<ScreenshotAccepterBody/>', () => {
const tree = mkStateTree({browsersById, resultsById});
isNoRefImageError.withArgs(image.error).returns(true);

const component = mkBodyComponent({image}, {tree});
mkBodyComponent({image}, {tree});

assert.equal(
component.find('.image-box__title').text(),
'No reference image'
);
assert.calledOnceWith(ResizedScreenshot, {image: image.actualImg});
});
});
Expand Down

0 comments on commit b7ca56b

Please sign in to comment.