Skip to content

Commit 7949265

Browse files
committed
Merge remote-tracking branch 'origin/sy-3833-1' into sy-3833-2
2 parents bbde3d6 + a8e6872 commit 7949265

14 files changed

Lines changed: 134 additions & 582 deletions

File tree

client/ts/src/schematic/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export class Client {
170170

171171
export const ZERO_LEGEND: Legend = {
172172
visible: true,
173-
position: { x: 50, y: 50 },
173+
position: { x: 50, y: 50, units: { x: "px", y: "px" } },
174174
colors: {},
175175
};
176176

console/src/range/overview/Snapshots.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const SNAPSHOTS: Record<"schematic" | "task", SnapshotService> = {
5050
onClick: async ({ id: { key } }, { client, placeLayout }) => {
5151
if (client == null) throw new DisconnectedError();
5252
const s = await client.schematics.retrieve({ key });
53-
placeLayout(create({ ...s }));
53+
placeLayout(create({ ...s, remoteCreated: true }));
5454
},
5555
onDelete: async ({ id: { key } }, { client }) => {
5656
if (client == null) throw new DisconnectedError();

console/src/schematic/Schematic.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const navigateToLinkedSchematic = async (
8989
placeLayout: Layout.Placer,
9090
): Promise<void> => {
9191
const s = await retrieve(page);
92-
placeLayout(create({ ...s }));
92+
placeLayout(create({ ...s, remoteCreated: true }));
9393
};
9494

9595
type NodeClickHandler = (nodeId: string, dblClick: boolean) => void;
@@ -467,7 +467,7 @@ const useLoadRemote = createLoadRemote<schematic.Schematic>({
467467
useRetrieve: Base.useRetrieveObservable,
468468
targetVersion: ZERO_STATE.version,
469469
useSelectVersion,
470-
actionCreator: (v) => internalCreate({ ...ZERO_STATE, ...v }),
470+
actionCreator: (v) => internalCreate({ ...ZERO_STATE, ...v, remoteCreated: true }),
471471
});
472472

473473
export const Schematic: Layout.Renderer = ({ layoutKey, ...rest }) => {

console/src/schematic/services/link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ import { Schematic } from "@/schematic";
1212

1313
export const handleLink: Link.Handler = async ({ client, key, placeLayout }) => {
1414
const schematic = await client.schematics.retrieve({ key });
15-
placeLayout(Schematic.create({ ...schematic, editable: false }));
15+
placeLayout(Schematic.create({ ...schematic, editable: false, remoteCreated: true }));
1616
};

console/src/schematic/services/ontology.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const loadSchematic = async (
181181
placeLayout: Layout.Placer,
182182
) => {
183183
const schematic = await client.schematics.retrieve({ key });
184-
placeLayout(Schematic.create({ ...schematic, editable: false }));
184+
placeLayout(Schematic.create({ ...schematic, editable: false, remoteCreated: true }));
185185
};
186186

187187
const handleSelect: Ontology.HandleSelect = ({
@@ -214,6 +214,7 @@ const handleMosaicDrop: Ontology.HandleMosaicDrop = ({
214214
...schematic,
215215
location: "mosaic",
216216
tab: { mosaicKey: nodeKey, location },
217+
remoteCreated: true,
217218
}),
218219
);
219220
}, "Failed to load schematic");

console/src/workspace/services/ontology.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const useCreateSchematic = ({
8888
afterSuccess: async ({ data }) => {
8989
const { workspace, ...schematic } = data;
9090
await maybeChangeWorkspace(workspace);
91-
placeLayout(Schematic.create({ ...schematic }));
91+
placeLayout(Schematic.create({ ...schematic, remoteCreated: true }));
9292
},
9393
});
9494
return useCallback(

core/pkg/service/schematic/migrations/migrate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func assertMigrated(fixture string, got schematic.Schematic) {
7474
return
7575
}
7676
expected := MustSucceed(os.ReadFile(p))
77-
Expect(string(pretty)).To(Equal(string(expected)),
77+
Expect(pretty).To(MatchJSON(expected),
7878
"%s drifted from its canonical migrated form — review the diff and rerun with UPDATE_MIGRATED=1 if intentional", fixture)
7979
}
8080

core/pkg/service/schematic/migrations/testdata/v2_gse_condensed.migrated.json

Lines changed: 19 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,12 +1635,7 @@
16351635
"variant": "value"
16361636
},
16371637
"Czhkq14bwKL": {
1638-
"color": [
1639-
171,
1640-
0,
1641-
255,
1642-
1
1643-
],
1638+
"color": [171, 0, 255, 1],
16441639
"label": {
16451640
"align": "center",
16461641
"label": "To Engine",
@@ -1662,12 +1657,7 @@
16621657
"variant": "pipe"
16631658
},
16641659
"DeV37ebNkgE": {
1665-
"backgroundColor": [
1666-
10,
1667-
10,
1668-
10,
1669-
0
1670-
],
1660+
"backgroundColor": [10, 10, 10, 0],
16711661
"borderRadius": 0,
16721662
"color": "#d20000",
16731663
"dimensions": {
@@ -2093,12 +2083,7 @@
20932083
"variant": "solenoidValve"
20942084
},
20952085
"JjPiK1XPeF6": {
2096-
"backgroundColor": [
2097-
10,
2098-
10,
2099-
10,
2100-
0
2101-
],
2086+
"backgroundColor": [10, 10, 10, 0],
21022087
"borderRadius": {
21032088
"x": 50,
21042089
"y": 10
@@ -2310,12 +2295,7 @@
23102295
"variant": "pipe"
23112296
},
23122297
"OABTFTzErmB": {
2313-
"backgroundColor": [
2314-
10,
2315-
10,
2316-
10,
2317-
0
2318-
],
2298+
"backgroundColor": [10, 10, 10, 0],
23192299
"borderRadius": {
23202300
"x": 50,
23212301
"y": 10
@@ -2337,12 +2317,7 @@
23372317
"variant": "tank"
23382318
},
23392319
"OOkLb5RngOz": {
2340-
"color": [
2341-
0,
2342-
121,
2343-
255,
2344-
1
2345-
],
2320+
"color": [0, 121, 255, 1],
23462321
"label": {
23472322
"align": "center",
23482323
"label": "To OX",
@@ -2530,12 +2505,7 @@
25302505
"variant": "orifice"
25312506
},
25322507
"QWGklzcRmcV": {
2533-
"color": [
2534-
210,
2535-
0,
2536-
0,
2537-
1
2538-
],
2508+
"color": [210, 0, 0, 1],
25392509
"label": {
25402510
"align": "center",
25412511
"label": "To FUEL",
@@ -2961,12 +2931,7 @@
29612931
"variant": "staticMixer"
29622932
},
29632933
"UOdnd6Aha36": {
2964-
"color": [
2965-
0,
2966-
152,
2967-
39,
2968-
1
2969-
],
2934+
"color": [0, 152, 39, 1],
29702935
"label": {
29712936
"align": "center",
29722937
"label": "From Press",
@@ -3071,12 +3036,7 @@
30713036
"variant": "value"
30723037
},
30733038
"XajoNRDoFqn": {
3074-
"color": [
3075-
0,
3076-
176,
3077-
255,
3078-
1
3079-
],
3039+
"color": [0, 176, 255, 1],
30803040
"inlineSize": 70,
30813041
"label": {
30823042
"align": "center",
@@ -3187,19 +3147,9 @@
31873147
"variant": "pipe"
31883148
},
31893149
"bvLG286CeYr": {
3190-
"backgroundColor": [
3191-
10,
3192-
10,
3193-
10,
3194-
0
3195-
],
3150+
"backgroundColor": [10, 10, 10, 0],
31963151
"borderRadius": 3,
3197-
"color": [
3198-
210,
3199-
0,
3200-
0,
3201-
1
3202-
],
3152+
"color": [210, 0, 0, 1],
32033153
"dimensions": {
32043154
"height": 38,
32053155
"width": 108
@@ -3263,12 +3213,7 @@
32633213
"variant": "pipe"
32643214
},
32653215
"fNn6627SLuM": {
3266-
"backgroundColor": [
3267-
10,
3268-
10,
3269-
10,
3270-
0
3271-
],
3216+
"backgroundColor": [10, 10, 10, 0],
32723217
"borderRadius": 0,
32733218
"color": "#00b0ff",
32743219
"dimensions": {
@@ -3382,12 +3327,7 @@
33823327
"variant": "solenoidValve"
33833328
},
33843329
"i3O5NYaw7U8": {
3385-
"color": [
3386-
0,
3387-
152,
3388-
39,
3389-
1
3390-
],
3330+
"color": [0, 152, 39, 1],
33913331
"label": {
33923332
"align": "center",
33933333
"label": "From Press",
@@ -3469,12 +3409,7 @@
34693409
"variant": "pipe"
34703410
},
34713411
"kzoCoaFsLXm": {
3472-
"backgroundColor": [
3473-
10,
3474-
10,
3475-
10,
3476-
0
3477-
],
3412+
"backgroundColor": [10, 10, 10, 0],
34783413
"borderRadius": 3,
34793414
"color": "#00b0ff",
34803415
"dimensions": {
@@ -3552,12 +3487,7 @@
35523487
"variant": "pipe"
35533488
},
35543489
"rPpCZ6MD5As": {
3555-
"color": [
3556-
171,
3557-
0,
3558-
255,
3559-
1
3560-
],
3490+
"color": [171, 0, 255, 1],
35613491
"label": {
35623492
"align": "center",
35633493
"label": "To Engine",
@@ -3830,12 +3760,7 @@
38303760
"variant": "pipe"
38313761
},
38323762
"s6dSeA0idmI": {
3833-
"backgroundColor": [
3834-
10,
3835-
10,
3836-
10,
3837-
0
3838-
],
3763+
"backgroundColor": [10, 10, 10, 0],
38393764
"borderRadius": {
38403765
"x": 50,
38413766
"y": 10
@@ -4089,12 +4014,7 @@
40894014
"variant": "value"
40904015
},
40914016
"uD0n1qxXf9L": {
4092-
"backgroundColor": [
4093-
10,
4094-
10,
4095-
10,
4096-
0
4097-
],
4017+
"backgroundColor": [10, 10, 10, 0],
40984018
"borderRadius": {
40994019
"x": 50,
41004020
"y": 10
@@ -4394,12 +4314,7 @@
43944314
"variant": "value"
43954315
},
43964316
"wqAUB77dleH": {
4397-
"backgroundColor": [
4398-
10,
4399-
10,
4400-
10,
4401-
0
4402-
],
4317+
"backgroundColor": [10, 10, 10, 0],
44034318
"borderRadius": {
44044319
"x": 50,
44054320
"y": 10
@@ -4431,12 +4346,7 @@
44314346
"variant": "pipe"
44324347
},
44334348
"zPngCTpi3wa": {
4434-
"backgroundColor": [
4435-
10,
4436-
10,
4437-
10,
4438-
0
4439-
],
4349+
"backgroundColor": [10, 10, 10, 0],
44404350
"borderRadius": 3,
44414351
"color": "#d20000",
44424352
"dimensions": {
@@ -4455,12 +4365,7 @@
44554365
"variant": "box"
44564366
},
44574367
"zv17pHUEYJq": {
4458-
"backgroundColor": [
4459-
10,
4460-
10,
4461-
10,
4462-
0
4463-
],
4368+
"backgroundColor": [10, 10, 10, 0],
44644369
"borderRadius": {
44654370
"x": 50,
44664371
"y": 10

0 commit comments

Comments
 (0)