-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* add modal slice * create open modal component * refactoring * add tests * fix comments * fix comments * fix comments * update dependencies
- Loading branch information
1 parent
01f07f8
commit d1a5b90
Showing
39 changed files
with
1,680 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/ketcher-polymer-editor-react/src/assets/icons/files/arrow-upward.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
packages/ketcher-polymer-editor-react/src/assets/icons/files/capital-t.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions
7
packages/ketcher-polymer-editor-react/src/assets/icons/files/file-thumbnail.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...tcher-polymer-editor-react/src/components/modal/Open/AnalyzingFile/AnalyzingFile.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/**************************************************************************** | ||
* Copyright 2021 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
***************************************************************************/ | ||
import { AnalyzingFile } from './AnalyzingFile' | ||
import { render, screen } from 'test-utils' | ||
|
||
const mockFileName = 'MockFileName' | ||
|
||
describe('AnalyzingFile component', () => { | ||
it('should render correctly', () => { | ||
expect(render(<AnalyzingFile />)).toMatchSnapshot() | ||
}) | ||
|
||
it('should render correctly with passed filename prop', () => { | ||
render(<AnalyzingFile fileName={mockFileName} />) | ||
|
||
expect(screen.getByText(mockFileName)).toBeInTheDocument() | ||
expect(screen.getByRole('img')).toBeInTheDocument() | ||
}) | ||
}) |
64 changes: 64 additions & 0 deletions
64
...es/ketcher-polymer-editor-react/src/components/modal/Open/AnalyzingFile/AnalyzingFile.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/**************************************************************************** | ||
* Copyright 2021 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
***************************************************************************/ | ||
import { Icon } from 'components/shared/icon' | ||
import { LoadingCircles } from './LoadingCircles' | ||
import styled from '@emotion/styled' | ||
|
||
export type AnalyzingFileProps = { | ||
fileName?: string | ||
} | ||
|
||
const ICON_NAME = 'file-thumbnail' | ||
|
||
const RootContainer = styled.div` | ||
width: 410px; | ||
min-height: 23em; | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
` | ||
|
||
const FileBox = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
svg { | ||
margin-right: 13px; | ||
} | ||
p { | ||
color: #585858; | ||
font-size: 16px; | ||
line-height: 19px; | ||
} | ||
` | ||
|
||
export const AnalyzingFile = ({ fileName }: AnalyzingFileProps) => { | ||
return ( | ||
<RootContainer> | ||
{fileName && ( | ||
<FileBox> | ||
<Icon name={ICON_NAME} /> | ||
<p>{fileName}</p> | ||
</FileBox> | ||
)} | ||
<LoadingCircles /> | ||
</RootContainer> | ||
) | ||
} |
23 changes: 23 additions & 0 deletions
23
...itor-react/src/components/modal/Open/AnalyzingFile/LoadingCircles/LoadingCircles.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/**************************************************************************** | ||
* Copyright 2021 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
***************************************************************************/ | ||
import { LoadingCircles } from './LoadingCircles' | ||
import { render } from 'test-utils' | ||
|
||
describe('LoadingCircles component', () => { | ||
it('should render correctly', () => { | ||
expect(render(<LoadingCircles />)).toMatchSnapshot() | ||
}) | ||
}) |
72 changes: 72 additions & 0 deletions
72
...er-editor-react/src/components/modal/Open/AnalyzingFile/LoadingCircles/LoadingCircles.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/**************************************************************************** | ||
* Copyright 2021 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
***************************************************************************/ | ||
import styled from '@emotion/styled' | ||
|
||
const LoadContainer = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: flex-start; | ||
width: 40px; | ||
height: 12px; | ||
margin-top: 10px; | ||
& span { | ||
display: inline-block; | ||
width: 8px; | ||
height: 8px; | ||
border: 2px solid ${({ theme }) => theme.ketcher.color.spinner}; | ||
border-radius: 100%; | ||
box-sizing: border-box; | ||
&:nth-of-type(1) { | ||
animation: bounce 1s ease-in-out infinite; | ||
} | ||
&:nth-of-type(2) { | ||
animation: bounce 1s ease-in-out 0.33s infinite; | ||
} | ||
&:nth-of-type(3) { | ||
animation: bounce 1s ease-in-out 0.66s infinite; | ||
} | ||
} | ||
@keyframes bounce { | ||
0%, | ||
75%, | ||
100% { | ||
-webkit-transform: translateY(0); | ||
-ms-transform: translateY(0); | ||
-o-transform: translateY(0); | ||
transform: translateY(0); | ||
} | ||
25% { | ||
-webkit-transform: translateY(-100%); | ||
-ms-transform: translateY(-100%); | ||
-o-transform: translateY(-100%); | ||
transform: translateY(-100%); | ||
} | ||
} | ||
` | ||
export const LoadingCircles = () => ( | ||
<LoadContainer> | ||
<span /> | ||
<span /> | ||
<span /> | ||
</LoadContainer> | ||
) |
78 changes: 78 additions & 0 deletions
78
...onents/modal/Open/AnalyzingFile/LoadingCircles/__snapshots__/LoadingCircles.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`LoadingCircles component should render correctly 1`] = ` | ||
Object { | ||
"asFragment": [Function], | ||
"baseElement": <body> | ||
<div> | ||
<div | ||
class="css-rmxyg7" | ||
> | ||
<span /> | ||
<span /> | ||
<span /> | ||
</div> | ||
</div> | ||
</body>, | ||
"container": <div> | ||
<div | ||
class="css-rmxyg7" | ||
> | ||
<span /> | ||
<span /> | ||
<span /> | ||
</div> | ||
</div>, | ||
"debug": [Function], | ||
"findAllByAltText": [Function], | ||
"findAllByDisplayValue": [Function], | ||
"findAllByLabelText": [Function], | ||
"findAllByPlaceholderText": [Function], | ||
"findAllByRole": [Function], | ||
"findAllByTestId": [Function], | ||
"findAllByText": [Function], | ||
"findAllByTitle": [Function], | ||
"findByAltText": [Function], | ||
"findByDisplayValue": [Function], | ||
"findByLabelText": [Function], | ||
"findByPlaceholderText": [Function], | ||
"findByRole": [Function], | ||
"findByTestId": [Function], | ||
"findByText": [Function], | ||
"findByTitle": [Function], | ||
"getAllByAltText": [Function], | ||
"getAllByDisplayValue": [Function], | ||
"getAllByLabelText": [Function], | ||
"getAllByPlaceholderText": [Function], | ||
"getAllByRole": [Function], | ||
"getAllByTestId": [Function], | ||
"getAllByText": [Function], | ||
"getAllByTitle": [Function], | ||
"getByAltText": [Function], | ||
"getByDisplayValue": [Function], | ||
"getByLabelText": [Function], | ||
"getByPlaceholderText": [Function], | ||
"getByRole": [Function], | ||
"getByTestId": [Function], | ||
"getByText": [Function], | ||
"getByTitle": [Function], | ||
"queryAllByAltText": [Function], | ||
"queryAllByDisplayValue": [Function], | ||
"queryAllByLabelText": [Function], | ||
"queryAllByPlaceholderText": [Function], | ||
"queryAllByRole": [Function], | ||
"queryAllByTestId": [Function], | ||
"queryAllByText": [Function], | ||
"queryAllByTitle": [Function], | ||
"queryByAltText": [Function], | ||
"queryByDisplayValue": [Function], | ||
"queryByLabelText": [Function], | ||
"queryByPlaceholderText": [Function], | ||
"queryByRole": [Function], | ||
"queryByTestId": [Function], | ||
"queryByText": [Function], | ||
"queryByTitle": [Function], | ||
"rerender": [Function], | ||
"unmount": [Function], | ||
} | ||
`; |
16 changes: 16 additions & 0 deletions
16
...cher-polymer-editor-react/src/components/modal/Open/AnalyzingFile/LoadingCircles/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/**************************************************************************** | ||
* Copyright 2021 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
***************************************************************************/ | ||
export * from './LoadingCircles' |
Oops, something went wrong.