Skip to content

Commit 797ec5c

Browse files
committed
adding project file property support
1 parent ea6b7f0 commit 797ec5c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

build/schemas.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ const propertySchema = Joi.object({
117117
"object",
118118
"group",
119119
"link",
120-
"info"
120+
"info",
121+
"projectfile"
121122
)
122123
.required(),
123124

@@ -186,6 +187,12 @@ const propertySchema = Joi.object({
186187
infoCallback: Joi.function().required(),
187188
}),
188189
})
190+
.when("type", {
191+
is: "projectfile",
192+
then: Joi.object({
193+
filter: Joi.string().optional(),
194+
}),
195+
})
189196
.when("type", {
190197
is: Joi.string().valid(
191198
"integer",

config.caw.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ export const properties = [
104104
105105
// for type info only
106106
// infoCallback: function(inst) {},
107+
108+
// for type projectfile only (plugins only, Addon SDK v2, r426+)
109+
// A dropdown list from which any project file in the project can be chosen.
110+
// The property value at runtime is a relative path to fetch the project file from.
111+
// filter: ".txt", // optional: filter list by file extension (e.g., ".txt" to only list .txt files)
107112
},
108113
name: "Property Name",
109114
desc: "Property Description",

template/enums.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ export const PROPERTY_TYPE = {
3939
GROUP: "group",
4040
LINK: "link",
4141
INFO: "info",
42+
PROJECTFILE: "projectfile",
4243
};

0 commit comments

Comments
 (0)