Skip to content

Commit 121de6c

Browse files
committed
[Feat]: merge app version
1 parent 3eca6dc commit 121de6c

File tree

14 files changed

+429
-232
lines changed

14 files changed

+429
-232
lines changed

client/packages/lowcoder-design/src/components/Switch.tsx

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,24 @@ const SwitchStyle: any = styled.input`
5252
border-radius: 20px;
5353
background-color: #ffffff;
5454
}
55+
56+
&:disabled {
57+
background-color: #e0e0e0;
58+
opacity: 0.6;
59+
cursor: not-allowed;
60+
}
61+
62+
&:disabled::before {
63+
background-color: #cccccc;
64+
}
65+
66+
&:disabled:checked {
67+
background-color: #a0a0a0;
68+
}
69+
70+
&:disabled:hover {
71+
cursor: not-allowed;
72+
}
5573
`;
5674

5775
const SwitchDiv = styled.div<{
@@ -104,16 +122,18 @@ const JsIconGray = styled(jsIconGray)<Ishow>`
104122
interface SwitchProps extends Omit<React.HTMLAttributes<HTMLInputElement>, "value" | "onChange"> {
105123
value: boolean;
106124
onChange: (value: boolean) => void;
125+
disabled?: boolean;
107126
}
108127

109128
export const Switch = (props: SwitchProps) => {
110-
const { value, onChange, ...inputChanges } = props;
129+
const { value, onChange, disabled, ...inputChanges } = props;
111130
return (
112131
<SwitchStyle
113132
type="checkbox"
114-
checked={props.value}
115-
onClick={() => props.onChange(!props.value)}
133+
checked={value}
134+
onClick={() => onChange(!value)}
116135
onChange={() => {}}
136+
disabled={disabled}
117137
{...inputChanges}
118138
/>
119139
);
@@ -154,15 +174,17 @@ export const SwitchWrapper = (props: {
154174
export function TacoSwitch(props: {
155175
label: string;
156176
checked: boolean;
157-
onChange: (checked: boolean) => void;
177+
disabled?: boolean;
178+
onChange?: (checked: boolean) => void;
158179
}) {
159180
return (
160181
<SwitchWrapper label={props.label}>
161182
<Switch
162183
onChange={(value) => {
163-
props.onChange(value);
184+
props.onChange ? props.onChange(value) : null;
164185
}}
165186
value={props.checked}
187+
disabled={props.disabled}
166188
/>
167189
</SwitchWrapper>
168190
);

client/packages/lowcoder/src/api/applicationApi.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ export interface ApplicationResp extends ApiResponse {
7070
data: ApplicationDetail;
7171
}
7272

73+
export interface ApplicationPublishRequest {
74+
commitMessage?: string;
75+
tag: string;
76+
}
77+
7378
interface GrantAppPermissionReq {
7479
applicationId: string;
7580
role: ApplicationRoleType;
@@ -171,8 +176,13 @@ class ApplicationApi extends Api {
171176
return Api.put(ApplicationApi.updateApplicationURL(applicationId), rest);
172177
}
173178

174-
static publishApplication(request: PublishApplicationPayload): AxiosPromise<ApiResponse> {
175-
return Api.post(ApplicationApi.publishApplicationURL(request.applicationId));
179+
static publishApplication(
180+
request: PublishApplicationPayload
181+
): AxiosPromise<ApiResponse> {
182+
return Api.post(
183+
ApplicationApi.publishApplicationURL(request.applicationId),
184+
request?.request
185+
);
176186
}
177187

178188
static getApplicationDetail(request: FetchAppInfoPayload): AxiosPromise<ApplicationResp> {

0 commit comments

Comments
 (0)