From 44c2da3518c60d3221c45e4cbac91f67e2c84b49 Mon Sep 17 00:00:00 2001 From: John Cowen <johncowen@users.noreply.github.com> Date: Mon, 5 Aug 2019 19:10:00 +0200 Subject: [PATCH] ui: add some additional env level URLs for easier linking (#6145) Right now we only use CONSUL_DOCS_URL, the others are for future usage --- ui-v2/app/templates/components/hashicorp-consul.hbs | 4 ++-- ui-v2/app/templates/components/policy-form.hbs | 2 +- ui-v2/app/templates/components/policy-selector.hbs | 2 +- ui-v2/app/templates/dc/acls/-disabled.hbs | 2 +- ui-v2/app/templates/dc/acls/-form.hbs | 2 +- ui-v2/app/templates/dc/acls/policies/-view.hbs | 2 +- ui-v2/app/templates/dc/acls/tokens/-fieldsets-legacy.hbs | 2 +- ui-v2/app/templates/dc/acls/tokens/edit.hbs | 2 +- ui-v2/app/templates/dc/acls/tokens/index.hbs | 2 +- ui-v2/app/templates/dc/kv/edit.hbs | 4 ++-- ui-v2/app/templates/dc/nodes/-sessions.hbs | 2 +- ui-v2/app/templates/error.hbs | 2 +- ui-v2/config/environment.js | 5 ++++- 13 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ui-v2/app/templates/components/hashicorp-consul.hbs b/ui-v2/app/templates/components/hashicorp-consul.hbs index 4c7ba823ef..2872e6d584 100644 --- a/ui-v2/app/templates/components/hashicorp-consul.hbs +++ b/ui-v2/app/templates/components/hashicorp-consul.hbs @@ -42,7 +42,7 @@ <nav> <ul> <li data-test-main-nav-docs> - <a href="{{ env 'CONSUL_DOCUMENTATION_URL'}}" rel="help noopener noreferrer" target="_blank">Documentation</a> + <a href="{{ env 'CONSUL_DOCS_URL'}}" rel="help noopener noreferrer" target="_blank">Documentation</a> </li> <li data-test-main-nav-settings class={{if (is-href 'settings') 'is-active'}}> <a href={{href-to 'settings'}}>Settings</a> @@ -57,7 +57,7 @@ <footer role="contentinfo" data-test-footer> <a data-test-footer-copyright href="{{env 'CONSUL_COPYRIGHT_URL'}}/" rel="noopener noreferrer" target="_blank">© {{env 'CONSUL_COPYRIGHT_YEAR'}} HashiCorp</a> <p data-test-footer-version>Consul {{env 'CONSUL_VERSION'}}</p> - <a data-test-footer-docs href="{{env 'CONSUL_DOCUMENTATION_URL'}}" rel="help noopener noreferrer" target="_blank">Documentation</a> + <a data-test-footer-docs href="{{env 'CONSUL_DOCS_URL'}}" rel="help noopener noreferrer" target="_blank">Documentation</a> {{{concat '<!-- ' (env 'CONSUL_GIT_SHA') '-->'}}} </footer> {{modal-layer}} \ No newline at end of file diff --git a/ui-v2/app/templates/components/policy-form.hbs b/ui-v2/app/templates/components/policy-form.hbs index 6b20175e3d..5712b5efd3 100644 --- a/ui-v2/app/templates/components/policy-form.hbs +++ b/ui-v2/app/templates/components/policy-form.hbs @@ -29,7 +29,7 @@ {{/if}} </label> <label class="type-text" data-test-rules> - <span>Rules <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> + <span>Rules <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> {{#if (eq item.template '') }} {{code-editor syntax='hcl' class=(if item.error.Rules 'error') name=(concat name '[Rules]') value=item.Rules onkeyup=(action 'change' (concat name '[Rules]'))}} {{#if item.error.Rules}} diff --git a/ui-v2/app/templates/components/policy-selector.hbs b/ui-v2/app/templates/components/policy-selector.hbs index 22d6d8ad26..473b586ec7 100644 --- a/ui-v2/app/templates/components/policy-selector.hbs +++ b/ui-v2/app/templates/components/policy-selector.hbs @@ -58,7 +58,7 @@ {{/block-slot}} {{#block-slot 'details'}} <label class="type-text"> - <span>Rules <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> + <span>Rules <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> {{#if (eq item.template '')}} {{code-editor syntax='hcl' readonly=true value=item.Rules}} {{else}} diff --git a/ui-v2/app/templates/dc/acls/-disabled.hbs b/ui-v2/app/templates/dc/acls/-disabled.hbs index 2c14177a1a..4a8d1ffb9a 100644 --- a/ui-v2/app/templates/dc/acls/-disabled.hbs +++ b/ui-v2/app/templates/dc/acls/-disabled.hbs @@ -2,5 +2,5 @@ ACLs are disabled in this Consul cluster. This is the default behavior, as you have to explicitly enable them. </p> <p> - Learn more in the <a href="{{ env 'CONSUL_DOCUMENTATION_URL'}}/guides/acl.html" rel="noopener noreferrer" target="_blank">ACL documentation</a> + Learn more in the <a href="{{ env 'CONSUL_DOCS_URL'}}/guides/acl.html" rel="noopener noreferrer" target="_blank">ACL documentation</a> </p> diff --git a/ui-v2/app/templates/dc/acls/-form.hbs b/ui-v2/app/templates/dc/acls/-form.hbs index c6dac4d759..04fde95acd 100644 --- a/ui-v2/app/templates/dc/acls/-form.hbs +++ b/ui-v2/app/templates/dc/acls/-form.hbs @@ -13,7 +13,7 @@ {{/each}} </div> <label class="type-text"> - <span>Policy <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> + <span>Policy <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> {{code-editor class=(if item.error.Rules 'error') name='Rules' value=item.Rules syntax="hcl" onkeyup=(action 'change' 'Rules')}} </label> {{#if create }} diff --git a/ui-v2/app/templates/dc/acls/policies/-view.hbs b/ui-v2/app/templates/dc/acls/policies/-view.hbs index c55457c739..dc5859cb50 100644 --- a/ui-v2/app/templates/dc/acls/policies/-view.hbs +++ b/ui-v2/app/templates/dc/acls/policies/-view.hbs @@ -1,4 +1,4 @@ -<p class="notice policy-management"><strong>Management</strong> This global-management token is built into Consul's policy system. You can apply this special policy to tokens for full access. This policy is not editable or removeable, but can be ignored by not applying it to any tokens. Learn more in our <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/guides/acl.html#builtin-policies" target="_blank" rel="noopener noreferrer">documentation</a>.</p> +<p class="notice policy-management"><strong>Management</strong> This global-management token is built into Consul's policy system. You can apply this special policy to tokens for full access. This policy is not editable or removeable, but can be ignored by not applying it to any tokens. Learn more in our <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#builtin-policies" target="_blank" rel="noopener noreferrer">documentation</a>.</p> <div> <dl> <dt>Name</dt> diff --git a/ui-v2/app/templates/dc/acls/tokens/-fieldsets-legacy.hbs b/ui-v2/app/templates/dc/acls/tokens/-fieldsets-legacy.hbs index 1d51a889d7..213f8d1133 100644 --- a/ui-v2/app/templates/dc/acls/tokens/-fieldsets-legacy.hbs +++ b/ui-v2/app/templates/dc/acls/tokens/-fieldsets-legacy.hbs @@ -14,7 +14,7 @@ </div> {{/if}} <label class="type-text"> - <span>Rules <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> + <span>Rules <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> {{code-editor class=(if item.error.Rules 'error') name='Rules' syntax='hcl' value=item.Rules onkeyup=(action 'change' 'Rules')}} </label> {{#if create }} diff --git a/ui-v2/app/templates/dc/acls/tokens/edit.hbs b/ui-v2/app/templates/dc/acls/tokens/edit.hbs index de951c0489..8d40c1509c 100644 --- a/ui-v2/app/templates/dc/acls/tokens/edit.hbs +++ b/ui-v2/app/templates/dc/acls/tokens/edit.hbs @@ -49,7 +49,7 @@ {{/block-slot}} {{#block-slot 'content'}} {{#if (token/is-legacy item)}} - <p class="notice info"><strong>Update.</strong> We have upgraded our ACL system by allowing you to create reusable policies which you can then apply to tokens. Don't worry, even though this token was written in the old style, it is still valid. However, we do recommend upgrading your old tokens to the new style. Learn how in our <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.</p> + <p class="notice info"><strong>Update.</strong> We have upgraded our ACL system by allowing you to create reusable policies which you can then apply to tokens. Don't worry, even though this token was written in the old style, it is still valid. However, we do recommend upgrading your old tokens to the new style. Learn how in our <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.</p> {{/if}} {{#if (not create) }} <div> diff --git a/ui-v2/app/templates/dc/acls/tokens/index.hbs b/ui-v2/app/templates/dc/acls/tokens/index.hbs index 22519b8827..30f7500b81 100644 --- a/ui-v2/app/templates/dc/acls/tokens/index.hbs +++ b/ui-v2/app/templates/dc/acls/tokens/index.hbs @@ -26,7 +26,7 @@ </form> {{/if}} {{#if (token/is-legacy items)}} - <p data-test-notification-update class="notice info"><strong>Update.</strong> We have upgraded our ACL System to allow the creation of reusable policies that can be applied to tokens. Read more about the changes and how to upgrade legacy tokens in our <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.</p> + <p data-test-notification-update class="notice info"><strong>Update.</strong> We have upgraded our ACL System to allow the creation of reusable policies that can be applied to tokens. Read more about the changes and how to upgrade legacy tokens in our <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.</p> {{/if}} {{#changeable-set dispatcher=searchable}} {{#block-slot 'set' as |filtered|}} diff --git a/ui-v2/app/templates/dc/kv/edit.hbs b/ui-v2/app/templates/dc/kv/edit.hbs index bc8a0c2771..ce2d48b546 100644 --- a/ui-v2/app/templates/dc/kv/edit.hbs +++ b/ui-v2/app/templates/dc/kv/edit.hbs @@ -24,14 +24,14 @@ {{#block-slot 'content'}} {{#if session}} <p class="notice warning"> - <strong>Warning.</strong> This KV has a lock session. You can edit KV's with lock sessions, but we recommend doing so with care, or not doing so at all. It may negatively impact the active node it's associated with. See below for more details on the Lock Session and see <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/internals/sessions.html" target="_blank" rel="noopener noreferrer">our documentation</a> for more information. + <strong>Warning.</strong> This KV has a lock session. You can edit KV's with lock sessions, but we recommend doing so with care, or not doing so at all. It may negatively impact the active node it's associated with. See below for more details on the Lock Session and see <a href="{{env 'CONSUL_DOCS_URL'}}/internals/sessions.html" target="_blank" rel="noopener noreferrer">our documentation</a> for more information. </p> {{/if}} {{partial 'dc/kv/form'}} {{#if session}} <div data-test-session={{session.ID}}> <h2> - <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/internals/sessions.html#session-design" rel="help noopener noreferrer" target="_blank">Lock Session</a> + <a href="{{env 'CONSUL_DOCS_URL'}}/internals/sessions.html#session-design" rel="help noopener noreferrer" target="_blank">Lock Session</a> </h2> <dl> <dt>Name</dt> diff --git a/ui-v2/app/templates/dc/nodes/-sessions.hbs b/ui-v2/app/templates/dc/nodes/-sessions.hbs index 5c0cfda925..86823c7504 100644 --- a/ui-v2/app/templates/dc/nodes/-sessions.hbs +++ b/ui-v2/app/templates/dc/nodes/-sessions.hbs @@ -52,7 +52,7 @@ {{/tabular-collection}} {{else}} <p> - There are no Lock Sessions for this Node. For more information, view <a href="{{ env 'CONSUL_DOCUMENTATION_URL'}}/internals/sessions.html" rel="help noopener noreferrer" target="_blank">our documentation</a> + There are no Lock Sessions for this Node. For more information, view <a href="{{ env 'CONSUL_DOCS_URL'}}/internals/sessions.html" rel="help noopener noreferrer" target="_blank">our documentation</a> </p> {{/if}} diff --git a/ui-v2/app/templates/error.hbs b/ui-v2/app/templates/error.hbs index ea2027efe5..8d669d5a95 100644 --- a/ui-v2/app/templates/error.hbs +++ b/ui-v2/app/templates/error.hbs @@ -13,7 +13,7 @@ <p> Consul returned an error. You may have visited a URL that is loading an unknown resource, so you can try going back to the root or try re-submitting your ACL Token/SecretID by going back to ACLs.<br /> - Try looking in our <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}" target="_blank">documentation</a> + Try looking in our <a href="{{env 'CONSUL_DOCS_URL'}}" target="_blank">documentation</a> </p> <a rel="home" href={{href-to 'index'}}>Go back to root</a> {{/block-slot}} diff --git a/ui-v2/config/environment.js b/ui-v2/config/environment.js index c33b836384..5efdb8d255 100644 --- a/ui-v2/config/environment.js +++ b/ui-v2/config/environment.js @@ -64,7 +64,10 @@ module.exports = function(environment) { } return 'oss'; })(), - CONSUL_DOCUMENTATION_URL: 'https://www.consul.io/docs', + CONSUL_HOME_URL: 'https://www.consul.io', + CONSUL_DOCS_URL: 'https://www.consul.io/docs', + CONSUL_DOCS_LEARN_URL: 'https://learn.hashicorp.com/consul', + CONSUL_DOCS_API_URL: 'https://www.consul.io/api', CONSUL_COPYRIGHT_URL: 'https://www.hashicorp.com', CONSUL_COPYRIGHT_YEAR: '2019', });