-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
refactor: octane dummy app files #474
Merged
patocallaghan
merged 11 commits into
adopted-ember-addons:master
from
Techn1x:native-class-dummy-app
Dec 6, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c0dca41
refactor: native class for some dummy app files
Techn1x 56bef4e
fix: typo
Techn1x a6f3a31
refactor: dummy models to native class
Techn1x 7d05124
refactor: more dummy models to native class
Techn1x 4c0a44f
refactor: remaining dummy models to native class
Techn1x 6f10926
refactor: more octane updates
Techn1x da78454
refactor: angle bracket templates
Techn1x c32425c
refactor: native class transforms
Techn1x 264c63b
refactor: native class serializers
Techn1x de990e6
refactor: native class for dummy application adapter too
Techn1x 097f6a7
refactor: native class for readme too
Techn1x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will conflict with the removal of AdapterFetch
#464
But whoever merges last can handle the conflct