Link connector docs in the Add Source dialog
The access review Add Source dialog listed each connector with no path to its setup documentation. Connectors that have a published docs page on probo.com now surface a "Documentation" link on the card, opening the page in a new tab; connectors without a page show nothing extra. The link is data-driven from the connector registry: a new DocumentationURL on the provider Registration, populated for the 12 documented providers via a single accessReviewDocsURL helper, is surfaced as a nullable documentationUrl on ConnectorProviderInfo and rendered by the console only when present. This keeps the registry the single source of truth and adds no client-side provider map. The links resolve once the probo.com access-review docs pages are deployed; until then they 404, so deploy the docs alongside this change. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -37,6 +37,7 @@ func TestAccessReviewDrivers(t *testing.T) {
|
||||
accessReviewDrivers {
|
||||
provider
|
||||
displayName
|
||||
documentationUrl
|
||||
oauthConfigured
|
||||
apiKeySupported
|
||||
clientCredentialsSupported
|
||||
@@ -51,11 +52,12 @@ func TestAccessReviewDrivers(t *testing.T) {
|
||||
|
||||
var result struct {
|
||||
AccessReviewDrivers []struct {
|
||||
Provider string `json:"provider"`
|
||||
DisplayName string `json:"displayName"`
|
||||
OauthConfigured bool `json:"oauthConfigured"`
|
||||
APIKeySupported bool `json:"apiKeySupported"`
|
||||
ClientCredentialsSupported bool `json:"clientCredentialsSupported"`
|
||||
Provider string `json:"provider"`
|
||||
DisplayName string `json:"displayName"`
|
||||
DocumentationURL *string `json:"documentationUrl"`
|
||||
OauthConfigured bool `json:"oauthConfigured"`
|
||||
APIKeySupported bool `json:"apiKeySupported"`
|
||||
ClientCredentialsSupported bool `json:"clientCredentialsSupported"`
|
||||
ExtraSettings []struct {
|
||||
Key string `json:"key"`
|
||||
Label string `json:"label"`
|
||||
@@ -69,17 +71,29 @@ func TestAccessReviewDrivers(t *testing.T) {
|
||||
assert.NotEmpty(t, result.AccessReviewDrivers)
|
||||
|
||||
providerNames := make(map[string]bool)
|
||||
docURLByProvider := make(map[string]*string)
|
||||
|
||||
for _, info := range result.AccessReviewDrivers {
|
||||
assert.NotEmpty(t, info.Provider)
|
||||
assert.NotEmpty(t, info.DisplayName)
|
||||
assert.NotNil(t, info.ExtraSettings)
|
||||
providerNames[info.Provider] = true
|
||||
docURLByProvider[info.Provider] = info.DocumentationURL
|
||||
}
|
||||
|
||||
assert.True(t, providerNames["BREX"], "expected BREX provider to be present")
|
||||
assert.True(t, providerNames["HUBSPOT"], "expected HUBSPOT provider to be present")
|
||||
|
||||
// A documented provider exposes its probo.com docs URL; an undocumented one
|
||||
// exposes null. See pkg/connector/provider/docs.go.
|
||||
require.Contains(t, docURLByProvider, "ANTHROPIC")
|
||||
|
||||
if url := docURLByProvider["ANTHROPIC"]; assert.NotNil(t, url) {
|
||||
assert.Equal(t, "https://www.probo.com/docs/product/access-review/anthropic", *url)
|
||||
}
|
||||
|
||||
assert.Nil(t, docURLByProvider["BREX"], "BREX has no doc page, documentationUrl must be null")
|
||||
|
||||
t.Run("viewer can list access review drivers", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
viewer := testutil.NewClientInOrg(t, testutil.RoleViewer, owner)
|
||||
|
||||
Reference in New Issue
Block a user