#474 Add properly scaled minHeight, maxHeight, to webflow sync#568
#474 Add properly scaled minHeight, maxHeight, to webflow sync#568burnhamrobertp wants to merge 4 commits intobeyond-all-reason:mainfrom
Conversation
…bflow sync These properties are already part of the metadata extracted and generated in the maps-cache metadata.json for each map
p2004a
left a comment
There was a problem hiding this comment.
Modifying WebsiteMapInfo is not sufficient, as comment says "internal representation of data used in this script". To sync out to webflow it is converted back and forth with WebflowMapInfo that builds from the webflow_types that you should be able to refresh with the read token you have.
|
My utilization of makefiles has been pretty minimal since college. Running this repo in docker, with everything configured, with a What is the mechanism by which this is supposed to work, because I'm not seeing it. Hrm, just setting |
|
Have you sourced EDIT: forgot how it works, it is sourced automatically by container Line 12 in baddc25 instead of and that's why variables were not available in script Or you didn't rebuild container. EDIT2: probably makes sense to change code to not require |
|
That's probably it, yes. I'm used to .env files that use |
For me I always source them to have them as environment variables, so I always have |
|
If its a net reduction in the code quality to change it, I'm not opposed to using it as you've used it, but perhaps we add a |
|
Locally the web flow types are generating properly, although the dry run for syncing to web flow is missing the new property values, so I've missed something somewhere. Once I get the issue fixed, I'll have it pushed up |
|
@p2004a this is ready for review when you have time |
p2004a
left a comment
There was a problem hiding this comment.
As you upgrade to v3, we can also fix:
| const values = field.validations.options.map((o: any) => o.name); | ||
| case Webflow.FieldType.File: | ||
| case Webflow.FieldType.ExtFileRef: | ||
| // File references are returned as URLs |
There was a problem hiding this comment.
I don't think they are: https://developers.webflow.com/data/reference/field-types-item-values#file
Where did you get it from?
| case 'Option': { | ||
| const values = field.validations.options.map((o: any) => o.name); | ||
| case Webflow.FieldType.File: | ||
| case Webflow.FieldType.ExtFileRef: |
There was a problem hiding this comment.
I cannot find any documentation for ExtFileRef as is the tradition with webflow api continuing to be undocumented mess. I would drop handling it then, and add handling only once we know what is the shape of data.
| propsWrite = { type: field.isRequired ? 'string' : ['string', 'null'], ...desc }; | ||
| break; | ||
| case Webflow.FieldType.Option: { | ||
| const validations = field.validations as any; |
There was a problem hiding this comment.
eh, still bad... webflow/openapi-spec#3 (comment) (just comment, nothing to address here)
| perspectiveShotUrl: string | null; | ||
| moreImagesUrl: string[]; | ||
| mapHeightMin: number; | ||
| mapHeightMax: number; |
There was a problem hiding this comment.
mapHeightMin must be handled also in:
isWebflowMapInfoEqualWebflowMapInfo::constructorWebflowMapInfo::generateFields
| perspectiveShotUrl: (map.perspectiveShot.length > 0 ? `${imagorUrlBase}fit-in/2250x/filters:format(webp):quality(85)/${rowyBucket}/${encodeURI(map.perspectiveShot[0]!.ref)}` : null), | ||
| moreImagesUrl: map.inGameShots.map(i => `${imagorUrlBase}fit-in/2250x/filters:format(webp):quality(85)/${rowyBucket}/${encodeURI(i.ref)}`), | ||
| // Defaults from spring/cont/base/maphelper/maphelper/mapdefaults.lua | ||
| mapHeightMin: meta.minHeight, |
There was a problem hiding this comment.
You've put those properties in output of getDerivedInfo, let's read it from derivedInfo not meta.
| cp .env.example .env | ||
| ``` | ||
|
|
||
| Populate the necessary values in .env |
There was a problem hiding this comment.
Maybe instead
For testing some scripts that push data to external services, setting env variables in
.envmight be also required
to make it clear it's not required for the most common cases.
These properties are already part of the metadata extracted and generated in the maps-cache metadata.json for each map. The values they have seem to use the same scale as mapWidth or mapHeight, and so are scaled accordingly before inclusion in the sync (
value / 64)