Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
bcgov-hl committed Oct 14, 2022
0 parents commit f489440
Show file tree
Hide file tree
Showing 43 changed files with 3,926 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/bin
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
README.md
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
################################################################################
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################

/CCOF.Infrastructure.WebAPI/appsettings.Development.json
/CCOF.Infrastructure.WebAPI/bin/Debug/net6.0
/CCOF.Infrastructure.WebAPI/obj
Binary file added .vs/CCOF/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
980 changes: 980 additions & 0 deletions .vs/CCOF/config/applicationhost.config

Large diffs are not rendered by default.

Binary file added .vs/CCOF/v15/.suo
Binary file not shown.
Binary file added .vs/CCOF/v17/.futdcache.v1
Binary file not shown.
Binary file added .vs/CCOF/v17/.suo
Binary file not shown.
979 changes: 979 additions & 0 deletions .vs/config/applicationhost.config

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/CCOF.Infrastructure.WebAPI/bin/Debug/net6.0/CCOF.Infrastructure.WebAPI.dll",
"args": [],
"cwd": "${workspaceFolder}/CCOF.Infrastructure.WebAPI",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
},
{
"name": "Docker .NET Core Launch",
"type": "docker",
"request": "launch",
"preLaunchTask": "docker-run: debug",
"netCore": {
"appProject": "${workspaceFolder}/CCOF.Infrastructure.WebAPI/CCOF.Infrastructure.WebAPI.csproj"
}
}
]
}
97 changes: 97 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/CCOF.Infrastructure.WebAPI/CCOF.Infrastructure.WebAPI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/CCOF.Infrastructure.WebAPI/CCOF.Infrastructure.WebAPI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/CCOF.Infrastructure.WebAPI/CCOF.Infrastructure.WebAPI.csproj"
],
"problemMatcher": "$msCompile"
},
{
"type": "docker-build",
"label": "docker-build: debug",
"dependsOn": [
"build"
],
"dockerBuild": {
"tag": "ccof:dev",
"target": "base",
"dockerfile": "${workspaceFolder}/CCOF.Infrastructure.WebAPI/Dockerfile",
"context": "${workspaceFolder}",
"pull": true
},
"netCore": {
"appProject": "${workspaceFolder}/CCOF.Infrastructure.WebAPI/CCOF.Infrastructure.WebAPI.csproj"
}
},
{
"type": "docker-build",
"label": "docker-build: release",
"dependsOn": [
"build"
],
"dockerBuild": {
"tag": "ccof:latest",
"dockerfile": "${workspaceFolder}/CCOF.Infrastructure.WebAPI/Dockerfile",
"context": "${workspaceFolder}",
"pull": true
},
"netCore": {
"appProject": "${workspaceFolder}/CCOF.Infrastructure.WebAPI/CCOF.Infrastructure.WebAPI.csproj"
}
},
{
"type": "docker-run",
"label": "docker-run: debug",
"dependsOn": [
"docker-build: debug"
],
"dockerRun": {},
"netCore": {
"appProject": "${workspaceFolder}/CCOF.Infrastructure.WebAPI/CCOF.Infrastructure.WebAPI.csproj",
"enableDebugging": true
}
},
{
"type": "docker-run",
"label": "docker-run: release",
"dependsOn": [
"docker-build: release"
],
"dockerRun": {},
"netCore": {
"appProject": "${workspaceFolder}/CCOF.Infrastructure.WebAPI/CCOF.Infrastructure.WebAPI.csproj"
}
}
]
}
59 changes: 59 additions & 0 deletions CCOF.Application.WebResources/Scripts/Common/ccof_Common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"use strict";

var CCOF = CCOF || {};
CCOF.Common = CCOF.Common || { GLOBAL_FORM_CONTEXT: null };

/**
* This function calls the default lookup query for a field. If the query returns only one result than the field is updated with that value.
* @param {any} formContext Form Context
* @param {any} fieldName Logical Name of the field
* @param {any} entityLogicalName Logical Name of the entity
* @param {any} entityIdField Logical Name of the ID field on the entity (usually the entity name followed by id)
* @param {any} entityDisplayField Logical Name of the display field on the entity (usually name or prefix_name unless changed when entity is created)
* @param {any} filterFetch Optional: filtering FetchXML for the lookup
*/
CCOF.Common.DefaultLookupIfSingle = function (formContext, fieldName, entityLogicalName, entityIdField, entityDisplayField, filterFetch) {

//Get Default View for lookup
var defaultView = formContext.getControl(fieldName).getDefaultView();

//Get Fetch XML for the View
Xrm.WebApi.retrieveRecord("savedquery", defaultView, "?$select=fetchxml").then(
function success(result) {

var fetchXML = result.fetchxml;

if (filterFetch !== null && filterFetch.length > 0) {
filterFetch = filterFetch + "</entity></fetch>";
fetchXML = fetchXML.replace("</entity></fetch>", filterFetch);
}

//Now retrieve records from Fetch
Xrm.WebApi.retrieveMultipleRecords(entityLogicalName, "?fetchXml=" +fetchXML).then(
function success(result) {

if (result.entities.length === 1) {
//only 1 result, so populate dropdown with it
var singleRecord = result.entities[0];
var recordId = singleRecord[entityIdField];
var recordValue = singleRecord[entityDisplayField];

formContext.getAttribute(fieldName).setValue([{ id: recordId, name: recordValue, entityType: entityLogicalName}]);
}
else {
//blank out lookup
formContext.getAttribute(fieldName).setValue(null);
}
},
function (error) {
}

);

},
function (error) {
console.log(error.message);
// handle error conditions
}
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// A webresource for AccountForm only

//Create Namespace Object if its defined
if (typeof (CCOF) === "undefined") {
CCOF = {};
} else {

}

//Formload logic starts here
CCOF.Account.Form = {
onLoad: function (executionContext) {
let formContext = executionContext.getFormContext();
switch (formContext.ui.getFormType()) {
case 0: //undefined
break;
case 1: //Create/QuickCreate

case 2: // update

break;
case 3: //readonly
break;
case 4: //disable
break;
case 6: //bulkedit
break;
}
},

let formContext = executionContext.getFormContext();
const currentdate = new Date();
formContext.getAttribute(destinationColumns).setValue(currentdate);
formContext.data.entity.save();

},
//A function called on save
onSave: function (executionContext) {

}
};
2 changes: 2 additions & 0 deletions CCOF.Application.WebResources/Scripts/Lib/jquery-3.6.0.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// A webresource for AccountRibbon only

//Create Namespace Object if its defined
if (typeof (CCOF) === "undefined") {
CCOF = {};
} else {

}

CCOF.Account.Ribbon = {
// description
anewFunction: function (primaryControl, selectedIds) {
var formContext = primaryControl;

}
}
11 changes: 11 additions & 0 deletions CCOF.Core.DataContext/CCOF.Core.DataContext.projitems
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>7e11d821-093b-4e0c-b139-04348871a472</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>CCOF.Core.DataContext</Import_RootNamespace>
</PropertyGroup>
</Project>
13 changes: 13 additions & 0 deletions CCOF.Core.DataContext/CCOF.Core.DataContext.shproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>7e11d821-093b-4e0c-b139-04348871a472</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="CCOF.Core.DataContext.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
33 changes: 33 additions & 0 deletions CCOF.Infrastructure.WebAPI/CCOF.Infrastructure.WebAPI.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Middlewares\**" />
<Content Remove="Middlewares\**" />
<EmbeddedResource Remove="Middlewares\**" />
<None Remove="Middlewares\**" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Controllers\ActionController.cs" />
<Compile Remove="Controllers\AuthenticationController.cs" />
<Compile Remove="Controllers\ContractFilesController.cs" />
<Compile Remove="Controllers\CustomActionController.cs" />
<Compile Remove="Controllers\MetadataController.cs" />
<Compile Remove="Services\AuthenticationService.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.8" />
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="3.19.8" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.22.0" />
<PackageReference Include="Microsoft.PowerPlatform.Dataverse.Client" Version="1.0.9" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>

</Project>
11 changes: 11 additions & 0 deletions CCOF.Infrastructure.WebAPI/CCOF.Infrastructure.WebAPI.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
<ActiveDebugProfile>CCOF.Infrastructure.WebAPI</ActiveDebugProfile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
Loading

0 comments on commit f489440

Please sign in to comment.