Skip to content

Commit d4a3e51

Browse files
authored
Merge pull request #55 from delegateas/features/home-page
Home Page
2 parents e7e510f + d49a704 commit d4a3e51

84 files changed

Lines changed: 1606 additions & 210 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,15 @@ Afterwards go into the "Website"-folder from VS Code and open the terminal (of t
7878
# Settings in pipeline
7979
The pipeline expects a variable group called `DataModel`. It must have the following variables. The app user only requires the `Environment Maker` security role.
8080

81+
* AdoWikiName: Name of your wiki found under "Overview -> Wiki" in ADO. (will be encoded so dont worry about space)
82+
* AdoWikiPagePath: Path to the introduction page you wish to show in DMV. (will also be encoded so dont worry about spaces)
8183
* AzureClientId: Client id for an Azure App Registration with access to the Dataverse Environment.
8284
* AzureClientSecret: Client Secret for the above. Remember to set its variable type to "Secret"!
8385
* AzureTenantId: Azure Tenant ID (where your App Regustration is placed and resource group will be placed).
8486
* AzureServiceConnectionName: Name of the Azure Resource Manager service connection created from ADO to Azure.
8587
* AzureLocation: Name of the location for the resource group in Azure (e.g. "westeurope" - not the display name which is "West Europe").
8688
* AzureResourceGroupName: Name of the Resource Group in Azure. If this matches an existing group in the location above that will be used for the DMV resources, if not a new resource group will be created.
87-
* DataverseUrl: URL for the Dataverse environment which the data model will be based on (e.g. "https://mySystem-dev.crm4.dynamics.com/".
89+
* DataverseUrl: URL for the Dataverse environment which the data model will be based on (e.g. "https://mySystem-dev.crm4.dynamics.com/").
8890
* DataverseSolutionNames: Comma-seperated list of solutions to based DMV on. Use the logical names (not display names).
8991
* WebsiteName: Used for the url of the web app presenting the data model to the user. The full URL will be in the format "https://wa-{WebsiteName}.azurewebsites.net/" and must be globally unique.
9092
* WebsitePassword: Password used by DMV users to login to the generated site.
@@ -118,11 +120,20 @@ The `azure-pipelines-external.yml` file is a reusable Azure DevOps pipeline temp
118120
- Add a new "Azure Repos Git" pipeline in Azure DevOps and choose the `azure-pipelines-external.yml` file from your repository as the "Existing Azure Pipelines YAML file" to base the pipeline on.
119121
- Adjust the parameters in the YAML file as needed for your environment (usually only if you chose another name for the variable group than "Datamodel").
120122

123+
> [!NOTE]
124+
> YAML file contains two properties you may want to change:
125+
> 1. Name of your ADO wiki repository
126+
> 2. Name of your variable group
127+
121128
4. **Pipeline Execution**
122129
- The first time the pipeline is run you will see a "This pipeline needs permission to access a resource..." click "View" and give it permission to access the variable group you have created.
123130
- The pipeline will clone the public DataModelViewer repository, build the application, and deploy it using the shared templates.
124131
- The pipeline is scheduled to run daily at 03:00 AM by default. You can adjust or remove the schedule as needed. You can of course also run the pipeline ad-hoc if you wish.
125132

133+
5. **Possible Additional Steps**
134+
- The Build Service needs at least READ-access to the repo (check at: Project Settings > Repositories > 'wiki-repo' > Security)
135+
- In the same location also add the pipeline to the "Pipeline permissions" (this will stop any permission prompts on pipeline runs)
136+
126137
## Notes
127138

128139
- The used Azure subscription must have "Microsoft.Web" registered as a "Resource provider" (namespace) otherwise the deploy will fail.

Website/app/about/page.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { AboutView } from '@/components/aboutview/AboutView';
2-
import { TouchProvider } from '@/components/ui/hybridtooltop';
3-
import { Loading } from '@/components/ui/loading';
2+
import { TouchProvider } from '@/components/shared/ui/hybridtooltop';
3+
import { Loading } from '@/components/shared/ui/loading';
4+
import { TooltipProvider } from '@/components/shared/ui/tooltip';
45
import React, { Suspense } from 'react'
56

67
export default function About() {
78
return <Suspense fallback={<Loading />}>
89
<TouchProvider>
9-
<AboutView />
10+
<TooltipProvider>
11+
<AboutView />
12+
</TooltipProvider>
1013
</TouchProvider>
1114
</Suspense>
1215
}

Website/app/api/markdown/route.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { NextResponse } from 'next/server'
2+
import { readFileSync } from "fs";
3+
import { join } from "path";
4+
5+
export async function GET() {
6+
const generatedPath = join(process.cwd(), 'generated', 'Introduction.md');
7+
const stubsPath = join(process.cwd(), 'stubs', 'Introduction.md');
8+
let fileContent;
9+
try {
10+
fileContent = readFileSync(generatedPath, 'utf-8');
11+
} catch (error) {
12+
fileContent = readFileSync(stubsPath, 'utf-8');
13+
console.error('Error reading generated wiki file, falling back to stubs:', error);
14+
}
15+
return NextResponse.json({ fileContent })
16+
}

Website/app/diagram/page.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
"use client";
22

3-
import { TouchProvider } from "@/components/ui/hybridtooltop";
4-
import { Loading } from "@/components/ui/loading";
5-
import DiagramView from "@/components/diagram/DiagramView";
3+
import { TouchProvider } from "@/components/shared/ui/hybridtooltop";
4+
import { Loading } from "@/components/shared/ui/loading";
5+
import DiagramView from "@/components/diagramview/DiagramView";
66
import { Suspense } from "react";
7+
import { TooltipProvider } from "@/components/shared/ui/tooltip";
78

89
export default function Home() {
910
return <Suspense fallback={<Loading />}>
1011
<TouchProvider>
11-
<DiagramView />
12+
<TooltipProvider>
13+
<DiagramView />
14+
</TooltipProvider>
1215
</TouchProvider>
1316
</Suspense>
1417
}

Website/app/login/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

3-
import { Button } from "@/components/ui/button";
4-
import { Input } from "@/components/ui/input";
3+
import { Button } from "@/components/shared/ui/button";
4+
import { Input } from "@/components/shared/ui/input";
55
import { createSession } from "@/lib/session";
66
import { useRouter } from "next/navigation";
77
import { FormEvent, useState, useEffect } from "react";

Website/app/metadata/page.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { DatamodelView } from "@/components/datamodelview/DatamodelView";
2+
import { TouchProvider } from "@/components/shared/ui/hybridtooltop";
3+
import { Loading } from "@/components/shared/ui/loading";
4+
import { TooltipProvider } from "@/components/shared/ui/tooltip";
5+
import { DatamodelDataProvider } from "@/contexts/DatamodelDataContext";
6+
import { Suspense } from "react";
7+
8+
export default function Data() {
9+
return <Suspense fallback={<Loading />}>
10+
<TouchProvider>
11+
<TooltipProvider>
12+
<DatamodelDataProvider>
13+
<DatamodelView />
14+
</DatamodelDataProvider>
15+
</TooltipProvider>
16+
</TouchProvider>
17+
</Suspense>
18+
}

Website/app/page.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { DatamodelView } from "@/components/datamodelview/DatamodelView";
2-
import { TouchProvider } from "@/components/ui/hybridtooltop";
3-
import { Loading } from "@/components/ui/loading";
4-
import { DatamodelDataProvider } from "@/contexts/DatamodelDataContext";
1+
import { HomeView } from "@/components/homeview/HomeView";
2+
import { TouchProvider } from "@/components/shared/ui/hybridtooltop";
3+
import { Loading } from "@/components/shared/ui/loading";
4+
import { TooltipProvider } from "@/components/shared/ui/tooltip";
55
import { Suspense } from "react";
66

7-
export default function Home() {
7+
export default function Data() {
88
return <Suspense fallback={<Loading />}>
99
<TouchProvider>
10-
<DatamodelDataProvider>
11-
<DatamodelView />
12-
</DatamodelDataProvider>
10+
<TooltipProvider>
11+
<HomeView />
12+
</TooltipProvider>
1313
</TouchProvider>
1414
</Suspense>
1515
}

Website/components/aboutview/AboutView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import React, { useEffect, useState } from 'react'
4-
import { AppSidebar } from '../AppSidebar'
4+
import { AppSidebar } from '../shared/AppSidebar'
55
import { useSidebarDispatch } from '@/contexts/SidebarContext'
66
import { TooltipProvider } from '@radix-ui/react-tooltip'
77
import { LastSynched } from '@/generated/Data'
@@ -14,6 +14,7 @@ export const AboutView = ({}: IAboutViewProps) => {
1414

1515
useEffect(() => {
1616
dispatch({ type: 'SET_ELEMENT', payload: <></> })
17+
dispatch({ type: 'SET_SHOW_ELEMENT', payload: false });
1718
fetch('/api/version')
1819
.then((res) => res.json())
1920
.then((data) => setVersion(data.version))

Website/components/datamodelview/Attributes.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
'use client'
22

33
import { EntityType, AttributeType } from "@/lib/Types"
4-
import { TableHeader, TableRow, TableHead, TableBody, TableCell, Table } from "../ui/table"
5-
import { Button } from "../ui/button"
4+
import { TableHeader, TableRow, TableHead, TableBody, TableCell, Table } from "../shared/ui/table"
5+
import { Button } from "../shared/ui/button"
66
import { useState } from "react"
77
import { ArrowUpDown, ArrowUp, ArrowDown, EyeOff, Eye, Search, X } from "lucide-react"
8-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./../ui/select"
9-
import { Input } from "../ui/input"
8+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../shared/ui/select"
9+
import { Input } from "../shared/ui/input"
1010
import { AttributeDetails } from "./entity/AttributeDetails"
11-
import BooleanAttribute from "./../attributes/BooleanAttribute"
12-
import ChoiceAttribute from "./../attributes/ChoiceAttribute"
13-
import DateTimeAttribute from "./../attributes/DateTimeAttribute"
14-
import DecimalAttribute from "./../attributes/DecimalAttribute"
15-
import FileAttribute from "./../attributes/FileAttribute"
16-
import GenericAttribute from "./../attributes/GenericAttribute"
17-
import IntegerAttribute from "./../attributes/IntegerAttribute"
18-
import LookupAttribute from "./../attributes/LookupAttribute"
19-
import StatusAttribute from "./../attributes/StatusAttribute"
20-
import StringAttribute from "./../attributes/StringAttribute"
11+
import BooleanAttribute from "./attributes/BooleanAttribute"
12+
import ChoiceAttribute from "./attributes/ChoiceAttribute"
13+
import DateTimeAttribute from "./attributes/DateTimeAttribute"
14+
import DecimalAttribute from "./attributes/DecimalAttribute"
15+
import FileAttribute from "./attributes/FileAttribute"
16+
import GenericAttribute from "./attributes/GenericAttribute"
17+
import IntegerAttribute from "./attributes/IntegerAttribute"
18+
import LookupAttribute from "./attributes/LookupAttribute"
19+
import StatusAttribute from "./attributes/StatusAttribute"
20+
import StringAttribute from "./attributes/StringAttribute"
2121
import React from "react"
2222
import { highlightMatch } from "../datamodelview/List";
2323

Website/components/datamodelview/DatamodelView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

3-
import { AppSidebar } from "../AppSidebar";
4-
import { TooltipProvider } from "../ui/tooltip";
3+
import { AppSidebar } from "../shared/AppSidebar";
4+
import { TooltipProvider } from "../shared/ui/tooltip";
55
import { useSidebarDispatch } from "@/contexts/SidebarContext";
66
import { SidebarDatamodelView } from "./SidebarDatamodelView";
77
import { DatamodelViewProvider, useDatamodelView, useDatamodelViewDispatch } from "@/contexts/DatamodelViewContext";
@@ -18,6 +18,7 @@ export function DatamodelView() {
1818

1919
useEffect(() => {
2020
dispatch({ type: "SET_ELEMENT", payload: <SidebarDatamodelView /> });
21+
dispatch({ type: 'SET_SHOW_ELEMENT', payload: true });
2122
}, []);
2223

2324
return (

0 commit comments

Comments
 (0)