Skip to content

Commit

Permalink
Fix rendering type casting
Browse files Browse the repository at this point in the history
  • Loading branch information
electrikmilk committed Nov 26, 2023
1 parent 31f6a84 commit 7e7f051
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
30 changes: 15 additions & 15 deletions src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,26 +257,26 @@ export function renderParameters(actionData: ActionDefinition | null, parameters
return li;
}

const contentItemTypes = {
"WFAppStoreAppContentItem": "App store apps",
"WFArticleContentItem": "Articles",
"WFContactContentItem": "Contacts",
"WFDateContentItem": "Dates",
"WFEmailAddressContentItem": "Email addresses",
export const contentItemTypes = {
"WFAppStoreAppContentItem": "App store app",
"WFArticleContentItem": "Article",
"WFContactContentItem": "Contact",
"WFDateContentItem": "Date",
"WFEmailAddressContentItem": "Email address",
"WFFolderContentItem": "Folder",
"WFGenericFileContentItem": "Files",
"WFImageContentItem": "Images",
"WFiTunesProductContentItem": "iTunes Products",
"WFLocationContentItem": "Locations",
"WFDCMapsLinkContentItem": "Map links",
"WFGenericFileContentItem": "File",
"WFImageContentItem": "Image",
"WFiTunesProductContentItem": "iTunes Product",
"WFLocationContentItem": "Location",
"WFDCMapsLinkContentItem": "Map link",
"WFAVAssetContentItem": "Media",
"WFPDFContentItem": "PDFs",
"WFPhoneNumberContentItem": "Phone numbers",
"WFPDFContentItem": "PDF",
"WFPhoneNumberContentItem": "Phone number",
"WFRichTextContentItem": "Rich Text",
"WFSafariWebPageContentItem": "Safari web pages",
"WFSafariWebPageContentItem": "Safari web page",
"WFStringContentItem": "Text",
"WFNumberContentItem": "Number",
"WFURLContentItem": "URLs",
"WFURLContentItem": "URL",
};

const workflowTypes = {
Expand Down
5 changes: 4 additions & 1 deletion src/value.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {contentItemTypes} from "~/render";

export function renderValue(value?: any, placeholder: string = 'Value'): HTMLElement {
const container = document.createElement('div');
if (value || typeof value === 'boolean' || value === 0) {
Expand Down Expand Up @@ -59,7 +61,8 @@ function renderObjectValue(container: HTMLElement, value?: any) {
const aggrandizements = variable.Aggrandizements[0];
switch (aggrandizements.Type) {
case 'WFCoercionVariableAggrandizement':
varTypeName += `as ${aggrandizements.CoercionItemClass}`;
// @ts-ignore
varTypeName += ` (${contentItemTypes[aggrandizements.CoercionItemClass]})`;
break;
}
}
Expand Down

0 comments on commit 7e7f051

Please sign in to comment.