Skip to content
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

Announce new features on the dashboard #267

Merged
merged 3 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions web/app/components/dashboard/new-features-banner.hbs
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
{{! @glint-nocheck: not typesafe yet }}
{{#if this.isShown}}
<Hds::Alert
@type="inline"
@color="highlight"
@icon="gift"
@onDismiss={{this.dismiss}}
class="mt-6"
class="mt-6 mb-10"
as |A|
>
<A.Title>New features available</A.Title>
<A.Title>New editor features.</A.Title>
<A.Description>
<ul>
<li>You can now create RFC, PRD, and FRD drafts!</li>
<li>Send a RFC, PRD, and FRD document for review. Hermes will
automatically email the approvers!</li>
<li>Approvers can now approve documents through Hermes.</li>
<li>Archive documents by marking them "obsolete". </li>
<li><strong>Related resources</strong>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I think what we had before makes sense!

Suggested change
<li><strong>Related resources</strong>
<li><strong>Related resources:</strong>

Attach content to your document such as other Hermes documents or external
links.</li>
<li><strong>Shareable drafts</strong>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li><strong>Shareable drafts</strong>
<li><strong>Shareable drafts:</strong>

You can now toggle your document draft visibility to “shareable” and generate a sharable link.</li>
</ul>
</A.Description>
<A.Link::Standalone
@icon="arrow-right"
@iconPosition="leading"
@text="Create a document draft"
@route="authenticated.new"
/>
</Hds::Alert>
{{/if}}
18 changes: 13 additions & 5 deletions web/app/components/dashboard/new-features-banner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";
import window from "ember-window-mock";
import { action } from "@ember/object";

let LOCAL_STORAGE_ITEM_NAME = "newFeaturesBanner";
let LOCAL_STORAGE_ITEM_NAME = "july-20-2023-newFeatureBannerIsShown";
jeffdaley marked this conversation as resolved.
Show resolved Hide resolved

interface DashboardNewFeaturesBannerSignature {
Args: {};
Expand All @@ -12,7 +12,12 @@ interface DashboardNewFeaturesBannerSignature {
export default class DashboardNewFeaturesBanner extends Component<DashboardNewFeaturesBannerSignature> {
@tracked protected isDismissed = false;

isShown(): boolean {
/**
* Whether the banner should be shown.
* Set true on first visit to the dashboard and remains true
* until the user dismisses the banner.
*/
protected get isShown(): boolean {
const storageItem = window.localStorage.getItem(LOCAL_STORAGE_ITEM_NAME);

if (storageItem === null) {
Expand All @@ -22,9 +27,12 @@ export default class DashboardNewFeaturesBanner extends Component<DashboardNewFe
return true;
} else return false;
}

@action
dismiss() {
/**
* The action called when the user clicks the dismiss button.
* Sets the local storage item to false and sets the isDismissed
* property to true so the banner is immediately hidden.
*/
@action protected dismiss() {
window.localStorage.setItem(LOCAL_STORAGE_ITEM_NAME, "false");
this.isDismissed = true;
}
Expand Down
2 changes: 2 additions & 0 deletions web/app/templates/authenticated/dashboard.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

<section class="x-container">

<Dashboard::NewFeaturesBanner />

<div class="hds-border-primary border-0 border-b pb-9">
<h1>Welcome back, {{this.authenticatedUser.info.given_name}}</h1>
<p>Here’s all the latest updates across the organization.</p>
Expand Down