-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Output Actions: Auto-Save, Save, Preview & Gist (#1868)
* Introduced a new `save-button` component to simplify and separate save functionality from `action-button`. * WIP - Detaching Preview outputs from AutoSave * Repository sync * Sync repository * Updating tests * Repository sync * Achieve the global threshold coverage for branches. - Added shouldSkipRefreshTerminal method to handle terminal refresh conditions. - Updated refreshTerminal method to use shouldSkipRefreshTerminal. - Added unit tests for shouldSkipRefreshTerminal and refreshTerminal methods. * extract notebook outputs preview into separate command * Update shouldWriteOutputs logic to handle edge cases
- Loading branch information
Showing
18 changed files
with
229 additions
and
113 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
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { LitElement, html } from 'lit' | ||
import { customElement, property } from 'lit/decorators.js' | ||
|
||
import './actionButton' | ||
|
||
@customElement('save-button') | ||
export class SaveButton extends LitElement { | ||
@property({ type: Boolean, reflect: true }) | ||
loading: boolean = false | ||
|
||
@property({ type: Boolean, reflect: true }) | ||
signedIn: boolean = false | ||
|
||
private handleClick(e: Event) { | ||
if (e.defaultPrevented) { | ||
e.preventDefault() | ||
} | ||
|
||
this.dispatchEvent(new CustomEvent('onClick')) | ||
} | ||
|
||
render() { | ||
let text = this.signedIn ? 'Save' : 'Save to Cloud' | ||
|
||
return html` | ||
<action-button | ||
?loading=${this.loading} | ||
text="${text}" | ||
?saveIcon=${true} | ||
@onClick="${this.handleClick}" | ||
> | ||
</action-button> | ||
` | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { LitElement, html } from 'lit' | ||
import { customElement, property } from 'lit/decorators.js' | ||
|
||
import './actionButton' | ||
|
||
@customElement('share-button') | ||
export class ShareButton extends LitElement { | ||
@property({ type: Boolean, reflect: true }) | ||
loading: boolean = false | ||
|
||
private handleClick(e: Event) { | ||
if (e.defaultPrevented) { | ||
e.preventDefault() | ||
} | ||
|
||
this.dispatchEvent(new CustomEvent('onClick')) | ||
} | ||
|
||
render() { | ||
return html` | ||
<action-button | ||
?loading=${this.loading} | ||
text="Share" | ||
?shareIcon=${true} | ||
@onClick="${this.handleClick}" | ||
> | ||
</action-button> | ||
` | ||
} | ||
} |
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
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
Oops, something went wrong.