Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 243 additions & 0 deletions src/Modules/StatCan.OrchardCore.Hackathon/HackathonMigrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public async Task<int> CreateAsync()
CreateUserProfiles();
CreateWidgets();
CreateChallenge();
CreateSkillsInterestForm();

await _recipeMigrator.ExecuteAsync("queries.recipe.json", this);
await _recipeMigrator.ExecuteAsync("roles.recipe.json", this);
Expand Down Expand Up @@ -104,5 +105,247 @@ private void CreateChallenge()
.WithMarkdownBody("2")
);
}

private void CreateSkillsInterestForm()
{
_contentDefinitionManager.AlterTypeDefinition("SkillsInterest", type => type
.DisplayedAs("SkillsInterest")
.Listable()
.Stereotype("Widget")
.WithPart("SkillsInterest", part => part
.WithPosition("0")
)
);

_contentDefinitionManager.AlterPartDefinition("SkillsInterest", part => part
.WithField("Consent", field => field
.OfType("TextField")
.WithDisplayName("Consent")
.WithPosition("0")
)
.WithField("DegreesCompleted", field => field
.OfType("TextField")
.WithDisplayName("DegreesCompleted")
.WithPosition("4")
)
.WithField("PhoneNumber", field => field
.OfType("TextField")
.WithDisplayName("PhoneNumber")
.WithPosition("5")
)
.WithField("GcJobInterest", field => field
.OfType("TextField")
.WithDisplayName("GcJobInterest")
.WithPosition("6")
)
.WithField("JobType", field => field
.OfType("TextField")
.WithDisplayName("JobType")
.WithPosition("7")
)
.WithField("Coop", field => field
.OfType("TextField")
.WithDisplayName("Coop")
.WithPosition("8")
)
.WithField("Fswep", field => field
.OfType("TextField")
.WithDisplayName("Fswep")
.WithPosition("9")
)
.WithField("Location", field => field
.OfType("TextField")
.WithDisplayName("Location")
.WithPosition("10")
)
.WithField("Citizenship", field => field
.OfType("TextField")
.WithDisplayName("Citizenship")
.WithPosition("11")
)
.WithField("CitizenshipStatus", field => field
.OfType("TextField")
.WithDisplayName("CitizenshipStatus")
.WithPosition("12")
)
.WithField("FieldsOfInterest", field => field
.OfType("TextField")
.WithDisplayName("FieldsOfInterest")
.WithPosition("13")
)
.WithField("OtherFieldsOfInterest", field => field
.OfType("TextField")
.WithDisplayName("OtherFieldsOfInterest")
.WithPosition("14")
)
.WithField("OtherInterest", field => field
.OfType("TextField")
.WithDisplayName("OtherInterest")
.WithPosition("15")
)
.WithField("FieldsOfExpertise", field => field
.OfType("TextField")
.WithDisplayName("FieldsOfExpertise")
.WithPosition("16")
)
.WithField("OtherFieldsOfExpertise", field => field
.OfType("TextField")
.WithDisplayName("OtherFieldsOfExpertise")
.WithPosition("17")
)
.WithField("OtherExpertise", field => field
.OfType("TextField")
.WithDisplayName("OtherExpertise")
.WithPosition("18")
)
.WithField("Sql", field => field
.OfType("NumericField")
.WithDisplayName("Sql")
.WithPosition("19")
)
.WithField("Sas", field => field
.OfType("NumericField")
.WithDisplayName("Sas")
.WithPosition("20")
)
.WithField("R", field => field
.OfType("NumericField")
.WithDisplayName("R")
.WithPosition("21")
)
.WithField("Python", field => field
.OfType("NumericField")
.WithDisplayName("Python")
.WithPosition("22")
)
.WithField("Java", field => field
.OfType("NumericField")
.WithDisplayName("Java")
.WithPosition("23")
)
.WithField("Perl", field => field
.OfType("NumericField")
.WithDisplayName("Perl")
.WithPosition("24")
)
.WithField("Scala", field => field
.OfType("NumericField")
.WithDisplayName("Scala")
.WithPosition("25")
)
.WithField("Julia", field => field
.OfType("NumericField")
.WithDisplayName("Julia")
.WithPosition("26")
)
.WithField("Matlab", field => field
.OfType("NumericField")
.WithDisplayName("Matlab")
.WithPosition("27")
)
.WithField("Stata", field => field
.OfType("NumericField")
.WithDisplayName("Stata")
.WithPosition("28")
)
.WithField("PowerBi", field => field
.OfType("NumericField")
.WithDisplayName("PowerBi")
.WithPosition("29")
)
.WithField("Qgis", field => field
.OfType("NumericField")
.WithDisplayName("Qgis")
.WithPosition("30")
)
.WithField("Argis", field => field
.OfType("NumericField")
.WithDisplayName("Arcgis")
.WithPosition("31")
)
.WithField("Grass", field => field
.OfType("NumericField")
.WithDisplayName("Grass")
.WithPosition("32")
)
.WithField("CPlusPlus", field => field
.OfType("NumericField")
.WithDisplayName("CPlusPlus")
.WithPosition("33")
)
.WithField("CSharp", field => field
.OfType("NumericField")
.WithDisplayName("CSharp")
.WithPosition("34")
)
.WithField("Javascript", field => field
.OfType("NumericField")
.WithDisplayName("Javascript")
.WithPosition("35")
)
.WithField("Html", field => field
.OfType("NumericField")
.WithDisplayName("Html")
.WithPosition("36")
)
.WithField("Css", field => field
.OfType("NumericField")
.WithDisplayName("Css")
.WithPosition("37")
)
.WithField("OtherLanguage", field => field
.OfType("TextField")
.WithDisplayName("OtherLanguage")
.WithPosition("38")
)
.WithField("OtherLanguageRating", field => field
.OfType("NumericField")
.WithDisplayName("OtherLanguageRating")
.WithPosition("39")
)
.WithField("PublicProfilesLink", field => field
.OfType("TextField")
.WithDisplayName("PublicProfilesLink")
.WithPosition("40")
)
.WithField("GitHubLink", field => field
.OfType("TextField")
.WithDisplayName("GitHubLink")
.WithPosition("41")
)
.WithField("Experience", field => field
.OfType("TextField")
.WithDisplayName("Experience")
.WithPosition("42")
)
.WithField("Cv", field => field
.OfType("TextField")
.WithDisplayName("Cv")
.WithEditor("TextArea")
.WithPosition("43")
)
.WithField("Language", field => field
.OfType("TextField")
.WithDisplayName("Language")
.WithPosition("3")
)
.WithField("Hired", field => field
.OfType("BooleanField")
.WithDisplayName("Hired")
.WithPosition("1")
)
.WithField("HiredBy", field => field
.OfType("UserPickerField")
.WithDisplayName("HiredBy")
.WithPosition("2")
.WithSettings(new UserPickerFieldSettings
{
DisplayedRoles = new[] { "Volunteer" },
})
)
);

}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"name": "Hackathon.HireButtonForm",
"displayName": "Hire Button",
"description": "Creates a button used to hire students.",
"author": "StatCan Digital Innovation",
"website": "digital.statcan.gc.ca",
"version": "1.0.0",
"issetuprecipe": false,
"categories": [],
"tags": [],
"steps": [
{
"name": "feature"
},
{
"name": "Content",
"data": [
{
"ContentItemId": "46898hhea99ya5z465kd29czwk",
"ContentItemVersionId": "40fcyjebzg0eh08cfv0kqfxjxk",
"ContentType": "VueForm",
"DisplayText": "Hire Button",
"Latest": true,
"Published": true,
"ModifiedUtc": "2022-02-11T15:43:18.270931Z",
"PublishedUtc": "2022-02-11T15:43:18.290062Z",
"CreatedUtc": "2022-02-11T15:00:06.553129Z",
"Owner": "[js: parameters('AdminUserId')]",
"Author": "[js: parameters('AdminUsername')]",
"TitlePart": {
"Title": "Hire Button"
},
"VueForm": {
"Template": {
"Text": "<v-container>\r\n <v-btn type=\"submit\" depressed block @click=\"formHandleSubmit\" :disabled=\"form.submitting\">Hire</v-btn>\r\n</v-container>"
},
"RenderAs": {
"Text": null
},
"Disabled": {
"Value": false
},
"Debug": {
"Value": false
},
"DisabledHtml": {
"Html": ""
},
"SuccessMessage": {
"Text": "You have hired this student."
}
},
"AliasPart": {
"Alias": "hire-button"
},
"VueFormScripts": {
"ClientInit": {
"Text": null
},
"ComponentOptions": {
"Text": "{\r\n data: () => ({\r\n hired: \"\",\r\n\thiredBy: \"\",\r\n })\r\n}"
},
"OnValidation": {
"Text": null
},
"OnSubmitted": {
"Text": "var data = requestFormAsJsonObject();\r\n\r\nvar updateSettingsResult = updateContentItem(\"SkillsInterest\", {\r\n \"SkillsInterest\" : {\r\n \"Hired\": {\r\n \"Text\": data.hired\r\n },\r\n \"HiredBy\": {\r\n \"Text\": data.hiredBy\r\n }\r\n }\r\n});"
}
},
"ContentPermissionsPart": {
"Enabled": true,
"Roles": [
"Volunteer"
]
},
"LocalizedTextPart": {
"Data": []
}
}
]
}
]
}
Loading