Skip to content

Commit

Permalink
Fix: The latest workflow records are not loaded (#776)
Browse files Browse the repository at this point in the history
Signed-off-by: barnettZQG <[email protected]>
  • Loading branch information
barnettZQG authored Apr 16, 2023
1 parent 3cae9e1 commit d3985d1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/velaux-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"./CHANGELOG.md",
"LICENSE_APACHE2"
],
"main": "dist/index.js",
"main": "src/index.ts",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.build.json && rollup -c rollup.config.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/velaux-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"files": [
"dist/**"
],
"main": "dist/types.js",
"main": "src/index.ts",
"types": "dist/types.d.ts",
"publishConfig": {
"main": "dist/types.js",
Expand Down
9 changes: 2 additions & 7 deletions packages/velaux-ui/src/components/UISchema/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ class UISchema extends Component<Props, State> {
});
const formItemLayout = {
labelCol: {
fixedSpan: 5,
fixedSpan: 9,
},
wrapperCol: {
span: 14,
Expand All @@ -986,12 +986,7 @@ class UISchema extends Component<Props, State> {
<Divider />
<If condition={showAdvancedButton}>
<Form {...formItemLayout} style={{ width: '100%' }} fullWidth={true}>
<Form.Item
labelAlign="left"
colon={true}
label={<Translation>Advanced Parameters</Translation>}
labelWidth="200px"
>
<Form.Item labelAlign="left" colon={true} label={<Translation>Advanced Parameters</Translation>}>
<Switch onChange={this.onChangeAdvanced} size="small" checked={advanced} />
</Form.Item>
</Form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@
}
}
}

.footer-actions {
display: flex;
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class ComponentDialog extends React.Component<Props, State> {
const { onComponentClose, isEditComponent, project, componentName, appName } = this.props;
const { isCreateComponentLoading, isUpdateComponentLoading } = this.state;
return (
<div>
<div className="footer-actions">
<Button type="secondary" onClick={onComponentClose} className="margin-right-10">
{i18n.t('Cancel').toString()}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
background: #fff;
border-radius: 8px;
box-shadow: var(--elevation-3);
width: 280px;
&:before {
position: absolute;
top: 32px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class ApplicationWorkflow extends React.Component<Props, State> {
if (env) {
getApplicationEnvRecords({ appName: appName, envName: envName }).then((res: { records: WorkflowRecord[] }) => {
if (res) {
const records = res.records.reverse();
const records = res.records;
this.setState({ records: records || [], showRecordName: '' });
const currentRecord = res.records.find((re) => re.name === record);
if (currentRecord) {
Expand Down Expand Up @@ -194,6 +194,7 @@ class ApplicationWorkflow extends React.Component<Props, State> {
<Select
value={showRecordName}
locale={locale().Select}
autoWidth={false}
placeholder={i18n.t('Switch the workflow record')}
onChange={(selectRecord: string) => {
this.setState({ showRecordName: selectRecord }, () => {
Expand Down
3 changes: 1 addition & 2 deletions pkg/server/domain/service/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,8 @@ func (w *workflowServiceImpl) ListWorkflowRecordsFromEnv(ctx context.Context, ap
}

filterOptions := datastore.FilterOptions{In: []datastore.InQueryOption{{Key: "workflowName", Values: wfNames}}}

records, err := w.Store.List(ctx, &record, &datastore.ListOptions{Page: page, PageSize: pageSize, SortBy: []datastore.SortOption{
{Key: "createTime", Order: datastore.SortOrderAscending}},
{Key: "createTime", Order: datastore.SortOrderDescending}},
FilterOptions: filterOptions,
})
if err != nil {
Expand Down

0 comments on commit d3985d1

Please sign in to comment.