This file contains hidden or 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
import Controller from '@ember/controller'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action } from '@ember/object'; | |
import validationState, { validate } from 'ember-validation-state'; | |
import { task } from 'ember-concurrency-decorators'; | |
import { timeout } from 'ember-concurrency'; | |
const validators = { | |
username: [validate('presence', { presence: true })], | |
password: [ |
This file contains hidden or 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
/** | |
* @description Declares a one-way read-only component property, which reads from `this.args` | |
* and falls back to default declared on the class property. | |
* @export | |
* @returns {ClassProperty} | |
*/ | |
export default function arg(target, property, descriptor) { | |
let _value; | |
if (descriptor.initializer !== null) { |
This file contains hidden or 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
import { task, timeout } from 'ember-concurrency'; | |
import Config from 'app/config/environment'; | |
const DEFAULT_POLL_MS = 20000; // 20 sec | |
export function pollTask(_requestTask, pollMs = DEFAULT_POLL_MS) { | |
const taskProperty = task(_requestTask).restartable(); | |
const ogTaskFn = taskProperty.taskFn; | |
taskProperty.taskFn = function*(...args) { |
This file contains hidden or 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
license: mit |
This file contains hidden or 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
import Controller from '@ember/controller'; | |
import { inject as service } from '@ember/service'; | |
export default Controller.extend({ | |
confirmAction: service(), | |
api: service(), | |
async deleteRecord(record) { | |
try { | |
const result = await this.confirmAction.ask({ |
This file contains hidden or 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
import Service from '@ember/service'; | |
import { setProperties } from '@ember/object'; | |
import { defer } from 'rsvp'; | |
export default Service.extend({ | |
showPrompt: false, | |
title: null, | |
message: null, | |
_deferred: null, |
This file contains hidden or 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
<Input | |
shouldShowLabel={false} | |
// labelText=”Username” - Still don't need this | |
value={this.state.username} | |
inputStyle={{ padding: ‘12px’ }} | |
wrapperStyle={{ marginBottom: ‘30px’ }} | |
onChange={this.updateUsername} | |
/> |
This file contains hidden or 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
<Input | |
shouldShowLabel={false} | |
// labelText="Username" - Don't need this anymore | |
value={this.state.username} | |
style={{ marginBottom: '30px' }} | |
onChange={this.updateUsername} | |
/> |
This file contains hidden or 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
<Input | |
labelText="Username" | |
value={this.state.username} | |
onChange={this.updateUsername} | |
/> |
NewerOlder