Skip to content

Commit e487cdb

Browse files
authored
Merge pull request #78 from delegateas/patches/121287-final-patches
Last patches from 121287 with processview changes and other minor changes
2 parents 81290d3 + 190929d commit e487cdb

File tree

12 files changed

+480
-423
lines changed

12 files changed

+480
-423
lines changed

Generator/DTO/AttributeUsage.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,20 @@ public record AttributeUsage(
2727
OperationType OperationType,
2828
ComponentType ComponentType,
2929
bool IsFromDependencyAnalysis
30-
);
30+
)
31+
{
32+
public static OperationType MapSdkMessageToOperationType(string sdkMessageName)
33+
{
34+
return sdkMessageName?.ToLowerInvariant() switch
35+
{
36+
"create" => OperationType.Create,
37+
"update" => OperationType.Update,
38+
"delete" => OperationType.Delete,
39+
"retrieve" => OperationType.Read,
40+
"retrievemultiple" => OperationType.List,
41+
"upsert" => OperationType.Update,
42+
"merge" => OperationType.Update,
43+
_ => OperationType.Other
44+
};
45+
}
46+
};

Generator/DTO/SDKStep.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ public record SDKStep(
77
string Name,
88
string FilteringAttributes,
99
string PrimaryObjectTypeCode,
10+
string SdkMessageName,
1011
OptionSetValue State) : Analyzeable();

Generator/Queries/PluginQueries.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ public static async Task<IEnumerable<SDKStep>> GetSDKMessageProcessingStepsAsync
4444
{
4545
Columns = new ColumnSet("primaryobjecttypecode"),
4646
EntityAlias = "filter"
47+
},
48+
new LinkEntity(
49+
"sdkmessageprocessingstep",
50+
"sdkmessage",
51+
"sdkmessageid",
52+
"sdkmessageid",
53+
JoinOperator.Inner)
54+
{
55+
Columns = new ColumnSet("name"),
56+
EntityAlias = "message"
4757
}
4858
//new LinkEntity
4959
//{
@@ -66,17 +76,19 @@ public static async Task<IEnumerable<SDKStep>> GetSDKMessageProcessingStepsAsync
6676
var steps = result.Entities.Select(e =>
6777
{
6878
var sdkMessageId = e.GetAttributeValue<AliasedValue>("step.sdkmessageid")?.Value as EntityReference;
69-
var sdkMessageName = e.GetAttributeValue<AliasedValue>("step.name")?.Value as string;
79+
var sdkStepName = e.GetAttributeValue<AliasedValue>("step.name")?.Value as string;
7080
var sdkFilterAttributes = e.GetAttributeValue<AliasedValue>("step.filteringattributes")?.Value as string;
7181
var sdkState = e.GetAttributeValue<AliasedValue>("step.statecode")?.Value as OptionSetValue;
7282
var filterTypeCode = e.GetAttributeValue<AliasedValue>("filter.primaryobjecttypecode")?.Value as string;
83+
var sdkMessageName = e.GetAttributeValue<AliasedValue>("message.name")?.Value as string;
7384

7485
return new SDKStep(
75-
sdkMessageId.Id.ToString(),
76-
sdkMessageName ?? "Unknown Name",
86+
sdkMessageId?.Id.ToString() ?? "Unknown",
87+
sdkStepName ?? "Unknown Name",
7788
sdkFilterAttributes ?? "",
78-
filterTypeCode,
79-
sdkState
89+
filterTypeCode ?? "Unknown",
90+
sdkMessageName ?? "Unknown",
91+
sdkState ?? new OptionSetValue(0)
8092
);
8193
});
8294

Generator/Services/Plugins/PluginAnalyzer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ public override async Task AnalyzeComponentAsync(SDKStep sdkStep, Dictionary<str
2222
// Retrieve the logical name of the entity from the linked SDK Message entity
2323
var logicalTableName = sdkStep.PrimaryObjectTypeCode;
2424

25+
// Map SDK message name to operation type
26+
var operationType = AttributeUsage.MapSdkMessageToOperationType(sdkStep.SdkMessageName);
27+
2528
// Populate the attributeUsages dictionary
2629
foreach (var attribute in filteringAttributes)
27-
AddAttributeUsage(attributeUsages, logicalTableName, attribute, new AttributeUsage(pluginName, $"Used in filterattributes", OperationType.Other, SupportedType, false));
30+
AddAttributeUsage(attributeUsages, logicalTableName, attribute, new AttributeUsage(pluginName, $"Used in filterattributes", operationType, SupportedType, false));
2831

2932
}
3033
catch (Exception ex)

Website/components/datamodelview/Attributes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const Attributes = ({ entity, search = "", onVisibleCountChange }: IAttri
106106
filteredAttributes = filteredAttributes.filter(attr => attributeMatchesSearch(attr, query))
107107
}
108108

109-
if (hideStandardFields) filteredAttributes = filteredAttributes.filter(attr => attr.IsCustomAttribute || attr.IsStandardFieldModified);
109+
if (hideStandardFields) filteredAttributes = filteredAttributes.filter(attr => (attr.IsCustomAttribute || attr.IsStandardFieldModified) && !attr.SchemaName.endsWith("Base"));
110110

111111
if (!sortColumn || !sortDirection) return filteredAttributes
112112

Website/components/datamodelview/entity/AttributeDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function AttributeDetails({ entityName, attribute, isEntityAuditEnabled }
1212
}
1313

1414
if (attribute.IsPrimaryName) {
15-
details.push({ icon: <BadgeRounded className="h-4 w-4" />, tooltip: "Primary Name" });
15+
details.push({ icon: <BadgeRounded className="h-4 w-4" />, tooltip: "Primary column: Its value is shown in the header of forms for this table, and as the display value of lookup-fields pointing to this table" });
1616
}
1717

1818
switch (attribute.RequiredLevel) {

Website/components/datamodelview/entity/SecurityRoles.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function SecurityRoles({ roles }: { roles: SecurityRole[] }) {
1616

1717
function SecurityRoleRow({ role }: { role: SecurityRole }) {
1818
const theme = useTheme();
19-
19+
2020
return (
2121
<Paper
2222
variant="outlined"
@@ -27,16 +27,16 @@ function SecurityRoleRow({ role }: { role: SecurityRole }) {
2727
justifyContent: 'space-between',
2828
gap: 1,
2929
p: 2,
30-
backgroundColor: theme.palette.mode === 'dark'
31-
? 'rgba(255, 255, 255, 0.02)'
30+
backgroundColor: theme.palette.mode === 'dark'
31+
? 'rgba(255, 255, 255, 0.02)'
3232
: 'rgba(0, 0, 0, 0.02)',
3333
borderColor: 'border.main',
3434
width: '100%',
3535
}}
3636
>
37-
<Typography
38-
variant="subtitle1"
39-
sx={{
37+
<Typography
38+
variant="subtitle1"
39+
sx={{
4040
fontWeight: 700,
4141
wordWrap: 'break-word',
4242
maxWidth: { xs: '100%', sm: '180px', md: '240px' },
@@ -45,12 +45,12 @@ function SecurityRoleRow({ role }: { role: SecurityRole }) {
4545
>
4646
{role.Name}
4747
</Typography>
48-
<Box
49-
sx={{
50-
display: 'flex',
51-
flexWrap: { xs: 'wrap', sm: 'nowrap' },
52-
gap: 1,
53-
alignItems: 'flex-end'
48+
<Box
49+
sx={{
50+
display: 'flex',
51+
flexWrap: { xs: 'wrap', sm: 'nowrap' },
52+
gap: 1,
53+
alignItems: 'flex-end'
5454
}}
5555
>
5656
<PrivilegeIcon privilege="Create" name="Create" depth={role.Create} />
@@ -106,7 +106,7 @@ function GetDepthIcon({ privilege, depth }: { privilege: string, depth: Privileg
106106
const getTooltipText = (priv: string, d: PrivilegeDepth): string => {
107107
const depthDescriptions: Record<PrivilegeDepth, string> = {
108108
[PrivilegeDepth.None]: "No access",
109-
[PrivilegeDepth.Basic]: "User - Only records owned by the user",
109+
[PrivilegeDepth.Basic]: "User (or team) - Only records owned by the user themselves or owned by teams the user is a member of. This doesn't give access to rows owned by other members of those teams.",
110110
[PrivilegeDepth.Local]: "Business Unit - Records owned by the user's business unit",
111111
[PrivilegeDepth.Deep]: "Parent: Child Business Units - Records owned by the user's business unit and all child business units",
112112
[PrivilegeDepth.Global]: "Organization - All records in the organization"
@@ -117,8 +117,8 @@ function GetDepthIcon({ privilege, depth }: { privilege: string, depth: Privileg
117117
"Read": "View records",
118118
"Write": "Modify existing records",
119119
"Delete": "Remove records",
120-
"Append": "Attach other records to this record (e.g., add notes, activities)",
121-
"AppendTo": "Attach this record to other records (e.g., be selected in a lookup)",
120+
"Append": "Access to attach other tables to me. (e.g. fill a lookup on table record with other table record)",
121+
"AppendTo": "Access to attach me to other tables. (e.g. this table can be selected in a lookup from another table)",
122122
"Assign": "Change the owner of records",
123123
"Share": "Share records with other users or teams"
124124
};

Website/components/insightsview/overview/InsightsOverviewView.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => {
5454

5555
return [
5656
{
57-
category: 'Entities',
57+
category: 'Tables',
5858
standard: standardEntities.length,
5959
custom: customEntities.length,
6060
},
6161
{
62-
category: 'Attributes',
62+
category: 'Columns',
6363
standard: standardAttributes.length,
6464
custom: customAttributes.length,
6565
},
@@ -251,21 +251,21 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => {
251251
<Grid size={{ xs: 12, md: 5 }}>
252252
<Paper elevation={0} className="p-4 flex rounded-2xl">
253253
<Stack className="w-full" direction="column" spacing={2} alignItems="center" justifyContent="center">
254-
{/* Ungrouped Entities */}
255-
<Tooltip title={"Entities: " + ungroupedEntities.map(entity => entity.SchemaName).join(", ")}>
254+
{/* Ungrouped Tables */}
255+
<Tooltip title={"Tables: " + ungroupedEntities.map(entity => entity.SchemaName).join(", ")}>
256256
<Box className="text-center px-4 py-1 rounded-lg flex items-center w-full" gap={2} sx={{ backgroundColor: 'background.default' }}>
257257
<Box className="h-8 w-8" sx={{ color: 'error.main' }}>{WarningIcon}</Box>
258258
<Typography variant="h4" className="font-semibold p-0 m-0" sx={{ color: 'text.primary' }}>{ungroupedEntities.length}</Typography>
259-
<Typography variant="body2" className="p-0 m-0" sx={{ color: 'text.secondary' }}>Entities ungrouped</Typography>
259+
<Typography variant="body2" className="p-0 m-0" sx={{ color: 'text.secondary' }}>Tables ungrouped</Typography>
260260
</Box>
261261
</Tooltip>
262262

263-
{/* No Icon Entities */}
264-
<Tooltip title={"Entities: " + missingIconEntities.map(entity => entity.SchemaName).join(", ")}>
263+
{/* No Icon Tables */}
264+
<Tooltip title={"Tables: " + missingIconEntities.map(entity => entity.SchemaName).join(", ")}>
265265
<Box className="text-center px-4 py-1 rounded-lg flex items-center w-full" gap={2} sx={{ backgroundColor: 'background.default' }}>
266266
<Box className="h-8 w-8" sx={{ color: 'error.main' }}>{WarningIcon}</Box>
267267
<Typography variant="h4" className="font-semibold p-0 m-0" sx={{ color: 'text.primary' }}>{missingIconEntities.length}</Typography>
268-
<Typography variant="body2" className="p-0 m-0" sx={{ color: 'text.secondary' }}>Entities without icons</Typography>
268+
<Typography variant="body2" className="p-0 m-0" sx={{ color: 'text.secondary' }}>Tables without icons</Typography>
269269
</Box>
270270
</Tooltip>
271271

@@ -302,7 +302,7 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => {
302302
<Grid size={{ xs: 12, md: 4 }}>
303303
<InfoCard
304304
color="warning.main"
305-
title="Attribute Process Dependencies"
305+
title="Column Process Dependencies"
306306
value={totalAttributeUsageCount}
307307
iconSrc={ProcessesIcon}
308308
/>
@@ -314,7 +314,7 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => {
314314
<Typography variant="h6" sx={{ color: 'text.primary' }}>
315315
Data Model Distribution: Standard vs Custom
316316
</Typography>
317-
<Tooltip title="Shows the distribution of standard (out-of-the-box) versus custom entities, attributes, and relationships in your Dataverse environment. This helps identify customization levels across your data model." arrow placement="left">
317+
<Tooltip title="Shows the distribution of standard (out-of-the-box) versus custom tables, columns, and relationships in your Dataverse environment. This helps identify customization levels across your data model." arrow placement="left">
318318
<IconButton size="small" sx={{ color: 'text.secondary' }}>
319319
<Box sx={{ width: 20, height: 20 }}>{InfoIcon}</Box>
320320
</IconButton>
@@ -618,9 +618,9 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => {
618618
<Paper elevation={2} className="p-6 rounded-2xl">
619619
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 2 }}>
620620
<Typography variant="h6" sx={{ color: 'text.primary' }}>
621-
Entity Features Distribution
621+
Table Features Distribution
622622
</Typography>
623-
<Tooltip title="Shows the distribution of key entity features enabled in your data model, including audit tracking, activity entities, and notes functionality. This provides insight into which capabilities are being utilized." arrow placement="left">
623+
<Tooltip title="Shows the distribution of key table features enabled in your data model, including audit tracking, activity tables, and notes functionality. This provides insight into which capabilities are being utilized." arrow placement="left">
624624
<IconButton size="small" sx={{ color: 'text.secondary' }}>
625625
<Box sx={{ width: 20, height: 20 }}>{InfoIcon}</Box>
626626
</IconButton>
@@ -674,9 +674,9 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => {
674674
<Paper elevation={2} className="p-6 rounded-2xl">
675675
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 2 }}>
676676
<Typography variant="h6" sx={{ color: 'text.primary' }}>
677-
Attribute Types Distribution
677+
Column Types Distribution
678678
</Typography>
679-
<Tooltip title="Breaks down all attributes by their data type (e.g., String, Integer, Lookup, DateTime). This helps understand the composition of your data model and identify commonly used field types." arrow placement="left">
679+
<Tooltip title="Breaks down all columns by their data type (e.g., String, Integer, Lookup, DateTime). This helps understand the composition of your data model and identify commonly used field types." arrow placement="left">
680680
<IconButton size="small" sx={{ color: 'text.secondary' }}>
681681
<Box sx={{ width: 20, height: 20 }}>{InfoIcon}</Box>
682682
</IconButton>
@@ -730,9 +730,9 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => {
730730
<Paper elevation={2} className="p-6 rounded-2xl">
731731
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 2 }}>
732732
<Typography variant="h6" sx={{ color: 'text.primary' }}>
733-
Attribute Process Dependencies by Type
733+
Column Process Dependencies by Type
734734
</Typography>
735-
<Tooltip title="Shows which types of components (plugins, flows, web resources, etc.) are using attributes from your data model. This identifies where attributes are referenced in business logic and automation." arrow placement="left">
735+
<Tooltip title="Shows which types of components (plugins, flows, web resources, etc.) are using columns from your data model. This identifies where columns are referenced in business logic and automation." arrow placement="left">
736736
<IconButton size="small" sx={{ color: 'text.secondary' }}>
737737
<Box sx={{ width: 20, height: 20 }}>{InfoIcon}</Box>
738738
</IconButton>
@@ -786,9 +786,9 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => {
786786
<Paper elevation={2} className="p-6 rounded-2xl">
787787
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 2 }}>
788788
<Typography variant="h6" sx={{ color: 'text.primary' }}>
789-
Attribute Process Dependencies by Detection Source
789+
Column Process Dependencies by Detection Source
790790
</Typography>
791-
<Tooltip title="Compares attribute usages found by the analyzer (scanning component source code) versus those detected through dependency analysis. This shows the effectiveness of different detection methods." arrow placement="left">
791+
<Tooltip title="Compares column usages found by the analyzer (scanning component source code) versus those detected through dependency analysis. This shows the effectiveness of different detection methods." arrow placement="left">
792792
<IconButton size="small" sx={{ color: 'text.secondary' }}>
793793
<Box sx={{ width: 20, height: 20 }}>{InfoIcon}</Box>
794794
</IconButton>

Website/components/insightsview/solutions/InsightsSolutionView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ const InsightsSolutionView = ({ }: InsightsSolutionViewProps) => {
323323
<Typography variant="body2" sx={{ color: 'text.secondary' }}>
324324
{component.Name} ({
325325
component.ComponentType === SolutionComponentTypeEnum.Entity
326-
? 'Entity'
326+
? 'Table'
327327
: component.ComponentType === SolutionComponentTypeEnum.Attribute
328-
? 'Attribute'
328+
? 'Column'
329329
: component.ComponentType === SolutionComponentTypeEnum.Relationship
330330
? 'Relationship'
331331
: 'Unknown'

0 commit comments

Comments
 (0)