-
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.
feat: serialize model settings in QP & add a "save" button
- Loading branch information
Showing
13 changed files
with
234 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Ui::Modal @onHide={{@onHide}}> | ||
<h2 class="uk-modal-title" for="current-url"> | ||
{{t "save_modal.title"}} | ||
</h2> | ||
<p> | ||
{{t "save_modal.info" currentUrl=@currentUrl htmlSafe=true}} | ||
</p> | ||
|
||
<Ui::TextArea {{on "click" this.selectAll}} rows="15" id="current-url" readonly @value={{@currentUrl}} /> | ||
|
||
<button class="uk-button uk-button-primary uk-align-center uk-modal-close" type="button"> | ||
{{t "save_modal.close"}} | ||
</button> | ||
</Ui::Modal> |
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,14 @@ | ||
import Component from '@glimmer/component'; | ||
import { action } from '@ember/object'; | ||
|
||
interface SaveModalArgs { | ||
currentUrl: string; | ||
onHide?: () => void; | ||
} | ||
|
||
export default class SaveModal extends Component<SaveModalArgs> { | ||
@action | ||
selectAll({ target }: { target: HTMLTextAreaElement }) { | ||
target.select(); | ||
} | ||
} |
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,5 @@ | ||
<div ...attributes uk-modal {{this.openModal}} {{on "hide" this.onHide}}> | ||
<div class="uk-modal-dialog uk-modal-body"> | ||
{{yield}} | ||
</div> | ||
</div> |
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,19 @@ | ||
import Component from '@glimmer/component'; | ||
import { modifier } from 'ember-modifier'; | ||
import UIkit from 'uikit'; | ||
import { action } from '@ember/object'; | ||
|
||
interface ModalArgs { | ||
onHide?: () => void; | ||
} | ||
|
||
export default class UiModal extends Component<ModalArgs> { | ||
openModal = modifier((element: HTMLDivElement) => { | ||
UIkit.modal(element).show(); | ||
}); | ||
|
||
@action | ||
onHide() { | ||
this.args.onHide?.(); | ||
} | ||
} |
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
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