Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35421e0

Browse files
committed
fix: table style support expandable
1 parent 0c990df commit 35421e0

File tree

8 files changed

+122
-88
lines changed

8 files changed

+122
-88
lines changed

client/packages/openblocks-design/src/components/Menu.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ const StyledAntdMenu = styled(AntdMenu)`
7878
box-shadow: unset;
7979
}
8080
81-
.ant-menu-item-disabled span {
82-
color: #B8B9BF;
81+
.ant-menu-item-disabled .text {
82+
color: #b8b9bf;
83+
& + span {
84+
opacity: 0.4;
85+
}
8386
}
8487
`;
8588

client/packages/openblocks-design/src/components/form.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ const FormSelect = (props: any) => {
321321
return (
322322
<SelectWrapper>
323323
<CustomSelect
324+
open={props.open}
324325
mode={props.mode}
325326
value={value}
326327
style={{
@@ -352,7 +353,7 @@ const FormSelect = (props: any) => {
352353

353354
export interface FormSelectItemProps<T extends OptionsType>
354355
extends FormItemProps,
355-
Pick<SelectProps, "mode"> {
356+
Pick<SelectProps, "mode" | "open"> {
356357
options: T;
357358
afterChange?: (value: ValueFromOption<T>) => void;
358359
}

client/packages/openblocks/src/comps/comps/buttonComp/buttonCompConstants.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export function getButtonStyle(buttonStyle: ButtonStyleType) {
4040
`;
4141
}
4242

43-
export const Button100 = styled(Button)<{ $buttonStyle: ButtonStyleType }>`
44-
${(props) => getButtonStyle(props.$buttonStyle)}
43+
export const Button100 = styled(Button)<{ $buttonStyle?: ButtonStyleType }>`
44+
${(props) => props.$buttonStyle && getButtonStyle(props.$buttonStyle)}
4545
width: 100%;
4646
display: inline-flex;
4747
justify-content: center;

client/packages/openblocks/src/comps/comps/tableComp/column/simpleColumnTypeComps.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const ButtonComp = (function () {
4040
onClick={props.onClick}
4141
loading={props.loading}
4242
disabled={props.disabled}
43-
$buttonStyle={style}
43+
$buttonStyle={props.buttonType === "primary" ? style : undefined}
4444
>
4545
{/* prevent the button from disappearing */}
4646
{!props.text ? " " : props.text}

client/packages/openblocks/src/comps/comps/tableComp/tableCompView.tsx

Lines changed: 81 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -43,111 +43,114 @@ const getStyle = (style: TableStyleType) => {
4343
return css`
4444
border-color: ${style.border};
4545
border-radius: ${style.radius};
46-
47-
.ant-table > .ant-table-container > .ant-table-content > table {
48-
thead tr th,
49-
tbody tr td {
46+
& > div > div > div > .ant-table > .ant-table-container > .ant-table-content > table {
47+
> thead > tr > th,
48+
> tbody > tr > td {
5049
border-color: ${style.border};
5150
}
5251
53-
.ant-table-thead > tr > th::before {
52+
> .ant-table-thead > tr > th::before {
5453
background-color: ${style.border};
5554
}
56-
}
55+
> .ant-table-thead {
56+
> tr > th {
57+
background-color: ${style.headerBackground};
58+
color: ${style.headerText};
5759
58-
.ant-table-thead {
59-
tr th {
60-
background-color: ${style.headerBackground};
61-
color: ${style.headerText};
62-
63-
&.ant-table-column-has-sorters:hover {
64-
background-color: ${darkenColor(style.headerBackground, 0.05)};
65-
}
60+
&.ant-table-column-has-sorters:hover {
61+
background-color: ${darkenColor(style.headerBackground, 0.05)};
62+
}
6663
67-
.ant-table-column-sorter {
68-
color: ${style.headerText === defaultTheme.textDark ? "#bfbfbf" : style.headerText};
64+
> .ant-table-column-sorters > .ant-table-column-sorter {
65+
color: ${style.headerText === defaultTheme.textDark ? "#bfbfbf" : style.headerText};
66+
}
6967
}
7068
}
71-
}
72-
73-
.ant-table-tbody {
74-
tr:nth-of-type(2n + 1) {
75-
&,
76-
td {
77-
background: ${background};
78-
color: ${style.cellText};
79-
// Column type view and edit color
80-
p,
81-
span.ant-badge-status-text,
82-
input {
69+
> .ant-table-tbody {
70+
> tr:nth-of-type(2n + 1) {
71+
&,
72+
> td {
73+
background: ${background};
8374
color: ${style.cellText};
75+
// Column type view and edit color
76+
> div > div {
77+
&,
78+
> .ant-badge > .ant-badge-status-text,
79+
> div > .markdown-body {
80+
color: ${style.cellText};
81+
}
82+
// dark link|links color
83+
> a, > div > a {
84+
color: ${isDark && "#A6FFFF"};
85+
&:hover {
86+
color: ${isDark && "#2EE6E6"};
87+
}
88+
}
89+
}
8490
}
8591
}
86-
}
8792
88-
tr:nth-of-type(2n) {
89-
&,
90-
td {
91-
background: ${alternateBackground};
92-
color: ${style.cellText};
93-
// Column type view and edit color
94-
p,
95-
span.ant-badge-status-text,
96-
input {
93+
> tr:nth-of-type(2n) {
94+
&,
95+
> td {
96+
background: ${alternateBackground};
9797
color: ${style.cellText};
98+
// Column type view and edit color
99+
> div > div {
100+
&,
101+
> .ant-badge > .ant-badge-status-text,
102+
> div > .markdown-body {
103+
color: ${style.cellText};
104+
}
105+
// dark link|links color
106+
> a, > div > a {
107+
color: ${isDark && "#A6FFFF"};
108+
&:hover {
109+
color: ${isDark && "#2EE6E6"};
110+
}
111+
}
112+
}
98113
}
99114
}
100-
}
101-
102-
// selected row
103-
tr:nth-of-type(2n + 1).ant-table-row-selected {
104-
td {
105-
background: ${selectedRowBackground}, ${background};
106-
}
107115
108-
td.ant-table-cell-row-hover,
109-
&:hover td {
110-
background: ${hoverRowBackground}, ${selectedRowBackground}, ${background};
111-
}
112-
}
116+
// selected row
117+
> tr:nth-of-type(2n + 1).ant-table-row-selected {
118+
> td {
119+
background: ${selectedRowBackground}, ${background};
120+
}
113121
114-
tr:nth-of-type(2n).ant-table-row-selected {
115-
td {
116-
background: ${selectedRowBackground}, ${alternateBackground};
122+
> td.ant-table-cell-row-hover,
123+
&:hover > td {
124+
background: ${hoverRowBackground}, ${selectedRowBackground}, ${background};
125+
}
117126
}
118127
119-
td.ant-table-cell-row-hover,
120-
&:hover td {
121-
background: ${hoverRowBackground}, ${selectedRowBackground}, ${alternateBackground};
122-
}
123-
}
128+
> tr:nth-of-type(2n).ant-table-row-selected {
129+
> td {
130+
background: ${selectedRowBackground}, ${alternateBackground};
131+
}
124132
125-
// hover row
126-
> tr:nth-of-type(2n + 1) > td.ant-table-cell-row-hover {
127-
&,
128-
> div:nth-of-type(2) {
129-
background: ${hoverRowBackground}, ${background};
133+
> td.ant-table-cell-row-hover,
134+
&:hover > td {
135+
background: ${hoverRowBackground}, ${selectedRowBackground}, ${alternateBackground};
136+
}
130137
}
131-
}
132138
133-
> tr:nth-of-type(2n) > td.ant-table-cell-row-hover {
134-
&,
135-
> div:nth-of-type(2) {
136-
background: ${hoverRowBackground}, ${alternateBackground};
139+
// hover row
140+
> tr:nth-of-type(2n + 1) > td.ant-table-cell-row-hover {
141+
&,
142+
> div:nth-of-type(2) {
143+
background: ${hoverRowBackground}, ${background};
144+
}
137145
}
138-
}
139-
140-
// link color
141-
td :not(li) > a {
142-
color: ${isDark && "#A6FFFF"};
143146
144-
&:hover {
145-
color: ${isDark && "#2EE6E6"};
147+
> tr:nth-of-type(2n) > td.ant-table-cell-row-hover {
148+
&,
149+
> div:nth-of-type(2) {
150+
background: ${hoverRowBackground}, ${alternateBackground};
151+
}
146152
}
147-
}
148153
149-
td div:has(a) {
150-
color: ${isDark && "#A6FFFF"};
151154
}
152155
}
153156
`;

client/packages/openblocks/src/i18n/locales/en.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ export const en = {
617617
extraBodyTooltip:
618618
"Key values in Extra body will be appended in body with JSON or Form Data types",
619619
forwardCookies: "Forward cookies",
620-
forwardAllCookies: "Forward all cookie",
620+
forwardAllCookies: "Forward all cookies",
621621
},
622622
smtpQuery: {
623623
attachment: "Attachment",
@@ -1325,6 +1325,7 @@ export const en = {
13251325
lab: "Lab",
13261326
branding: "Branding",
13271327
idSource: "ID Providers",
1328+
premium: "Premium",
13281329
},
13291330
memberSettings: {
13301331
admin: "Admin",

client/packages/openblocks/src/pages/datasource/form/httpDatasourceForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export const HttpDatasourceForm = (props: DatasourceFormProps) => {
155155
<AdvancedSettingFormSectionLabel />
156156
<CertValidationFormItem datasource={props.datasource} />
157157
<FormSelectItem
158+
open={false}
158159
mode={"tags"}
159160
name={"forwardCookies"}
160161
label={trans("httpQuery.forwardCookies")}

client/packages/openblocks/src/pages/setting/settingHome.tsx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { BrandingSetting } from "@openblocks-ee/pages/setting/branding/BrandingS
1717
import { IdSourceHome } from "@openblocks-ee/pages/setting/idSource";
1818
import { selectSystemConfig } from "redux/selectors/configSelectors";
1919
import { enableCustomBrand } from "util/featureFlagUtils";
20+
import FreeLimitTag from "pages/common/freeLimitTag";
2021

2122
enum SettingPageEnum {
2223
Member = "permission",
@@ -44,12 +45,26 @@ export function SettingHome() {
4445
},
4546
{
4647
key: SettingPageEnum.IdSource,
47-
label: trans("settings.idSource"),
48+
label: (
49+
<span>
50+
<span className="text">{trans("settings.idSource")}</span>
51+
{(!currentOrgAdmin(user) || (!isSelfDomain(config) && !isEnterpriseMode(config))) && (
52+
<FreeLimitTag text={trans("settings.premium")} />
53+
)}
54+
</span>
55+
),
4856
disabled: !currentOrgAdmin(user) || (!isSelfDomain(config) && !isEnterpriseMode(config)),
4957
},
5058
{
5159
key: SettingPageEnum.Audit,
52-
label: trans("settings.audit"),
60+
label: (
61+
<span>
62+
<span className="text">{trans("settings.audit")}</span>
63+
{(!showAuditLog(config) || !currentOrgAdmin(user)) && (
64+
<FreeLimitTag text={trans("settings.premium")} />
65+
)}
66+
</span>
67+
),
5368
disabled: !showAuditLog(config) || !currentOrgAdmin(user),
5469
},
5570
{
@@ -58,7 +73,17 @@ export function SettingHome() {
5873
},
5974
{
6075
key: SettingPageEnum.Branding,
61-
label: trans("settings.branding"),
76+
label: (
77+
<span>
78+
<span className="text">{trans("settings.branding")}</span>
79+
{(!isEE() ||
80+
!currentOrgAdmin(user) ||
81+
!enableCustomBrand(config) ||
82+
(!isSelfDomain(config) && !isEnterpriseMode(config))) && (
83+
<FreeLimitTag text={trans("settings.premium")} />
84+
)}
85+
</span>
86+
),
6287
disabled:
6388
!isEE() ||
6489
!currentOrgAdmin(user) ||

0 commit comments

Comments
 (0)