Skip to content

Commit 5424d2c

Browse files
authored
Merge branch 'develop' into refactor/collection-view
2 parents f7bc1d4 + d5eee45 commit 5424d2c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1569
-647
lines changed

client/common/icons.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ import Account from '../images/account.svg';
1818
import Code from '../images/code.svg';
1919
import Save from '../images/save.svg';
2020
import Terminal from '../images/terminal.svg';
21-
2221
import Folder from '../images/folder-padded.svg';
23-
2422
import CircleTerminal from '../images/circle-terminal.svg';
2523
import CircleFolder from '../images/circle-folder.svg';
2624
import CircleInfo from '../images/circle-info.svg';
25+
import Add from '../images/add.svg';
26+
import Filter from '../images/filter.svg';
2727
import Cross from '../images/cross.svg';
2828

2929
// HOC that adds the right web accessibility props
@@ -100,3 +100,5 @@ export const CrossIcon = withLabel(Cross);
100100
export const CircleTerminalIcon = withLabel(CircleTerminal);
101101
export const CircleFolderIcon = withLabel(CircleFolder);
102102
export const CircleInfoIcon = withLabel(CircleInfo);
103+
export const AddIcon = withLabel(Add);
104+
export const FilterIcon = withLabel(Filter);

client/components/Nav/NavBar.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ function NavBar({ children, className }) {
7171
onFocus: clearHideTimeout
7272
}),
7373
createMenuItemHandlers: (dropdown) => ({
74-
onMouseUp: () => {
74+
onMouseUp: (e) => {
75+
if (e.button === 2) {
76+
return;
77+
}
7578
setDropdownOpen('none');
7679
},
7780
onBlur: handleBlur,

client/components/RootPage.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ import { prop } from '../theme';
44
const RootPage = styled.div`
55
min-height: 100%;
66
display: flex;
7+
justify-content: start;
78
flex-direction: column;
89
color: ${prop('primaryTextColor')};
910
background-color: ${prop('backgroundColor')};
1011
height: ${({ fixedHeight }) => fixedHeight || 'initial'};
12+
13+
@media (max-width: 770px) {
14+
height: 100%;
15+
overflow: hidden;
16+
}
1117
`;
1218

1319
export default RootPage;

client/images/add.svg

Lines changed: 3 additions & 0 deletions
Loading

client/images/filter.svg

Lines changed: 3 additions & 0 deletions
Loading

client/images/plus-icon.svg

Lines changed: 2 additions & 11 deletions
Loading

client/index.integration.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ describe('index.jsx integration', () => {
5959
// spy on this function and wait for it to be called before making assertions
6060
const spy = jest.spyOn(Actions, 'getUser');
6161

62+
window.process.env.PREVIEW_URL = 'http://localhost:8002';
6263
beforeEach(async () => {
6364
act(() => {
6465
subject();

client/jest.setup.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// eslint-disable-next-line import/no-extraneous-dependencies
2+
import 'jest-styled-components';
13
import 'regenerator-runtime/runtime';
24

35
// See: https://github.com/testing-library/jest-dom

client/modules/IDE/actions/assets.js

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,18 @@ function setAssets(assets, totalSize) {
1111
}
1212

1313
export function getAssets() {
14-
return (dispatch) => {
14+
return async (dispatch) => {
1515
dispatch(startLoader());
16-
apiClient
17-
.get('/S3/objects')
18-
.then((response) => {
19-
dispatch(setAssets(response.data.assets, response.data.totalSize));
20-
dispatch(stopLoader());
21-
})
22-
.catch(() => {
23-
dispatch({
24-
type: ActionTypes.ERROR
25-
});
26-
dispatch(stopLoader());
16+
try {
17+
const response = await apiClient.get('/S3/objects');
18+
dispatch(setAssets(response.data.assets, response.data.totalSize));
19+
dispatch(stopLoader());
20+
} catch (error) {
21+
dispatch({
22+
type: ActionTypes.ERROR
2723
});
24+
dispatch(stopLoader());
25+
}
2826
};
2927
}
3028

@@ -36,16 +34,14 @@ export function deleteAsset(assetKey) {
3634
}
3735

3836
export function deleteAssetRequest(assetKey) {
39-
return (dispatch) => {
40-
apiClient
41-
.delete(`/S3/${assetKey}`)
42-
.then((response) => {
43-
dispatch(deleteAsset(assetKey));
44-
})
45-
.catch(() => {
46-
dispatch({
47-
type: ActionTypes.ERROR
48-
});
37+
return async (dispatch) => {
38+
try {
39+
await apiClient.delete(`/S3/${assetKey}`);
40+
dispatch(deleteAsset(assetKey));
41+
} catch (error) {
42+
dispatch({
43+
type: ActionTypes.ERROR
4944
});
45+
}
5046
};
5147
}

client/modules/IDE/components/CollectionList/CollectionListRow.jsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import * as ToastActions from '../../actions/toast';
1111
import dates from '../../../../utils/formatDate';
1212

1313
import DownFilledTriangleIcon from '../../../../images/down-filled-triangle.svg';
14+
import MoreIconSvg from '../../../../images/more.svg';
15+
16+
const formatDateCell = (date, mobile = false) =>
17+
dates.format(date, { showTime: !mobile });
1418

1519
class CollectionListRowBase extends React.Component {
1620
static projectInCollection(project, collection) {
@@ -146,7 +150,11 @@ class CollectionListRowBase extends React.Component {
146150
'CollectionListRow.ToggleCollectionOptionsARIA'
147151
)}
148152
>
149-
<DownFilledTriangleIcon title="Menu" />
153+
{this.props.mobile ? (
154+
<MoreIconSvg focusable="false" aria-hidden="true" />
155+
) : (
156+
<DownFilledTriangleIcon focusable="false" aria-hidden="true" />
157+
)}
150158
</button>
151159
{optionsOpen && (
152160
<ul className="sketch-list__action-dialogue">
@@ -228,16 +236,10 @@ class CollectionListRowBase extends React.Component {
228236
{this.renderCollectionName()}
229237
</span>
230238
</th>
239+
<td>{formatDateCell(collection.createdAt, mobile)}</td>
240+
<td>{formatDateCell(collection.updatedAt, mobile)}</td>
231241
<td>
232-
{mobile && 'Created: '}
233-
{dates.format(collection.createdAt)}
234-
</td>
235-
<td>
236-
{mobile && 'Updated: '}
237-
{dates.format(collection.updatedAt)}
238-
</td>
239-
<td>
240-
{mobile && '# sketches: '}
242+
{mobile && 'sketches: '}
241243
{(collection.items || []).length}
242244
</td>
243245
<td className="sketch-list__dropdown-column">{this.renderActions()}</td>

0 commit comments

Comments
 (0)