Skip to content

Commit

Permalink
Merge pull request #38 from secretflow/release/v0.12.0
Browse files Browse the repository at this point in the history
repo-sync-2024-12-19
  • Loading branch information
yinrouni authored Dec 19, 2024
2 parents 9fb2e87 + a09c0fa commit 1793569
Show file tree
Hide file tree
Showing 66 changed files with 3,882 additions and 141 deletions.
1 change: 1 addition & 0 deletions apps/platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"query-string": "^6.14.1",
"react-csv": "^2.2.2",
"react-syntax-highlighter": "^15.5.0",
"sql-formatter": "^15.4.2",
"umi": "^4.0.64",
"uuid": "^10.0.0",
"valtio": "^1.10.7"
Expand Down
7 changes: 7 additions & 0 deletions apps/platform/src/assets/format.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions apps/platform/src/assets/left-panel-spread.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ export const codeNameRenderKey = {
'preprocessing/psi': 'UNION_KEY_SELECT',
'preprocessing/sqlite': 'SQL',
'data_filter/sample': 'SAMPLE',
'ml.predict/read_model': 'MODEL_SELECT', // TODO:修改名称
'ml.predict/read_model': 'MODEL_SELECT',
'stats/scql_analysis': 'SQL_ANALYSIS',
'data_prep/unbalance_psi': 'UNBALANCE_PSI',
'data_prep/unbalance_psi_cache': 'UNBALANCE_PSI_CACHE',
'data_prep/psi_tp': 'UNION_KEY_SELECT',
'preprocessing/sql_processor': 'SQL_PROCESSOR',
};

export interface ComponentConfig {
Expand Down Expand Up @@ -141,7 +146,36 @@ export const getUpstreamKey = {
return attrs[0]?.s;
});
},

'data_prep/psi_tp': (
upstreamNodes: GraphNodeDetail[],
graphNode?: GraphNodeDetail,
) => {
const { inputs = [] } = graphNode || {};
return upstreamNodes.map((n, index) => {
const { codeName, nodeDef } = n || {};
if (!['read_data/datatable'].includes(codeName)) {
return inputs[index];
}
const { attrs } = nodeDef;
if (!attrs) return inputs[index];
return attrs[0]?.s;
});
},
'data_prep/unbalance_psi': (
upstreamNodes: GraphNodeDetail[],
graphNode?: GraphNodeDetail,
) => {
const { inputs = [] } = graphNode || {};
return upstreamNodes.map((n, index) => {
const { codeName, nodeDef } = n || {};
if (!['read_data/datatable'].includes(codeName)) {
return inputs[index];
}
const { attrs } = nodeDef;
if (!attrs) return inputs[index];
return attrs[0]?.s;
});
},
'preprocessing/psi': (
upstreamNodes: GraphNodeDetail[],
graphNode?: GraphNodeDetail,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ export const ConfigFormComponent: React.FC<IConfigFormComponent> = (prop) => {
attrConfig={attrConfig}
translation={translation}
disabled={!isEditable}
onSaveConfig={onFormFinished}
/>
);
})}
Expand Down Expand Up @@ -553,6 +554,7 @@ export const ConfigFormComponent: React.FC<IConfigFormComponent> = (prop) => {
translation={translation}
disabled={!isEditable}
attrConfig={attrConfig}
onSaveConfig={onFormFinished}
/>
);
})}
Expand Down Expand Up @@ -585,6 +587,7 @@ export const ConfigurationNodeRender = ({
disabled = false,
componentConfig,
attrConfig,
onSaveConfig,
}: {
form: FormInstance;
config: ConfigItem;
Expand All @@ -596,6 +599,7 @@ export const ConfigurationNodeRender = ({
style?: Record<any, any>;
componentConfig: ConfigItem[];
attrConfig?: AttrConfig;
onSaveConfig?: (val: Record<string, ValueOf<Attribute> | undefined>) => void;
}) => {
const configRenderRegistry = useModel(ConfigRenderRegistry);
const Render = configRenderRegistry.getRender(config, exif);
Expand Down Expand Up @@ -623,6 +627,7 @@ export const ConfigurationNodeRender = ({
translation={translation}
disabled={disabled}
attrConfig={attrConfig}
onSaveConfig={onSaveConfig}
/>
</div>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import { CaseWhenRender } from './custom-render/case-when-render';
import { GroupByRender } from './custom-render/groupby-render';
import { LinearModelParametersModificationRender } from './custom-render/linear-model-parameters-modification';
import ObservationsQuantilesRender from './custom-render/observations-quantiles-render';
import { AnalyzeSQLEditor } from './custom-render/scql-editor/scql-editor-content';
import { UpstreamOutputFeatureRender } from './custom-render/upstream-feature-render';
import { DefaultColSelection } from './default-col-selection-template';
import { DefaultMultiTableFeatureSelection } from './default-feature-selection/default-feature-selection';
import { DefaultJoinNodeSelect } from './default-join-node-selection-template';
import { DefaultModelSelect } from './default-model-selection-template';
import { DefaultNodeSelect } from './default-node-selection-template';
import {
Expand All @@ -22,6 +25,9 @@ import {
} from './default-render-template';
import { DefaultSQLEditor } from './default-sql-editor';
import { DefaultTableSelect } from './default-table-selection-temple';
import { nodePartiesByUpstreamOutputSelect } from './node-parties-by-upstream-output';
import { UnbalancePsiColSelect } from './unbalance-psi-custom/query-col-selection';
import { UnbalancePsiCustomSelect } from './unbalance-psi-custom/result-receive-select';

export class DefaultConfigRender implements ConfigRenderProtocol {
registerConfigRenders() {
Expand Down Expand Up @@ -54,6 +60,14 @@ export class DefaultConfigRender implements ConfigRenderProtocol {
: false,
component: LinearModelParametersModificationRender,
},
{
canHandle: (node: CustomConfigNode) =>
node.type === 'AT_CUSTOM_PROTOBUF' &&
node.custom_protobuf_cls === 'feature_column_config_pb2.FeatureColumnConfig'
? 1
: false,
component: UpstreamOutputFeatureRender,
},
{
canHandle: (node: CustomConfigNode) =>
node.type === 'AT_CUSTOM_PROTOBUF' &&
Expand All @@ -79,6 +93,24 @@ export class DefaultConfigRender implements ConfigRenderProtocol {
: false,
component: GroupByRender,
},
{
canHandle: (node: AtomicConfigNode, renderKey?: string) =>
node.type === 'AT_STRING' &&
node.name === 'script_input' &&
renderKey === 'SQL_ANALYSIS'
? 1
: false,
component: AnalyzeSQLEditor,
},
{
canHandle: (node: AtomicConfigNode, renderKey?: string) =>
node.type === 'AT_PARTY' &&
node.name === 'task_initiator' &&
renderKey === 'SQL_ANALYSIS'
? 1
: false,
component: nodePartiesByUpstreamOutputSelect,
},
{
canHandle: (node: AtomicConfigNode, renderKey?: string) => {
return renderKey === 'UNION_KEY_SELECT' && node.type === 'AT_SF_TABLE_COL'
Expand All @@ -87,6 +119,31 @@ export class DefaultConfigRender implements ConfigRenderProtocol {
},
component: DefaultColSelection,
},
{
canHandle: (node: AtomicConfigNode, renderKey?: string) => {
// 非平衡 PSI 求交键
return renderKey === 'UNBALANCE_PSI' && node.type === 'AT_SF_TABLE_COL'
? 1
: false;
},
component: UnbalancePsiColSelect,
},
{
canHandle: (node: AtomicConfigNode, renderKey?: string) => {
// 非平衡 PSI 结果接收方
return renderKey === 'UNBALANCE_PSI' && node.type === 'AT_PARTY' ? 1 : false;
},
component: UnbalancePsiCustomSelect,
},
{
canHandle: (node: AtomicConfigNode, renderKey?: string) => {
// 非平衡 PSI 密文缓存
return node.type === 'AT_PARTY' && renderKey === 'UNBALANCE_PSI_CACHE'
? 1
: false;
},
component: DefaultJoinNodeSelect,
},
{
canHandle: (node: AtomicConfigNode) => {
return node.name === 'receiver' ? 3 : false;
Expand Down Expand Up @@ -116,6 +173,15 @@ export class DefaultConfigRender implements ConfigRenderProtocol {
node.type === 'AT_SF_TABLE_COL' ? 1 : false,
component: DefaultMultiTableFeatureSelection,
},
{
canHandle: (node: AtomicConfigNode, renderKey?: string) =>
node.type === 'AT_STRING' &&
node.name === 'sql' &&
renderKey === 'SQL_PROCESSOR'
? 1
: false,
component: DefaultSQLEditor,
},
{
canHandle: (node: AtomicConfigNode, renderKey?: string) =>
node.type === 'AT_STRING' && node.name === 'sql' && renderKey === 'SQL'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export type RenderProp<T> = {
index: number;
upstreamTables?: [string, string];
attrConfig?: AttrConfig;
onSaveConfig?: (val: Record<string, ValueOf<Attribute> | undefined>) => void;
};

export type ConfigRender<T = any> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const BinningResultDrawer = () => {
closable
destroyOnClose
open={isVisible}
bodyStyle={{ padding: '16px 16px 0 16px' }}
styles={{
body: {
padding: '16px 16px 0 16px',
},
}}
onClose={() => {
setCurrOperation(undefined);
setVisible(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const ModificationResultDrawer = () => {
closable
destroyOnClose
open={isVisible}
bodyStyle={{ padding: '16px 16px 0 16px' }}
styles={{
body: {
padding: '16px 16px 0 16px',
},
}}
onClose={() => {
setVisible(false);
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.toolbar {
display: flex;
height: 36px;
align-items: center;
justify-content: space-between;
background: rgb(0 0 0 / 2%);
}

.isNotFullScreenBtnClick {
position: absolute;
top: -28px;
right: 0;
}

.toolButton {
color: rgb(0 0 0 / 65%);
font-size: 12px;

&:hover {
color: rgb(0 0 0 / 65%) !important;
}
}

.editor {
background-color: #fff;

.title {
display: flex;
height: 56px;
align-items: center;
justify-content: space-between;
margin: 0 24px;

.titleInput {
color: #1d2129;
font-size: 20px;
font-weight: 500;
}
}

.content {
display: flex;

.fullscreenWorkspace {
width: calc(100vw - 275px);
padding-left: 12px;
background: rgb(0 0 0 / 2%);
}

.normalWorkspace {
width: 100%;
}

.rightConfig {
width: 280px;
border-top: 1px solid rgb(0 0 0 / 6%);
border-left: 1px solid rgb(0 0 0 / 6%);
background: #fff;

.titleText {
padding: 16px 12px;
color: rgb(0 0 0 / 88%);
font-size: 14px;
font-weight: 500;
line-height: 20px;
}
}
}

.code {
height: 320px;
}

.fullscreenCode {
height: calc(100vh - 140px);
}
}

.footer {
padding: 12px 20px 8px;
background: #fff;
box-shadow: inset 0 1px 0 0 rgb(0 0 0 / 6%);
}
Loading

0 comments on commit 1793569

Please sign in to comment.