-
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: octane dummy app files (#474)
refactor: native class for some dummy app files
- Loading branch information
Showing
66 changed files
with
312 additions
and
303 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import Controller from '@ember/controller'; | ||
export default Controller.extend(); | ||
export default class extends Controller {} |
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,11 @@ | ||
import Controller from '@ember/controller'; | ||
|
||
export default class extends Controller { | ||
get previousPage() { | ||
return this.model.meta?.previous; | ||
} | ||
|
||
get nextPage() { | ||
return this.model.meta?.next; | ||
} | ||
} |
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,9 +1,9 @@ | ||
import Controller from '@ember/controller'; | ||
import { action } from '@ember/object'; | ||
|
||
export default Controller.extend({ | ||
actions: { | ||
deleteUser(user) { | ||
return user.destroyRecord(); | ||
}, | ||
}, | ||
}); | ||
export default class extends Controller { | ||
@action | ||
deleteUser(user) { | ||
return user.destroyRecord(); | ||
} | ||
} |
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,6 +1,6 @@ | ||
import Group from './group'; | ||
import { attr } from '@ember-data/model'; | ||
|
||
export default Group.extend({ | ||
type: attr('string', { defaultValue: 'BigGroup' }), | ||
}); | ||
export default class extends Group { | ||
@attr('string', { defaultValue: 'BigGroup' }) type; | ||
} |
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,6 +1,6 @@ | ||
import Hat from './hat'; | ||
import { hasMany } from '@ember-data/model'; | ||
|
||
export default Hat.extend({ | ||
materials: hasMany('soft-material', { async: false }), | ||
}); | ||
export default class extends Hat { | ||
@hasMany('soft-material', { async: false }) materials; | ||
} |
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,6 +1,6 @@ | ||
import { attr } from '@ember-data/model'; | ||
import Address from 'dummy/models/nested-fragment/address'; | ||
|
||
export default Address.extend({ | ||
billingAddressProperty: attr('number'), | ||
}); | ||
export default class extends Address { | ||
@attr('number') billingAddressProperty; | ||
} |
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,7 +1,7 @@ | ||
import Model, { attr } from '@ember-data/model'; | ||
|
||
export default Model.extend({ | ||
type: attr('string'), | ||
name: attr('string'), | ||
friend: attr('string'), | ||
}); | ||
export default class extends Model { | ||
@attr('string') type; | ||
@attr('string') name; | ||
@attr('string') friend; | ||
} |
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,8 +1,8 @@ | ||
import Model, { attr, hasMany, belongsTo } from '@ember-data/model'; | ||
|
||
export default Model.extend({ | ||
name: attr('string'), | ||
company: belongsTo('company'), | ||
characters: hasMany('person', { polymorphic: true }), | ||
includedVillains: hasMany('villain'), | ||
}); | ||
export default class extends Model { | ||
@attr('string') name; | ||
@belongsTo('company') company; | ||
@hasMany('person', { polymorphic: true }) characters; | ||
@hasMany('villain') includedVillains; | ||
} |
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,9 +1,9 @@ | ||
import Model, { attr, hasMany, belongsTo } from '@ember-data/model'; | ||
|
||
export default Model.extend({ | ||
type: attr('string', { defaultValue: 'Company' }), | ||
name: attr('string'), | ||
profile: belongsTo('profile', { async: false }), | ||
users: hasMany('user', { async: true, inverse: 'company' }), | ||
projects: hasMany('project', { async: true }), | ||
}); | ||
export default class extends Model { | ||
@attr('string', { defaultValue: 'Company' }) type; | ||
@attr('string') name; | ||
@belongsTo('profile', { async: false }) profile; | ||
@hasMany('user', { async: true, inverse: 'company' }) users; | ||
@hasMany('project', { async: true }) projects; | ||
} |
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,3 +1,3 @@ | ||
import Stoner from './stoner'; | ||
|
||
export default Stoner.extend(); | ||
export default class extends Stoner {} |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import Model, { attr, belongsTo } from '@ember-data/model'; | ||
|
||
export default Model.extend({ | ||
owner: belongsTo('person'), | ||
dogNumber: attr('string'), | ||
sound: attr('string'), | ||
tag: attr(), // hash | ||
}); | ||
export default class extends Model { | ||
@belongsTo('person') owner; | ||
@attr('string') dogNumber; | ||
@attr('string') sound; | ||
@attr() tag; // hash | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import Model, { attr, hasMany } from '@ember-data/model'; | ||
|
||
export default Model.extend({ | ||
name: attr('string'), | ||
entries: hasMany('entry'), | ||
}); | ||
export default class extends Model { | ||
@attr('string') name; | ||
@hasMany('entry') entries; | ||
} |
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,6 +1,6 @@ | ||
import Model, { attr, belongsTo } from '@ember-data/model'; | ||
|
||
export default Model.extend({ | ||
name: attr('string'), | ||
entryType: belongsTo('entry-type'), | ||
}); | ||
export default class extends Model { | ||
@attr('string') name; | ||
@belongsTo('entry-type') entryType; | ||
} |
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,11 @@ | ||
import Material from './material'; | ||
import { belongsTo } from '@ember-data/model'; | ||
|
||
export default Material.extend({ | ||
hat: belongsTo('hat', { | ||
export default class extends Material { | ||
@belongsTo('hat', { | ||
async: false, | ||
inverse: 'fluffyMaterials', | ||
polymorphic: true, | ||
}), | ||
}); | ||
}) | ||
hat; | ||
} |
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,17 +1,19 @@ | ||
import Model, { attr, hasMany, belongsTo } from '@ember-data/model'; | ||
|
||
export default Model.extend({ | ||
type: attr('string', { defaultValue: 'Group' }), | ||
name: attr('string'), | ||
profiles: hasMany('profile', { async: false, inverse: 'group' }), | ||
versions: hasMany('group', { | ||
export default class extends Model { | ||
@attr('string', { defaultValue: 'Group' }) type; | ||
@attr('string') name; | ||
@hasMany('profile', { async: false, inverse: 'group' }) profiles; | ||
@hasMany('group', { | ||
async: false, | ||
polymorphic: true, | ||
inverse: 'group', | ||
}), | ||
group: belongsTo('group', { | ||
}) | ||
versions; | ||
@belongsTo('group', { | ||
async: false, | ||
polymorphic: true, | ||
inverse: 'versions', | ||
}), | ||
}); | ||
}) | ||
group; | ||
} |
Oops, something went wrong.