-
Notifications
You must be signed in to change notification settings - Fork 3
feat: component type system foundation + browser editor #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TomProkop
wants to merge
10
commits into
master
Choose a base branch
from
feat/environment-component-browse
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
06d4888
chore: add TALXIS.Platform.Metadata 0.5.0-preview.1 to Core
TomProkop 3eb3bb3
feat: add top-level txc component type list/explain commands
TomProkop ea09a8b
refactor: replace ComponentTypeResolver with ComponentDefinitionRegistry
TomProkop ebfdfa9
feat: add txc env component browse command
TomProkop 1b512c7
refactor: delete dead code — metamodel stubs, old workspace type comm…
TomProkop 0a43db3
test: update integration tests for new command paths
TomProkop 609848e
feat: extend browse with app launch + UCI deep links
TomProkop 126b351
refactor: split URL builders into focused files per experience
TomProkop 0539fcb
refactor: rename DynamicsUciUrls → PowerAppsUciUrls
TomProkop 5030c2e
fix: address PR #101 review comments
TomProkop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
86 changes: 0 additions & 86 deletions
86
src/TALXIS.CLI.Core/Contracts/Dataverse/ComponentTypeResolver.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| using System.Diagnostics; | ||
| using System.Runtime.InteropServices; | ||
| using Microsoft.Extensions.Logging; | ||
| using TALXIS.CLI.Core.Abstractions; | ||
| using TALXIS.CLI.Core.DependencyInjection; | ||
|
|
||
| namespace TALXIS.CLI.Core; | ||
|
|
||
| /// <summary> | ||
| /// Cross-platform utility to open a URL in the default browser. | ||
| /// Headless-aware: skips browser launch in CI/non-interactive environments. | ||
| /// </summary> | ||
| public static class BrowserLauncher | ||
| { | ||
| /// <summary> | ||
| /// Opens <paramref name="url"/> in the default browser. | ||
| /// In headless/CI mode, logs a warning and returns without opening. | ||
| /// </summary> | ||
| public static void Open(Uri url, ILogger logger) | ||
| { | ||
| var detector = TxcServices.Get<IHeadlessDetector>(); | ||
| if (detector.IsHeadless) | ||
| { | ||
| logger.LogWarning("Headless mode ({Reason}) — browser not opened.", detector.Reason); | ||
| return; | ||
| } | ||
|
|
||
| try | ||
| { | ||
| if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) | ||
| { | ||
| Process.Start(new ProcessStartInfo(url.AbsoluteUri) { UseShellExecute = true }); | ||
| } | ||
| else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) | ||
| { | ||
| Process.Start("open", url.AbsoluteUri); | ||
| } | ||
| else | ||
| { | ||
| Process.Start("xdg-open", url.AbsoluteUri); | ||
| } | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| logger.LogWarning("Could not open browser: {Error}", ex.Message); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/TALXIS.CLI.Features.Environment/Component/Browse/BrowseUrlConstants.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| namespace TALXIS.CLI.Features.Environment.Component.Browse; | ||
|
|
||
| /// <summary> | ||
| /// Shared constants for browse URL construction. | ||
| /// </summary> | ||
| public static class BrowseUrlConstants | ||
| { | ||
| /// <summary>Default Solution GUID — used when no solution context is specified for form/view/securityrole.</summary> | ||
| public const string DefaultSolutionId = "fd140aaf-4df4-11dd-bd17-0019b9312238"; | ||
|
|
||
| /// <summary> | ||
| /// Extracts the hostname from an org URL for use in URL construction. | ||
| /// Accepts either a full URL or a bare hostname. | ||
| /// </summary> | ||
| public static string NormalizeOrgUrl(string orgUrl) | ||
| { | ||
| if (Uri.TryCreate(orgUrl, UriKind.Absolute, out var uri)) | ||
| return uri.Host; | ||
| // Already a bare hostname | ||
| return orgUrl.TrimEnd('/'); | ||
| } | ||
| } |
31 changes: 31 additions & 0 deletions
31
src/TALXIS.CLI.Features.Environment/Component/Browse/CanvasAppUrls.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| namespace TALXIS.CLI.Features.Environment.Component.Browse; | ||
|
|
||
| /// <summary> | ||
| /// URL builders for the Power Apps canvas app player (<c>apps.powerapps.com/play</c>). | ||
| /// Supports screen navigation, custom parameters, and hidden navbar. | ||
| /// </summary> | ||
| public static class CanvasAppUrls | ||
| { | ||
| private const string Base = "https://apps.powerapps.com/play"; | ||
|
|
||
| /// <summary> | ||
| /// Open a canvas app in the Power Apps player. | ||
| /// </summary> | ||
| public static Uri Play(Guid environmentId, Guid appId, string? tenantId, | ||
| string? screenName = null, IDictionary<string, string>? customParams = null, bool hideNavbar = false) | ||
| { | ||
| var qs = new List<string>(); | ||
| if (!string.IsNullOrWhiteSpace(tenantId)) | ||
| qs.Add($"tenantId={Uri.EscapeDataString(tenantId)}"); | ||
| if (!string.IsNullOrWhiteSpace(screenName)) | ||
| qs.Add($"screenName={Uri.EscapeDataString(screenName)}"); | ||
| if (hideNavbar) | ||
| qs.Add("hidenavbar=true"); | ||
| if (customParams != null) | ||
| foreach (var (key, value) in customParams) | ||
| qs.Add($"{Uri.EscapeDataString(key)}={Uri.EscapeDataString(value)}"); | ||
|
|
||
| var query = qs.Count > 0 ? "?" + string.Join("&", qs) : ""; | ||
| return new Uri($"{Base}/e/{environmentId}/a/{appId}{query}"); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.