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

Create Share and GetConnected apps #622

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

fortuna
Copy link
Collaborator

@fortuna fortuna commented Apr 27, 2020

This PR makes progress and is an example of:

  • How we can move more logic from Javascript to Typescript
  • How we can move logic away from App and AppRoot, which are huge

The impact of this change is not huge, but we will see a much bigger impact if we use a similar pattern in larger components, like the server view.

cc: @JonathanDCohen @mpmcroy

@fortuna fortuna requested a review from alalamav April 27, 2020 00:45
@fortuna fortuna self-assigned this Apr 27, 2020
export class GetConnectedApp {
constructor(private dialog: polymer.Base) {
// Get connected is not a Polymer component, so we use `querySelector()` instead of `dialog.$`.
dialog.querySelector('#closeGetConnectedButton')
Copy link
Contributor

Choose a reason for hiding this comment

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

getConnectedDialog is a paper-dialog and you're passing a polymer.Base object, so it's not clear to me why dialog is not a Polymer component.

@@ -145,6 +147,9 @@ export class App {
private digitalOceanTokenManager: TokenManager, private surveys: Surveys) {
appRoot.setAttribute('outline-version', this.version);

const shareApp = new ShareDialogApp(appRoot.$.shareDialog);
const getConnectedApp = new GetConnectedApp(appRoot.$.getConnectedDialog);
Copy link
Contributor

@alalamav alalamav Apr 27, 2020

Choose a reason for hiding this comment

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

nit: s/App/Controller. I think app is not as intuitive to understand the relationship of the class with the view element.

@fortuna fortuna changed the base branch from fortuna-cleanup-3 to master April 27, 2020 22:27
@fortuna fortuna marked this pull request as draft April 30, 2020 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants