Skip to content

Commit

Permalink
feat(manager/web): add manager resources link (Jigsaw-Code#1463)
Browse files Browse the repository at this point in the history
* mostly done, still need to test link Jigsaw-Code#2

* Update outline-server-settings.ts to add margin-top and margin-bottom to documentation-link

* remove api documentation, and use iron-icon

* use iron icon icon

* add shouldShowDocumentationLink

* Update src/server_manager/web_app/ui_components/app-root.ts

Co-authored-by: Vinicius Fortuna <fortuna@users.noreply.github.com>

* make hasTranslation better

* update message id and indentation

---------

Co-authored-by: Vinicius Fortuna <fortuna@users.noreply.github.com>
  • Loading branch information
daniellacosse and fortuna authored Dec 15, 2023
1 parent 2a30486 commit fa76739
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/server_manager/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"gcp-type-network-tag": "Type 'outline' in the 'Network tags' field.",
"gcp-type-outline-server": "Type 'outline-server' in the 'Name' field.",
"key": "Key {keyId}",
"manager-resources": "Manager Resources",
"manual-server-assign-firewall": "Assign firewall rule",
"manual-server-assign-group": "Assign Security Group",
"manual-server-create-firewall": "Create a firewall rule",
Expand Down
4 changes: 4 additions & 0 deletions src/server_manager/messages/master_messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,10 @@
}
}
},
"manager_resources": {
"message": "Manager Resources",
"description": "This string appears within the manager sidebar as a link to the manager documentation."
},
"manual_server_assign_firewall": {
"message": "Assign firewall rule",
"description": "This string appears in the server setup view as a sub-header of a section that provides instructions to configure the server's firewall."
Expand Down
34 changes: 30 additions & 4 deletions src/server_manager/web_app/ui_components/app-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ export class AppRoot extends polymerElementWithLocalize {
#links-footer {
margin-top: 36px;
}
#appDrawer .manager-resources-link {
color: var(--primary-green);
display: flex;
align-items: center;
gap: 0.25rem;
}
.legal-links {
margin: 0 -6px;
}
Expand Down Expand Up @@ -391,6 +397,13 @@ export class AppRoot extends polymerElementWithLocalize {
<!-- Links section -->
<paper-listbox>
<a
class="manager-resources-link"
hidden$="[[!showManagerResourcesLink]]"
href="https://www.reddit.com/r/outlinevpn/wiki/index/">
<span>[[localize('manager-resources')]]</span>
<iron-icon icon="open-in-new" />
</a>
<span on-tap="maybeCloseDrawer"><a href="https://support.getoutline.org/s/article/Data-collection">[[localize('nav-data-collection')]]</a></span>
<span on-tap="submitFeedbackTapped">[[localize('nav-feedback')]]</span>
<span on-tap="maybeCloseDrawer"><a href="https://s3.amazonaws.com/outline-vpn/index.html#/en/support/">[[localize('nav-help')]]</a></span>
Expand Down Expand Up @@ -697,10 +710,7 @@ export class AppRoot extends polymerElementWithLocalize {
observer: '_currentPageChanged',
},
shouldShowSideBar: {type: Boolean},
sideBarMarginClass: {
type: String,
computed: '_computeSideBarMarginClass(shouldShowSideBar)',
},
showManagerResourcesLink: {type: Boolean},
};
}

Expand All @@ -714,6 +724,7 @@ export class AppRoot extends polymerElementWithLocalize {
outlineVersion = '';
currentPage = 'intro';
shouldShowSideBar = false;
showManagerResourcesLink = false;

constructor() {
super();
Expand Down Expand Up @@ -769,6 +780,21 @@ export class AppRoot extends polymerElementWithLocalize {
(this.$.appDrawer as AppDrawerElement).align = alignDir;
(this.$.sideBar as AppDrawerElement).align = alignDir;
this.language = language;

this.showManagerResourcesLink = this.hasTranslation('manager-resources');
}

hasTranslation(key: string) {
let message;

try {
message = this.localize(key);
} catch (e) {
// failed to find translation
message = '';
}

return message !== key && message !== '';
}

showIntro() {
Expand Down

0 comments on commit fa76739

Please sign in to comment.