Skip to content

Commit

Permalink
Merge branch 'main' into fix-web/toggle-save-button
Browse files Browse the repository at this point in the history
  • Loading branch information
caichi-t authored Oct 17, 2024
2 parents 67e4b4a + cde9840 commit c53db71
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 40 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: tj-actions/changed-files@v45
with:
files: |
web
web/**
.github/workflows/ci.yml
.github/workflows/ci_web.yml
Expand All @@ -27,7 +27,7 @@ jobs:
uses: tj-actions/changed-files@v45
with:
files: |
server
server/**
.github/workflows/ci.yml
.github/workflows/ci_server.yml
.github/workflows/build_server.yml
Expand All @@ -37,7 +37,7 @@ jobs:
uses: tj-actions/changed-files@v45
with:
files: |
worker
worker/**
.github/workflows/ci.yml
.github/workflows/ci_worker.yml
.github/workflows/build_worker.yml
Expand Down
40 changes: 39 additions & 1 deletion server/e2e/integration_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,45 @@ func TestIntegrationFieldCreateAPI(t *testing.T) {
Expect().
Status(http.StatusBadRequest)

// region bool
// region text
res := e.POST(endpoint, sid1).
WithHeader("authorization", "Bearer "+secret).
WithJSON(map[string]interface{}{
"key": "テスト",
"type": "text",
"multiple": false,
"required": false,
}).
Expect().
Status(http.StatusOK).
JSON().
Object()

res.ContainsKey("id")

res = e.GET("/api/models/{modelId}", mId1).
WithHeader("authorization", "Bearer "+secret).
Expect().
Status(http.StatusOK).
JSON().
Object()

res.HasValue("id", mId1.String()).
HasValue("name", "m1").
HasValue("description", "m1 desc").
HasValue("public", true).
HasValue("key", ikey1.String()).
HasValue("projectId", pid).
HasValue("schemaId", sid1)

res.Value("schema").Object().Value("fields").Array().Length().IsEqual(3)
res.Value("createdAt").NotNull()
res.Value("updatedAt").NotNull()
res.Value("lastModified").NotNull()
// endregion

//region bool
res = e.POST(endpoint, sid1).
WithHeader("authorization", "Bearer "+secret).
WithJSON(map[string]interface{}{
"key": "fKey1",
Expand Down Expand Up @@ -192,6 +229,7 @@ func TestIntegrationFieldCreateAPI(t *testing.T) {
HasValue("projectId", pid).
HasValue("schemaId", sid1)

res.Value("schema").Object().Value("fields").Array().Length().IsEqual(4)
res.Value("createdAt").NotNull()
res.Value("updatedAt").NotNull()
res.Value("lastModified").NotNull()
Expand Down
2 changes: 2 additions & 0 deletions web/src/components/atoms/Icon/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
MenuFoldOutlined,
MenuUnfoldOutlined,
FolderOutlined,
FolderOpenOutlined,
LinkOutlined,
UserAddOutlined,
ClearOutlined,
Expand Down Expand Up @@ -137,6 +138,7 @@ export default {
panelToggleLeft: MenuFoldOutlined,
panelToggleRight: MenuUnfoldOutlined,
folder: FolderOutlined,
folderOpen: FolderOpenOutlined,
dot: Dot,
userAdd: UserAddOutlined,
clear: ClearOutlined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ const UnzipFileList: React.FC<Props> = ({
) : (
treeData && (
<Tree
switcherIcon={<Icon icon="caretDown" />}
switcherIcon={({ expanded }) => (
<SwitcherIcon icon={expanded ? "folderOpen" : "folder"} size={14} />
)}
defaultExpandedKeys={["0-0"]}
selectedKeys={selectedKeys}
onSelect={handleSelect}
treeData={treeData}
multiple={false}
showLine
showLine={{ showLeafIcon: true }}
titleRender={({ title, key, path }) => {
return (
<>
Expand Down Expand Up @@ -144,4 +146,10 @@ const CopyIcon = styled(Icon)`
}
`;

const SwitcherIcon = styled(Icon)`
svg {
transform: none !important;
}
`;

export default UnzipFileList;
7 changes: 6 additions & 1 deletion web/src/components/molecules/Asset/AssetListTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,12 @@ const AssetListTable: React.FC<Props> = ({
onClick={props.onCleanSelected}>
{t("Deselect")}
</Button>
<DownloadButton displayDefaultIcon type="link" selected={props.selectedRows} />
<DownloadButton
displayDefaultIcon
size="small"
type="link"
selected={props.selectedRows}
/>
<Button
type="link"
size="small"
Expand Down
39 changes: 21 additions & 18 deletions web/src/components/molecules/Common/Form/AssetItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,21 @@ const AssetItem: React.FC<Props> = ({
<>
<AssetDetailsWrapper>
<AssetButton enabled={!!asset} disabled={disabled} onClick={handleClick}>
<div>
<Icon icon="folder" size={24} />
<AssetName>{asset?.fileName ?? value}</AssetName>
</div>
<Icon icon="folder" size={24} />
<AssetName>{asset?.fileName ?? value}</AssetName>
</AssetButton>
<Tooltip title={asset?.fileName}>
<Link
to={`/workspace/${workspaceId}/project/${projectId}/asset/${value}`}
target="_blank">
<AssetLinkedName enabled={!!asset} type="link">
{asset?.fileName ?? value + " (removed)"}
{asset ? (
<Link
to={`/workspace/${workspaceId}/project/${projectId}/asset/${value}`}
target="_blank">
<AssetLinkedName type="link">{asset.fileName}</AssetLinkedName>
</Link>
) : (
<AssetLinkedName type="link" disabled>
{`${value} (removed)`}
</AssetLinkedName>
</Link>
)}
</Tooltip>
</AssetDetailsWrapper>
<Space />
Expand All @@ -181,10 +183,8 @@ const AssetItem: React.FC<Props> = ({
</>
) : (
<AssetButton disabled={disabled} onClick={handleClick}>
<div>
<Icon icon="linkSolid" size={14} />
<AssetButtonTitle>{t("Asset")}</AssetButtonTitle>
</div>
<Icon icon="linkSolid" size={14} />
<AssetButtonTitle>{t("Asset")}</AssetButtonTitle>
</AssetButton>
)}
{uploadUrl && setUploadUrl && (
Expand Down Expand Up @@ -225,6 +225,8 @@ const AssetButton = styled(Button)<{ enabled?: boolean }>`
border: 1px dashed;
border-color: ${({ enabled }) => (enabled ? "#d9d9d9" : "#00000040")};
color: ${({ enabled }) => (enabled ? "#000000D9" : "#00000040")};
padding: 0 5px;
flex-flow: column;
`;

const Space = styled.div`
Expand All @@ -247,9 +249,8 @@ const AssetLink = styled(Button)`
}
`;

const AssetLinkedName = styled(Button)<{ enabled?: boolean }>`
color: #1890ff;
color: ${({ enabled }) => (enabled ? "#1890ff" : "#00000040")};
const AssetLinkedName = styled(Button)<{ disabled?: boolean }>`
color: ${({ disabled }) => (disabled ? "#00000040" : "#1890ff")};
margin-left: 12px;
span {
text-align: start;
Expand All @@ -268,8 +269,10 @@ const AssetDetailsWrapper = styled.div`
`;

const AssetName = styled.div`
margin-top: 8px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;

const AssetButtonTitle = styled.div`
Expand Down
8 changes: 3 additions & 5 deletions web/src/components/molecules/Content/Form/SidebarWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,20 @@ const ContentSidebarWrapper: React.FC<Props> = ({ item, onNavigateToRequest }) =

const DataRow = styled.div`
display: flex;
margin: 0 -4px;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 4px 0;
line-height: 22px;
`;

const DataTitle = styled.div`
font-size: 14px;
line-height: 22px;
padding: 4px;
`;

const DataText = styled.div`
color: #00000073;
font-size: 12px;
line-height: 22px;
padding: 4px;
`;

const StyledTag = styled(Tag)`
Expand Down
19 changes: 9 additions & 10 deletions web/src/components/molecules/Schema/FieldModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ const FieldModal: React.FC<Props> = ({
title={
<FieldThumbnail>
<StyledIcon icon={fieldTypes[selectedType].icon} color={fieldTypes[selectedType].color} />
<h3>
<StyledTitle>
{selectedField
? t("Update Field", { field: selectedField.title })
: t("Create Field", { field: t(fieldTypes[selectedType].title) })}
</h3>
</StyledTitle>
</FieldThumbnail>
}
width={572}
Expand Down Expand Up @@ -384,14 +384,6 @@ const OptionTitle = styled.p`
const FieldThumbnail = styled.div`
display: flex;
align-items: center;
h3 {
margin: 0;
margin-left: 12px;
font-weight: 500;
font-size: 16px;
line-height: 24px;
color: #000000d9;
}
`;

const StyledIcon = styled(Icon)`
Expand All @@ -406,6 +398,13 @@ const StyledIcon = styled(Icon)`
}
`;

const StyledTitle = styled.p`
color: #000000d9;
font-size: 16px;
margin: 0 20px 0 12px;
overflow: auto;
`;

const StyledGroupKey = styled.span`
font-size: 12px;
margin-left: 4px;
Expand Down

0 comments on commit c53db71

Please sign in to comment.