Skip to content

Commit

Permalink
Add get type action
Browse files Browse the repository at this point in the history
  • Loading branch information
electrikmilk committed Apr 27, 2024
1 parent 3a9fdb7 commit b6f259e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import GetDictionaryValue from "~/actions/get-dictionary-value";
import setDictionaryValue from "~/actions/set-dictionary-value";
import GetIpAddress from "~/actions/get-ip-address";
import GetFileFromFolder from "~/actions/get-file-from-folder";
import GetType from "~/actions/get-type";

interface ActionDefinitions {
[key: string]: ActionDefinition
Expand Down Expand Up @@ -87,6 +88,7 @@ export let actions: ActionDefinitions = {
'setvalueforkey': setDictionaryValue,
'getipaddress': GetIpAddress,
'documentpicker.open': GetFileFromFolder,
'getitemtype': GetType,
};

export function actionText(value: string): HTMLElement {
Expand Down
20 changes: 20 additions & 0 deletions src/actions/get-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {renderActionHeader} from "~/render";
import {actions} from "~/actions";
import {renderValue} from "~/value";

interface GetTypeParameters {
WFInput: string,
WFName: string,
WFDontIncludeFileExtension: boolean,
}

export default {
title: "Get type of",
icon: "question_diamond_fill",
background: '#8e8e93',
render: (container: HTMLElement, params: GetTypeParameters) => {
return renderActionHeader(actions['getitemtype'],
renderValue(params['WFInput'], 'Input'),
);
}
}

0 comments on commit b6f259e

Please sign in to comment.