refactor: 💡 use new baseURL and update topic paths (#2109)
* refactor: 💡 use new baseURL and update topic paths
This commit is contained in:
1 parent
bfd984d248
commit
c0cecda312
21 files changed
+128
-78
No files matched your search
@@ -23,6 +23,6 @@ export default class extends Helper {
|
||||
);
|
||||
}
|
||||
const path = configuredPath || '';
|
||||
return `${baseURL}${path}`;
|
||||
return path.startsWith('https') ? path : `${baseURL}${path}`;
|
||||
}
|
||||
}
|
||||
@@ -28,9 +28,11 @@ module.exports = function (environment) {
|
||||
companyName: 'Company Name',
|
||||
|
||||
documentation: {
|
||||
baseURL: 'https://boundaryproject.io/help/admin-ui',
|
||||
baseURL: 'https://developer.hashicorp.com/boundary',
|
||||
topics: {
|
||||
account: '/accounts',
|
||||
account: '/docs/concepts/domain-model/accounts',
|
||||
'host-catalog.aws.region':
|
||||
'https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html',
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -11,11 +11,16 @@ import { hbs } from 'ember-cli-htmlbars';
|
||||
module('Integration | Helper | doc-url', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
let config;
|
||||
let baseURL = hooks.beforeEach(function () {
|
||||
config = this.owner.resolveRegistration('config:environment');
|
||||
baseURL = config.documentation.baseURL;
|
||||
});
|
||||
|
||||
test('it renders a URL generated from the documentation config', async function (assert) {
|
||||
const config = this.owner.resolveRegistration('config:environment');
|
||||
const baseURL = config.documentation.baseURL;
|
||||
const path = config.documentation.topics.account;
|
||||
await render(hbs`{{doc-url 'account'}}`);
|
||||
|
||||
assert.ok(baseURL);
|
||||
assert.ok(path);
|
||||
assert.strictEqual(this.element.textContent.trim(), `${baseURL}${path}`);
|
||||
@@ -24,9 +29,19 @@ module('Integration | Helper | doc-url', function (hooks) {
|
||||
test('it throws an error if the specified documentation path cannot be found', async function (assert) {
|
||||
const Helper = this.owner.lookup('helper:doc-url');
|
||||
const helper = new Helper(this.owner);
|
||||
|
||||
assert.ok(helper.compute(['account']), 'Specified document exists.');
|
||||
assert.throws(() => {
|
||||
helper.compute(['no.such.doc']);
|
||||
}, 'Specified documentation was not found, so the helper threw an error.');
|
||||
});
|
||||
|
||||
test('it renders a URL generated from the documentation config without baseURL', async function (assert) {
|
||||
const path = config.documentation.topics['host-catalog.aws.region'];
|
||||
await render(hbs`{{doc-url 'host-catalog.aws.region'}}`);
|
||||
|
||||
assert.ok(baseURL);
|
||||
assert.ok(path);
|
||||
assert.strictEqual(this.element.textContent.trim(), path);
|
||||
});
|
||||
});
|
||||
@@ -10,7 +10,7 @@
|
||||
<page.header>
|
||||
<h2>
|
||||
{{t 'resources.alias.title'}}
|
||||
<DocLink @doc='aliases' @iconSize='large' />
|
||||
<DocLink @doc='alias' @iconSize='large' />
|
||||
</h2>
|
||||
<p>{{t 'resources.alias.description'}}</p>
|
||||
<Hds::Copy::Snippet @color='secondary' @textToCopy={{@model.id}} />
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<page.header>
|
||||
<h2>
|
||||
{{t 'resources.alias.title_plural'}}
|
||||
<DocLink @doc='aliases' @iconSize='large' />
|
||||
<DocLink @doc='alias' @iconSize='large' />
|
||||
</h2>
|
||||
<p>{{t 'resources.alias.description'}}</p>
|
||||
</page.header>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<page.header>
|
||||
<h2>
|
||||
{{t 'resources.alias.titles.new'}}
|
||||
<DocLink @doc='aliases' @iconSize='large' />
|
||||
<DocLink @doc='alias' @iconSize='large' />
|
||||
</h2>
|
||||
<p>{{t 'resources.alias.description'}}</p>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<page.header>
|
||||
<h2>
|
||||
{{t 'resources.alias.titles.new'}}
|
||||
<DocLink @doc='aliases' @iconSize='large' />
|
||||
<DocLink @doc='alias' @iconSize='large' />
|
||||
</h2>
|
||||
<p>{{t 'resources.alias.description'}}</p>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<page.header>
|
||||
<h2>
|
||||
{{t 'resources.alias.title'}}
|
||||
<DocLink @doc='aliases' @iconSize='large' />
|
||||
<DocLink @doc='alias' @iconSize='large' />
|
||||
</h2>
|
||||
<p>{{t 'resources.alias.description'}}</p>
|
||||
<Hds::Copy::Snippet @color='secondary' @textToCopy={{@model.id}} />
|
||||
|
||||
@@ -56,62 +56,79 @@ module.exports = function (environment) {
|
||||
oidcPollingTimeoutSeconds: 1,
|
||||
|
||||
documentation: {
|
||||
baseURL: 'https://boundaryproject.io/help/admin-ui',
|
||||
baseURL: 'https://developer.hashicorp.com/boundary',
|
||||
topics: {
|
||||
global: '/global',
|
||||
org: '/orgs',
|
||||
'org.new': '/orgs/new',
|
||||
project: '/projects',
|
||||
'project.new': '/projects/new',
|
||||
account: '/accounts',
|
||||
'account.new': '/accounts/new',
|
||||
'auth-method': '/auth-methods',
|
||||
'managed-groups': '/managed-groups',
|
||||
group: '/groups',
|
||||
'group.add-members': '/groups/add-members',
|
||||
'host-catalog': '/host-catalogs',
|
||||
'host-catalog.new': '/host-catalogs/new',
|
||||
'host-catalog.azure': '/dynamic-host-catalogs-on-azure',
|
||||
'host-catalog.aws': '/dynamic-host-catalogs-on-aws',
|
||||
'host-catalog.aws.region': '/dynamic-host-catalogs-on-aws-region',
|
||||
'host-set': '/host-sets',
|
||||
'host-set.new': '/host-sets/new',
|
||||
'host-set.add-hosts': '/host-sets/add-hosts',
|
||||
'host-set.preferred-endpoints': '/host-sets/preferred-endpoints',
|
||||
'host-set.sync-interval-seconds': '/host-sets/sync-interval-seconds',
|
||||
'credential-store': '/credential-stores',
|
||||
'credential-library': '/credential-libraries',
|
||||
credential: '/credentials',
|
||||
host: '/hosts',
|
||||
'host.new': '/hosts/new',
|
||||
role: '/roles',
|
||||
'role.add-principals': '/roles/add-principals',
|
||||
session: '/sessions',
|
||||
target: '/targets',
|
||||
'target.new': '/targets/new',
|
||||
'target.add-host-sources': '/targets/add-host-sets',
|
||||
'target.enable-session-recording': '/targets/enable-session-recording',
|
||||
'target.worker-filters': '/targets/worker-filters',
|
||||
user: '/users',
|
||||
downloads: '/downloads',
|
||||
'getting-started.desktop': '/getting-started/desktop',
|
||||
'api-client.cli': '/api-client/cli',
|
||||
'api-client.api': '/api-client/api',
|
||||
worker: '/workers',
|
||||
'worker.manage-workers': '/workers/manage-workers-on-hcp',
|
||||
'worker-filters': '/worker-filters',
|
||||
'storage-bucket': '/storage-buckets',
|
||||
'storage-bucket.new': '/storage-buckets/new',
|
||||
'storage-bucket.worker-filter': '/storage-buckets/worker-filter',
|
||||
global: '/docs/concepts/domain-model/scopes#global',
|
||||
org: '/docs/concepts/domain-model/scopes#organizations',
|
||||
'org.new': '/docs/common-workflows/manage-scopes',
|
||||
project: '/docs/concepts/domain-model/scopes#projects',
|
||||
'project.new': '/docs/common-workflows/manage-scopes',
|
||||
account: '/docs/concepts/domain-model/accounts',
|
||||
'account.new':
|
||||
'/tutorials/oss-administration/oss-manage-users-groups#create-an-account',
|
||||
'auth-method': '/docs/concepts/domain-model/auth-methods',
|
||||
'managed-groups': '/docs/concepts/domain-model/managed-groups',
|
||||
group: '/docs/concepts/domain-model/groups',
|
||||
'group.add-members':
|
||||
'/tutorials/oss-administration/oss-manage-users-groups#create-a-group',
|
||||
'host-catalog': '/docs/concepts/domain-model/host-catalogs',
|
||||
'host-catalog.new': '/docs/common-workflows/manage-targets',
|
||||
'host-catalog.azure': '/docs/concepts/host-discovery/azure',
|
||||
'host-catalog.aws': '/docs/concepts/host-discovery/aws',
|
||||
'host-catalog.aws.region':
|
||||
'https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html',
|
||||
'host-set': '/docs/concepts/domain-model/host-sets',
|
||||
'host-set.new':
|
||||
'/docs/common-workflows/manage-targets#define-a-host-set',
|
||||
'host-set.add-hosts': '/docs/concepts/domain-model/hosts',
|
||||
'host-set.preferred-endpoints':
|
||||
'/docs/concepts/domain-model/host-sets#preferred_endpoints',
|
||||
'host-set.sync-interval-seconds':
|
||||
'/docs/concepts/domain-model/host-sets#sync_interval_seconds',
|
||||
'credential-store': '/docs/concepts/domain-model/credential-stores',
|
||||
'credential-library':
|
||||
'/docs/concepts/domain-model/credential-libraries',
|
||||
credential: '/docs/concepts/domain-model/credentials',
|
||||
host: '/docs/concepts/domain-model/hosts',
|
||||
'host.new': '/docs/common-workflows/manage-targets#define-a-host',
|
||||
role: '/docs/concepts/domain-model/roles',
|
||||
'role.add-principals':
|
||||
'/tutorials/oss-administration/oss-manage-roles#create-a-role',
|
||||
session: '/docs/concepts/domain-model/sessions',
|
||||
target: '/docs/concepts/domain-model/targets',
|
||||
'target.new': '/docs/common-workflows/manage-targets',
|
||||
'target.add-host-sources': '/docs/concepts/domain-model/host-sets',
|
||||
'target.enable-session-recording':
|
||||
'/docs/configuration/session-recording/enable-session-recording',
|
||||
'target.worker-filters':
|
||||
'/docs/concepts/filtering/worker-tags#worker-filtering',
|
||||
user: '/docs/concepts/domain-model/users',
|
||||
downloads: '/install',
|
||||
'getting-started.desktop':
|
||||
'/tutorials/oss-getting-started/oss-getting-started-desktop-app',
|
||||
'api-client.cli': '/docs/commands',
|
||||
'api-client.api': '/docs/api-clients/api',
|
||||
worker: '/docs/configuration/worker',
|
||||
'worker.manage-workers':
|
||||
'/tutorials/hcp-administration/hcp-manage-workers',
|
||||
'worker-filters':
|
||||
'/docs/concepts/domain-model/credential-stores#worker_filter',
|
||||
'storage-bucket': '/docs/concepts/domain-model/storage-buckets',
|
||||
'storage-bucket.new':
|
||||
'/docs/configuration/session-recording/create-storage-bucket',
|
||||
'storage-bucket.worker-filter':
|
||||
'/docs/concepts/domain-model/storage-buckets#worker_filter',
|
||||
'storage-bucket.disable-credential-rotation':
|
||||
'/storage-buckets/disable-credential-rotation',
|
||||
'session-recording': '/session-recordings',
|
||||
'/docs/concepts/domain-model/storage-buckets#disable_credential_rotation',
|
||||
'session-recording': '/docs/concepts/domain-model/session-recordings',
|
||||
'session-recording.retrieve-lost-session-recordings':
|
||||
'/session-recordings/retrieve-lost-session-recordings',
|
||||
'storage-policy': '/storage-policy',
|
||||
'storage-policy.new': '/storage-policy/new',
|
||||
'storage-policy.update': '/storage-policy/update',
|
||||
aliases: '/aliases',
|
||||
'/docs/operations/manage-recorded-sessions',
|
||||
'storage-policy': '/docs/concepts/domain-model/storage-policy',
|
||||
'storage-policy.new':
|
||||
'/docs/configuration/session-recording/configure-storage-policy',
|
||||
'storage-policy.update':
|
||||
'/docs/configuration/session-recording/update-storage-policy',
|
||||
alias: '/docs/concepts/aliases',
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ module('Acceptance | credential-stores | create', function (hooks) {
|
||||
await visit(urls.newCredentialStore);
|
||||
assert.ok(
|
||||
find(
|
||||
`[href="https://boundaryproject.io/help/admin-ui/credential-stores"]`,
|
||||
`[href="https://developer.hashicorp.com/boundary/docs/concepts/domain-model/credential-stores"]`,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -153,7 +153,9 @@ module('Acceptance | credential-stores | credentials | read', function (hooks) {
|
||||
test('Users can link to docs page for credential', async function (assert) {
|
||||
await visit(urls.usernamePasswordCredential);
|
||||
assert.ok(
|
||||
find(`[href="https://boundaryproject.io/help/admin-ui/credentials"]`),
|
||||
find(
|
||||
`[href="https://developer.hashicorp.com/boundary/docs/concepts/domain-model/credentials"]`,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ module('Acceptance | credential-stores | list', function (hooks) {
|
||||
|
||||
assert
|
||||
.dom(
|
||||
`[href="https://boundaryproject.io/help/admin-ui/credential-stores"]`,
|
||||
`[href="https://developer.hashicorp.com/boundary/docs/concepts/domain-model/credential-stores"]`,
|
||||
)
|
||||
.exists();
|
||||
});
|
||||
|
||||
@@ -133,7 +133,7 @@ module('Acceptance | credential-stores | read', function (hooks) {
|
||||
|
||||
assert
|
||||
.dom(
|
||||
`[href="https://boundaryproject.io/help/admin-ui/credential-stores"]`,
|
||||
`[href="https://developer.hashicorp.com/boundary/docs/concepts/domain-model/credential-stores"]`,
|
||||
)
|
||||
.exists();
|
||||
});
|
||||
|
||||
@@ -105,7 +105,9 @@ module('Acceptance | host-catalogs | host-sets | read', function (hooks) {
|
||||
await click(`[href="${urls.hostSet}"]`);
|
||||
|
||||
assert
|
||||
.dom(`[href="https://boundaryproject.io/help/admin-ui/host-sets"]`)
|
||||
.dom(
|
||||
`[href="https://developer.hashicorp.com/boundary/docs/concepts/domain-model/host-sets"]`,
|
||||
)
|
||||
.exists();
|
||||
});
|
||||
|
||||
|
||||
@@ -105,7 +105,9 @@ module('Acceptance | host-catalogs | hosts | read', function (hooks) {
|
||||
await click(`[href="${urls.host}"]`);
|
||||
|
||||
assert
|
||||
.dom(`[href="https://boundaryproject.io/help/admin-ui/hosts"]`)
|
||||
.dom(
|
||||
`[href="https://developer.hashicorp.com/boundary/docs/concepts/domain-model/hosts"]`,
|
||||
)
|
||||
.exists();
|
||||
});
|
||||
|
||||
|
||||
@@ -99,7 +99,9 @@ module('Acceptance | host-catalogs | read', function (hooks) {
|
||||
await click(`[href="${urls.hostCatalogs}"]`);
|
||||
|
||||
assert
|
||||
.dom(`[href="https://boundaryproject.io/help/admin-ui/host-catalogs"]`)
|
||||
.dom(
|
||||
`[href="https://developer.hashicorp.com/boundary/docs/concepts/domain-model/host-catalogs"]`,
|
||||
)
|
||||
.exists();
|
||||
});
|
||||
|
||||
|
||||
@@ -188,7 +188,9 @@ module('Acceptance | sessions | list', function (hooks) {
|
||||
await click(`[href="${urls.sessions}"]`);
|
||||
|
||||
assert
|
||||
.dom(`[href="https://boundaryproject.io/help/admin-ui/sessions"]`)
|
||||
.dom(
|
||||
`[href="https://developer.hashicorp.com/boundary/docs/concepts/domain-model/sessions"]`,
|
||||
)
|
||||
.exists();
|
||||
});
|
||||
|
||||
|
||||
@@ -198,7 +198,9 @@ module('Acceptance | targets | read', function (hooks) {
|
||||
await click(`[href="${urls.targets}"]`);
|
||||
|
||||
assert
|
||||
.dom(`[href="https://boundaryproject.io/help/admin-ui/targets"]`)
|
||||
.dom(
|
||||
`[href="https://developer.hashicorp.com/boundary/docs/concepts/domain-model/targets"]`,
|
||||
)
|
||||
.exists();
|
||||
});
|
||||
|
||||
|
||||
@@ -85,7 +85,9 @@ module('Acceptance | users | read', function (hooks) {
|
||||
await click(`[href="${urls.users}"]`);
|
||||
|
||||
assert
|
||||
.dom(`[href="https://boundaryproject.io/help/admin-ui/users"]`)
|
||||
.dom(
|
||||
`[href="https://developer.hashicorp.com/boundary/docs/concepts/domain-model/users"]`,
|
||||
)
|
||||
.exists();
|
||||
});
|
||||
|
||||
|
||||
@@ -47,10 +47,12 @@ module.exports = function (environment) {
|
||||
oidcPollingTimeoutSeconds: 1,
|
||||
|
||||
documentation: {
|
||||
baseURL: 'https://boundaryproject.io/help/desktop',
|
||||
baseURL: 'https://developer.hashicorp.com/boundary',
|
||||
topics: {
|
||||
targets: '/targets',
|
||||
sessions: '/sessions',
|
||||
targets:
|
||||
'/tutorials/oss-getting-started/oss-getting-started-desktop-app#connect',
|
||||
sessions:
|
||||
'/tutorials/oss-getting-started/oss-getting-started-desktop-app#connect',
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -142,12 +142,12 @@ const createWindow = (partition, closeWindowCB) => {
|
||||
});
|
||||
|
||||
// Opens external links in the host default browser.
|
||||
// We allow boundaryproject.io domain to open on external window (for now)
|
||||
// We allow developer.hashicorp.com domain to open on external window
|
||||
// and releases.hashicorp.com domain to download the desktop app or
|
||||
// link to the release page for the desktop app.
|
||||
browserWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||
if (
|
||||
url.startsWith('https://boundaryproject.io/') ||
|
||||
url.startsWith('https://developer.hashicorp.com/') ||
|
||||
url.startsWith('https://releases.hashicorp.com/boundary-desktop/')
|
||||
) {
|
||||
shell.openExternal(url);
|
||||
|
||||
Reference in new issue
Block a user