Skip to content

Commit

Permalink
fix(gi-site): 修复模版使用SegmentedLayout布局时侧边栏默认填充组件
Browse files Browse the repository at this point in the history
  • Loading branch information
gegenhasi authored and echoOikawa committed Sep 20, 2023
1 parent 3a4d735 commit bbd3f36
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions packages/gi-site/src/services/initial.data/getConfigByEngineId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,36 +107,40 @@ const getConfigByEngineId = (engineId, template) => {
const addComponentId = addComponent.map(item => item.id);
const componentConfig = [...components, ...addComponent];
//@TODO: 之后增加container,统一处理这段逻辑
componentConfig.forEach(item => {
if (item.id === 'GrailLayout') {
item.props.containers = [
{
id: 'GI_CONTAINER_RIGHT',
GI_CONTAINER: ['FilterPanel', ...addComponentId],
},
];
}
if (item.id === 'SegmentedLayout') {
item.props.containers = [
{
id: 'GI_CONTAINER_SIDE',
GI_CONTAINER: [...addComponentId, 'FilterPanel'],
},
];
}
if (item.id === 'UadLayout') {
item.props.containers = [
{
id: 'GI_CONTAINER_TOP',
GI_CONTAINER: isCypher ? ['CypherQuery'] : ['GremlinQuery'],
},
{
id: 'GI_CONTAINER_SIDE',
GI_CONTAINER: ['JSONMode'],
},
];
}
});

if(engineId === 'GI'){
componentConfig.forEach(item => {
if (item.id === 'GrailLayout') {
item.props.containers = [
{
id: 'GI_CONTAINER_RIGHT',
GI_CONTAINER: ['FilterPanel', ...addComponentId],
},
];
}
if (item.id === 'SegmentedLayout') {
item.props.containers = [
{
id: 'GI_CONTAINER_SIDE',
GI_CONTAINER: [...addComponentId, 'FilterPanel'],
},
];
}
if (item.id === 'UadLayout') {
item.props.containers = [
{
id: 'GI_CONTAINER_TOP',
GI_CONTAINER: isCypher ? ['CypherQuery'] : ['GremlinQuery'],
},
{
id: 'GI_CONTAINER_SIDE',
GI_CONTAINER: ['JSONMode'],
},
];
}
});
}


const config = {
nodes,
Expand Down

0 comments on commit bbd3f36

Please sign in to comment.