Skip to content

Commit

Permalink
feat(platform): ap assemble: autograpde: now update selected elements…
Browse files Browse the repository at this point in the history
… from market
  • Loading branch information
yyc-git committed Nov 19, 2023
1 parent 0ad992a commit a1d018f
Show file tree
Hide file tree
Showing 22 changed files with 229 additions and 43 deletions.
2 changes: 2 additions & 0 deletions doc/0.21.0.org
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,8 @@ TODO fix: import app->ShowPublishedElement should show selected elements

TODO autograpde: update selected element assemble data

# TODO dispatch user center store

TODO bdd test


Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Start(1700360710092)
#Done(1700360710140)
#Start(1700364958409)
#Done(1700364958454)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ninja log v6
0 17 1700360710107553169 src/service/ServiceType.ast 785165cefc5839bb
1 18 1700360710107539152 Meta3dEditorWholeProtocol.cmi 27dde7c45547adb8
17 30 1700360710122237659 src/service/ServiceType.d 702d225c4edca7ca
30 48 1700360710139632592 src/service/ServiceType-Meta3dEditorWholeProtocol.cmj 648eee0b81178efe
30 48 1700360710139632592 src/service/ServiceType-Meta3dEditorWholeProtocol.cmi 648eee0b81178efe
30 48 1700360710139632592 ../es6_global/src/service/ServiceType.bs.js 648eee0b81178efe
30 48 1700360710139632592 ../js/src/service/ServiceType.bs.js 648eee0b81178efe
1 20 1700364958428339410 src/service/ServiceType.ast 785165cefc5839bb
1 21 1700364958428787517 Meta3dEditorWholeProtocol.cmi 27dde7c45547adb8
20 28 1700364958436844086 src/service/ServiceType.d 702d225c4edca7ca
28 45 1700364958453348179 src/service/ServiceType-Meta3dEditorWholeProtocol.cmj 746c19804f8d3230
28 45 1700364958453348179 src/service/ServiceType-Meta3dEditorWholeProtocol.cmi 746c19804f8d3230
28 45 1700364958453348179 ../es6_global/src/service/ServiceType.bs.js 746c19804f8d3230
28 45 1700364958453348179 ../js/src/service/ServiceType.bs.js 746c19804f8d3230
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module Method = {
}

@react.component
let make = (~service: service) => {
let make = (~service: service, ~selectedElementsFromMarket) => {
let dispatch = FrontendUtils.ReduxUtils.ApAssemble.useDispatch(service.react.useDispatch)

let (
Expand All @@ -39,5 +39,6 @@ let make = (~service: service) => {
storedPackageIdsInApp
selectedExtensions
selectedContributes
selectedElementsFromMarket
/>
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ let make = (
</Collapse>
</Layout.Sider>
<Layout.Content>
<ApDependencyGraph service />
<ApDependencyGraph service selectedElementsFromMarket />
</Layout.Content>
<Layout.Sider theme=#light>
<ExtensionInspector service />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ let make = (~service: service) => {
storedPackageIdsInApp=list{}
selectedExtensions={Method.convertSelectedExtensions(selectedExtensions)}
selectedContributes
selectedElementsFromMarket=list{}
/>
}
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ module Method = {
selectedPackages,
selectedExtensions,
selectedContributes,
selectedElementsFromMarket,
) => {
setOperateInfo(_ => "自动升级版本中...")

Expand Down Expand Up @@ -887,11 +888,36 @@ module Method = {
(selectedPackages, selectedExtensions, selectedContributes)->Js.Promise.resolve
}, _)
}, _)
->Js.Promise.then_(((selectedPackages, selectedExtensions, selectedContributes)) => {
selectedElementsFromMarket
->Meta3dCommonlib.ListSt.traverseReducePromiseM(list{}, (
result,
element: FrontendUtils.BackendCloudbaseType.elementAssembleData,
) => {
service.backend.findNewestPublishElementAssembleData(. element.elementName)
->MostUtils.toPromise
->Js.Promise.then_(
elementAssembleData => {
result->Meta3dCommonlib.ListSt.push(elementAssembleData)->Js.Promise.resolve
},
_,
)
})
->Js.Promise.then_(selectedElements => {
(
selectedPackages,
selectedExtensions,
selectedContributes,
selectedElements,
)->Js.Promise.resolve
}, _)
}, _)
->Js.Promise.then_(
((
selectedPackagesForAppStore,
selectedExtensionsForAppStoreEdit,
selectedContributesForAppStore,
selectedElementsForAppStore,
)) => {
setOperateInfo(_ => "")

Expand All @@ -906,7 +932,7 @@ module Method = {
(startPackageProtocolName, startExtensionProtocolName),
)

service.app.dispatchUpdateSelectedPackagesAndExtensionsAndContributesAction(.
service.app.dispatchUpdateSelectedPackagesAndExtensionsAndContributesAndElementsAction(.
dispatchForAppStore,
dispatchForApAssembleStore,
dispatchForPackageAssembleStore,
Expand All @@ -916,6 +942,7 @@ module Method = {
extensionData
),
selectedContributesForAppStore,
selectedElementsForAppStore,
),
(
selectedPackagesForApAssembleStore,
Expand Down Expand Up @@ -984,6 +1011,7 @@ module Method = {
let buildOperateInfoDefault = () => ""
}

// TODO refactor: split for ap assemble and package assemble
@react.component
let make = (
~service: service,
Expand All @@ -992,6 +1020,7 @@ let make = (
~storedPackageIdsInApp,
~selectedExtensions,
~selectedContributes,
~selectedElementsFromMarket,
) => {
let dispatchForAppStore = service.app.useDispatch()
let dispatchForApAssembleStore = FrontendUtils.ReduxUtils.ApAssemble.useDispatch(
Expand Down Expand Up @@ -1054,6 +1083,7 @@ let make = (
selectedPackages,
selectedExtensions,
selectedContributes,
selectedElementsFromMarket,
)->ignore
}, 5->Some)
}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ Feature: DependencyGraph

Rule: auto upgrade

Scenario: auto upgrade selected packages, extensions, contributes
Scenario: auto upgrade selected packages, extensions, contributes, elements
Given prepare backend
And select extension e1 which is start
And select contribute c1
And select package p1
And select element element1
When auto upgrade
Then should update the newest ones to app store, ap assemble store, package assemble store

Expand Down
Loading

0 comments on commit a1d018f

Please sign in to comment.