Skip to content

Commit

Permalink
Merge branch 'release/V1.2.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinsoo1004 committed Nov 10, 2023
2 parents 8f77599 + c90b546 commit b52d5a8
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pcot",
"version": "1.1.0",
"version": "1.2.0",
"private": true,
"homepage": ".",
"dependencies": {
Expand Down
Binary file added src/assets/selectNodeImg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 17 additions & 4 deletions src/components/PsdComparisonModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import * as S from "./style";
import { useGitgraph } from "@hooks/useGitgraph";
import { useParams } from "react-router-dom";
import { usePsd } from "@hooks/usePsd";
import selectNodeImg from "@assets/selectNodeImg.png";

export const API_URL = process.env.REACT_APP_API;

export const PsdComparisonModal = ({
closeModal,
Expand All @@ -23,7 +26,9 @@ export const PsdComparisonModal = ({
const { organization, workspace } = useParams();
const [names, setNames] = useState<string[]>([]);
const [selectedNode1, setSelectedNode1] = useState("");
const [bottomItems, setBottomItems] = useState<string[]>([]);
const [bottomItems, setBottomItems] = useState("");
const [psdImg, setPsdImg] = useState("");
const [beforePsdImg, setBeforePsdImg] = useState(selectNodeImg);

useEffect(() => {
drawNodeTree(organization, workspace).then((res) => {
Expand All @@ -37,6 +42,9 @@ export const PsdComparisonModal = ({
};
extractNames(res.data);
});
setPsdImg(
`${API_URL}/v2/cloud/pull/image/preview/${organization}/${workspace}/${Name}/${psdName}`,
);
}, []);

const onNodeChange = (e: React.ChangeEvent<HTMLSelectElement>, nodeNumber: number) => {
Expand All @@ -50,6 +58,9 @@ export const PsdComparisonModal = ({
console.log(`Node 1: ${selectedNode1}`);
if (!selectedNode1) return;
nodePsdList(organization, workspace, selectedNode1).then((res) => {
setBeforePsdImg(
`${API_URL}/v2/cloud/pull/image/preview/${organization}/${workspace}/${selectedNode1}/${res.data[0].name}`,
);
psdCompare(organization, workspace, selectedNode1, Name, res.data[0].name, psdName).then(
(res) => {
console.log(res.data.layer);
Expand Down Expand Up @@ -94,15 +105,17 @@ export const PsdComparisonModal = ({
</select>
</p>

<S.Img src="https://via.placeholder.com/300" alt="testimg" />
<S.Img src={beforePsdImg} alt="testimg" />
</div>
<S.CenterLogo src={changeBtn} alt="textlogo" />
<div>
<p>{Name}</p>
<S.Img src="https://via.placeholder.com/300" alt="testimg2" />
<S.Img src={psdImg} alt="testimg2" />
</div>
</S.Layout>
<S.BottomLayout>{bottomItems}</S.BottomLayout>
<S.BottomLayout>
{bottomItems ? bottomItems : <div>노드를 선택해주세요</div>}
</S.BottomLayout>
</div>
</PopupModal>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/PsdComparisonModal/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ export const BottomLayout = styled.div`
`;

export const Img = styled.img`
width: 80%;
width: 300px;
height: 300px;
max-width: 300px;
max-height: 300px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
`;

export const CenterLogo = styled.img`
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useNodeInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const API_URL = process.env.REACT_APP_API;
export const useNodeInfo = () => {
const PsdImgGet = async (OrgName: any, WokName: any, psdName: any, psdImg: any) => {
try {
const API = `${API_URL}/v2/cloud/pull/source/${OrgName}/${WokName}/${psdName}/${psdName}/${psdImg}`;
const API = `${API_URL}/v2/cloud/pull/source/${OrgName}/${WokName}/${psdName}/${psdImg}`;
const response = await axios.get(API, {
withCredentials: true,
});
Expand Down
1 change: 0 additions & 1 deletion src/pages/MakeWorkSpace/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ProfileHover } from "@components/ProfileHover";
import React from "react";
import { useCreateWorkSpace } from "@hooks/useCreateWorkSpace";
import { useParams } from "react-router-dom";
Expand Down
6 changes: 4 additions & 2 deletions src/pages/Workspace/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ export const Workspace = () => {
<S.FloatBox>
<OrganizationSideBar name={organization} />
</S.FloatBox>
<Chart />
<GitGraph />
<S.Main>
<Chart />
<GitGraph />
</S.Main>
</Wrapper>
</div>
);
Expand Down
6 changes: 6 additions & 0 deletions src/pages/Workspace/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ import styled from "styled-components";

export const FloatBox = styled.div`
float: left;
position: fixed;
z-index: 2;
`;

export const Main = styled.div`
padding-left: 250px;
`;

0 comments on commit b52d5a8

Please sign in to comment.