-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): get experiment link dynamically and add tests for embed menu
- Loading branch information
Showing
8 changed files
with
46 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 15 additions & 15 deletions
30
...nix-ng/projects/phoenix-ui-components/src/components/embed-menu/embed-menu.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#embedMenu { | ||
display: none; | ||
|
||
#embedMenuInner { | ||
display: flex; | ||
position: absolute; | ||
left: 1rem; | ||
bottom: 1rem; | ||
background: var(--phoenix-background-color-secondary); | ||
border: 1px solid var(--phoenix-background-color-tertiary); | ||
box-shadow: var(--phoenix-box-shadow); | ||
border-radius: 30px; | ||
padding: 0.25rem 0; | ||
} | ||
} | ||
#embedMenu { | ||
display: none; | ||
|
||
#embedMenuInner { | ||
display: flex; | ||
position: absolute; | ||
left: 1rem; | ||
bottom: 1rem; | ||
background: var(--phoenix-background-color-secondary); | ||
border: 1px solid var(--phoenix-background-color-tertiary); | ||
box-shadow: var(--phoenix-box-shadow); | ||
border-radius: 30px; | ||
padding: 0.25rem 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...oenix-ng/projects/phoenix-ui-components/src/components/embed-menu/embed-menu.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-embed-menu', | ||
templateUrl: './embed-menu.component.html', | ||
styleUrls: ['./embed-menu.component.scss'], | ||
}) | ||
export class EmbedMenuComponent { | ||
@Input() experimentLink: string; | ||
} | ||
export class EmbedMenuComponent {} |
1 change: 0 additions & 1 deletion
1
...ix-ui-components/src/components/embed-menu/experiment-link/experiment-link.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
...enix-ui-components/src/components/embed-menu/experiment-link/experiment-link.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-experiment-link', | ||
templateUrl: './experiment-link.component.html', | ||
styleUrls: ['./experiment-link.component.scss'], | ||
}) | ||
export class ExperimentLinkComponent { | ||
@Input() experimentLink: string; | ||
export class ExperimentLinkComponent implements OnInit { | ||
private experimentLink: string; | ||
|
||
ngOnInit() { | ||
this.experimentLink = window.location.href.split('?')[0]; | ||
} | ||
|
||
goToExperiment() { | ||
window.open('this.experimentLink', '_blank'); | ||
window.open(this.experimentLink, '_blank'); | ||
} | ||
} |