Skip to content
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

Upgrade Ember and deps to 3.18/Octane #186

Merged
merged 15 commits into from
May 11, 2020
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
16 changes: 12 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
globals: {
console: true
Expand All @@ -19,7 +25,10 @@ module.exports = {
},
rules: {
'ember/avoid-leaking-state-in-ember-objects': 'warn',
'no-console': 'off'
'no-console': 'off',
'ember/no-jquery': 'error',
'ember/require-computed-property-dependencies': 'warn',
'ember/no-observers': 'warn'
},
overrides: [
// node files
Expand All @@ -35,8 +44,7 @@ module.exports = {
'server/**/*.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
sourceType: 'script'
},
env: {
browser: false,
Expand Down
87 changes: 85 additions & 2 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,93 @@
'use strict';

module.exports = {
extends: 'recommended',
extends: 'octane',

rules: {
'simple-unless': false,
'no-nested-interactive': false
}
},

ignore: [
'kredits-web/templates/components/**',
'app/templates/components/**'
],

pending: [
{
"moduleId": "app/templates/dashboard",
"only": [
"no-action"
]
},
{
"moduleId": "app/components/add-contribution/template",
"only": [
"no-action",
"no-curly-component-invocation"
]
},
{
"moduleId": "app/components/add-contributor/template",
"only": [
"no-action",
"no-curly-component-invocation"
]
},
{
"moduleId": "app/components/contribution-list/template",
"only": [
"no-action",
"no-curly-component-invocation"
]
},
{
"moduleId": "app/components/contributor-list/template",
"only": [
"no-action"
]
},
{
"moduleId": "app/components/topbar-account-panel/template",
"only": [
"no-action"
]
},
{
"moduleId": "app/templates/contributions/new",
"only": [
"no-action"
]
},
{
"moduleId": "app/templates/contributions/resubmit",
"only": [
"no-action"
]
},
{
"moduleId": "app/templates/contributors/edit",
"only": [
"no-action"
]
},
{
"moduleId": "app/templates/contributors/new",
"only": [
"no-action"
]
},
{
"moduleId": "app/templates/signup/eth-account",
"only": [
"no-action"
]
},
{
"moduleId": "app/templates/signup/index",
"only": [
"no-action"
]
}
]
};
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ env:
# See https://git.io/vdao3 for details.
- JOBS=1

branches:
only:
- master

script:
- npm run lint:hbs
- npm run lint:js
- npm test
14 changes: 6 additions & 8 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Application from '@ember/application';
import Resolver from './resolver';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
});
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}

loadInitializers(App, config.modulePrefix);

export default App;
4 changes: 3 additions & 1 deletion app/components/add-contribution/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export default Component.extend({

actions: {

submit () {
submit (evt) {
evt.preventDefault();

if (!this.isValid) {
alert('Invalid data. Please review and try again.');
return;
Expand Down
50 changes: 25 additions & 25 deletions app/components/add-contribution/template.hbs
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<form {{action "submit" on="submit"}}>
<form onsubmit={{action "submit"}}>
<label>
<p class="label">Contributor:</p>
<p>
<select required onchange={{action (mut contributorId) value="target.value"}}>
<select required onchange={{action (mut this.contributorId) value="target.value"}}>
<option value="" selected disabled hidden></option>
{{#each contributors as |contributor|}}
<option value={{contributor.id}} selected={{eq contributorId contributor.id}}>{{contributor.name}}</option>
{{#each @contributors as |contributor|}}
<option value={{contributor.id}} selected={{eq this.contributorId contributor.id}}>{{contributor.name}}</option>
{{/each}}
</select>
</p>
</label>
<label>
<p class="label">Kind:</p>
<p>
<select required onchange={{action (mut kind) value="target.value"}}>
<select required onchange={{action (mut this.kind) value="target.value"}}>
<option value="" selected disabled hidden></option>
<option value="community" selected={{eq kind "community"}}>Community</option>
<option value="design" selected={{eq kind "design"}}>Design</option>
<option value="dev" selected={{eq kind "dev"}}>Development</option>
<option value="docs" selected={{eq kind "docs"}}>Documentation</option>
<option value="ops" selected={{eq kind "ops"}}>IT Operations</option>
<option value="special" selected={{eq kind "special"}}>Special</option>
<option value="community" selected={{eq this.kind "community"}}>Community</option>
<option value="design" selected={{eq this.kind "design"}}>Design</option>
<option value="dev" selected={{eq this.kind "dev"}}>Development</option>
<option value="docs" selected={{eq this.kind "docs"}}>Documentation</option>
<option value="ops" selected={{eq this.kind "ops"}}>IT Operations</option>
<option value="special" selected={{eq this.kind "special"}}>Special</option>
</select>
</p>
</label>
<label>
<p class="label">Date:</p>
<p>
{{ember-flatpickr
date=date
defaultDate=defaultDate
maxDate=defaultDate
date=this.date
defaultDate=this.defaultDate
maxDate=this.defaultDate
enableTime=true
time_24hr=true
onChange=(action (mut date))
onChange=(action (mut this.date))
}}
</p>
</label>
Expand All @@ -42,42 +42,42 @@
<p>
{{input type="text"
placeholder="500"
value=amount
class=(if isValidAmount "valid" "")}}
value=this.amount
class=(if this.isValidAmount "valid" "")}}
</p>
</label>
<label>
<p class="label">Description:</p>
<p>
{{input type="text"
value=description
class=(if isValidDescription "valid" "")}}
value=this.description
class=(if this.isValidDescription "valid" "")}}
</p>
</label>
<label>
<p class="label">URL (optional):</p>
<p>
{{input type="text"
value=url
class=(if isValidUrl "valid" "")}}
value=this.url
class=(if this.isValidUrl "valid" "")}}
</p>
</label>

{{#if details}}
{{#if this.details}}
<label>
<p class="label">Details:</p>
<p>
<pre>
{{details}}
{{this.details}}
</pre>
</p>
</label>
{{/if}}

<p class="actions">
{{input type="submit"
disabled=inProgress
value=(if inProgress "Processing" "Save")}}
disabled=this.inProgress
value=(if this.inProgress "Processing" "Save")}}
</p>
</form>

12 changes: 9 additions & 3 deletions app/components/add-contributor/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { isAddress } from 'web3-utils';

export default Component.extend({

kredits: service(),
router: service(),
kredits: service(),

attributes: null,

Expand Down Expand Up @@ -60,9 +60,15 @@ export default Component.extend({

actions: {

submit () {
submit (evt) {
evt.preventDefault();

if (!this.kredits.currentUserIsCore) {
window.alert('Only core team members can edit profiles. Please ask someone to set you up.');
return;
}
if (!this.isValid) {
alert('Invalid data. Please review and try again.');
window.alert('Invalid data. Please review and try again.');
return;
}

Expand Down
Loading