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

[SITE] remove giveaway references from the report card page #4380

Merged
merged 3 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 3 additions & 16 deletions apps/pwabuilder/src/script/components/publish-pane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,19 +1004,6 @@ export class PublishPane extends LitElement {
${platform.factoids.map((fact: string) => html`<li>${fact}</li>`)}
</ul>
</div>
${ platform.title === "Windows" && this.tokensCampaign ? html`
<button id="windows-package-token-banner" @click=${() => this.goToTokenPage()}>
<div id="token-banner-windows-icon">
<img src="/assets/microsoft_store_icon_white.png" alt="Windows">
</div>
<div id="token-banner-text">
<p>
Check to see if you qualify for a free Microsoft Store account <img src="/assets/white-arrow.png" alt="arrow" />
</p>
</div>
</button>
` : html``
}
</div>`
);
}
Expand Down Expand Up @@ -1130,9 +1117,9 @@ export class PublishPane extends LitElement {
return html`
<sl-dialog
class=${classMap({noX: this.preventClosing, dialog: true})}
@sl-show=${() => document.body.style.height = "100vh"}
@sl-hide=${(e: any) => this.hideDialog(e)}
@sl-request-close=${(e:any) => this.handleRequestClose(e)}
@sl-show=${() => document.body.style.height = "100vh"}
@sl-hide=${(e: any) => this.hideDialog(e)}
@sl-request-close=${(e:any) => this.handleRequestClose(e)}
noHeader>
<div id="pp-frame-wrapper">
<div id="pp-frame-content">
Expand Down
41 changes: 2 additions & 39 deletions apps/pwabuilder/src/script/components/todo-list-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export class TodoItem extends LitElement {
@property({ type: String }) displayString: string = "";

@state() clickable: boolean = false;
@state() giveaway: boolean = false;
@state() isOpen: boolean = false;

static get styles() {
Expand Down Expand Up @@ -110,11 +109,6 @@ export class TodoItem extends LitElement {
transform: translateX(5px);
}
}

.giveaway img {
height: 21px;
}

.arrow {
width: 16px;
}
Expand Down Expand Up @@ -145,19 +139,14 @@ export class TodoItem extends LitElement {
}

decideClasses(){
// token giveaway toggle
this.giveaway = false;
if(this.field === "giveaway"){
this.giveaway = true;
}

if(this.status === "retest" || this.field.startsWith("Open")){
this.clickable = true;
} else {
this.clickable = false;
}

return {iwrapper: true, clickable: this.clickable, giveaway: this.giveaway}
return {iwrapper: true, clickable: this.clickable}
}

bubbleEvent(){
Expand Down Expand Up @@ -210,43 +199,18 @@ export class TodoItem extends LitElement {

case "retest":
return html`<img src=${retest_src} style="color: black" alt="retest site icon"/>`

case "giveaway":
return html`<img src=${giveaway_src} alt="giveaway site icon"/>`
}

return html`<img src=${yield_src} alt="yield result icon"/>`
}

goToGiveaway(){
let event = new CustomEvent('giveawayEvent', {});
this.dispatchEvent(event);
}

render() {
return html`
<div class="${classMap(this.decideClasses())}" @click=${() => this.bubbleEvent()}>
<div class="left">
${this.decideIcon()}
<p>${this.fix}</p>

${this.giveaway ?
html`
<span
class="arrow_anchor"
@click=${() => this.goToGiveaway()}
>
<p class="arrow_link">Check Now</p>
<img
class="arrow"
src="/assets/new/arrow.svg"
alt="arrow"
/>
</span>
` :
html``
}

</div>

${manifest_fields[this.field] ?
Expand All @@ -262,4 +226,3 @@ export class TodoItem extends LitElement {
const yield_src = "/assets/new/yield.svg";
const stop_src = "/assets/new/stop.svg";
const retest_src = "/assets/new/retest-black.svg";
const giveaway_src = "/assets/new/msft_store_giveaway.svg";
45 changes: 4 additions & 41 deletions apps/pwabuilder/src/script/pages/app-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1834,19 +1834,6 @@ export class AppReport extends LitElement {
this.todoItems = [];
if (findersResults.manifestTodos.length){
this.todoItems.push(...findersResults.manifestTodos)

// adding todo for token giveaway item if theres at least a manifest
if(!this.createdManifest && this.tokensCampaign){
this.todoItems.push(
{
"card": "giveaway",
"field": "giveaway",
"fix": `Your PWA may qualify for a free Microsoft Store developer account.`,
"status": "giveaway",
"displayString": `Your PWA may qualify for a free Microsoft Store developer account`
}
);
}
}
else {
this.todoItems.push(...await this.testManifest());
Expand Down Expand Up @@ -1914,19 +1901,6 @@ export class AppReport extends LitElement {



// adding todo for token giveaway item if theres at least a manifest
if(!this.createdManifest && this.tokensCampaign){
this.todoItems.push(
{
"card": "giveaway",
"field": "giveaway",
"fix": `Your PWA may qualify for a free Microsoft Store developer account.`,
"status": "giveaway",
"displayString": `Your PWA may qualify for a free Microsoft Store developer account`
}
);
}

if(this.manifestRequiredCounter > 0){
this.canPackageList[0] = false;
} else {
Expand Down Expand Up @@ -2403,10 +2377,9 @@ export class AppReport extends LitElement {
"retest": 0,
"missing": 1,
"required": 2,
"giveaway": 3,
"highly recommended": 4,
"recommended": 5,
"optional": 6
"highly recommended": 3,
"recommended": 4,
"optional": 5
};
this.todoItems.sort((a, b) => {
if (rank[a.status] < rank[b.status]) {
Expand Down Expand Up @@ -2517,16 +2490,6 @@ export class AppReport extends LitElement {

}

goToGiveawayPage(){
recordPWABuilderProcessStep("free_token_check_now_clicked", AnalyticsBehavior.ProcessCheckpoint);
let a: HTMLAnchorElement = document.createElement("a");
a.target = "_blank";
a.href = `${window.location.protocol}//${window.location.host}/freeToken?site=${this.siteURL}`;
a.rel = "noopener";

a.click();
}

closeTooltipOnScroll() {
if(this.openTooltips.length > 0){
this.openTooltips[0].hide();
Expand Down Expand Up @@ -2695,7 +2658,7 @@ export class AppReport extends LitElement {
@todo-clicked=${(e: CustomEvent) => this.animateItem(e)}
@open-manifest-editor=${(e: CustomEvent) => this.openManifestEditorModal(e.detail.field, e.detail.tab)}
@trigger-hover=${(e: CustomEvent) => this.handleShowingTooltip(e)}
@giveawayEvent=${() => this.goToGiveawayPage()}>
>

</todo-item>`
) : html`<span class="loader"></span>`}
Expand Down
Loading