Conversation
|
No code can be merged until the license issue is resolved. |
app/controllers/tasks.js
Outdated
| export default Controller.extend({ | ||
| organizations: inject(), | ||
| queryParams: ['org'], | ||
|
|
app/templates/tasks.hbs
Outdated
| {{#link-to (query-params org=slug)}} | ||
| {{org.name}} | ||
| {{/link-to}} | ||
| </li> |
There was a problem hiding this comment.
Nope, i will change. That's silly mistake
app/utils/task-utils.js
Outdated
| @@ -0,0 +1,9 @@ | |||
| export const getTrackerIdentifiers = (org, trackerType) => { | |||
| if(org && org.trackers){ | |||
app/services/user-settings.js
Outdated
| const settings = getObject(SETTINGS_KEY) || {}; | ||
|
|
||
| // Only set property defined in PROPERTIES | ||
| for(let property of PROPERTIES) { |
There was a problem hiding this comment.
You've got some for loops with a space between the for and the opening parenthesis, and some without. Should be fixed with the .coafile, but I believe we usually go with a space.
There was a problem hiding this comment.
@bekicot You should've added style rules to .eslintrc like I said
app/routes/tasks/gitlab.js
Outdated
| store: inject(), | ||
| model() { | ||
| const store = this.get('store'); | ||
| return this.get('gitlab').tasks({projects: ['coala/mobans']}).then(data => { |
There was a problem hiding this comment.
why does this have a coala specific project reference in here?
| </p> | ||
| <ul class="menu-list"> | ||
| {{#each-in organizations.list as |slug org| }} | ||
| {{#each-in organizations.list as |slug org|}} |
There was a problem hiding this comment.
this should be fix in the first PR, if it is important
see #33 (comment)
app/services/gitlab.js
Outdated
| _issueUrl: '', | ||
| init() { | ||
| this._super(...arguments); | ||
| this.set('headers', {'Private-Token': 'sVfZzagWtemrV-suxYK-'}); |
app/services/gitlab.js
Outdated
| let tasks = projects.map((projectId) => { | ||
| const embedRepoInfo = (tasks) => { | ||
| return new Promise((resolve, reject) => { | ||
| this.fetchRepositoryInfo(projectId).then((repoInfo) => { |
There was a problem hiding this comment.
A promise can be chained, no need to explicitly make Promise
app/services/gitlab.js
Outdated
| const embedRepoInfo = (tasks) => { | ||
| return new Promise((resolve, reject) => { | ||
| this.fetchRepositoryInfo(projectId).then((repoInfo) => { | ||
| tasks.map((task) => { |
There was a problem hiding this comment.
if you return tasks.map the result will be in the resolved Promise.
app/services/gitlab.js
Outdated
| task.type = 'gitlab-task'; | ||
| return task; | ||
| }) | ||
| resolve(tasks) |
There was a problem hiding this comment.
And this doesn't return the mapped tasks because map creates new array not modify it.
There was a problem hiding this comment.
Actually it does, but .forEach is more appropriate than .map
app/serializers/gitlab-task.js
Outdated
| task.repository.nameWithOwner = payload.repository.path_with_namespace | ||
| task.repository.url = payload.repository.web_url | ||
|
|
||
| task.isPullRequest = payload._type == 'PullRequest'; |
andrewda
left a comment
There was a problem hiding this comment.
There's still quite a few styling things that would be easily caught and fixed with eslint
app/components/task-item.js
Outdated
| formatHref: function (href, type) { | ||
| if (type === 'mention') { | ||
| href = 'https://github.com/' + | ||
| href.substring(1); |
There was a problem hiding this comment.
This shouldn't be over the limit, why split into multiple lines?
There was a problem hiding this comment.
No reason, you are right.
| validate: { | ||
| url: function (value) { | ||
| return /^(http|ftp)s?:\/\//.test(value); | ||
| }, |
There was a problem hiding this comment.
Can be a pretty arrow function:
url: (value) => /^(http|ftp)s?:\/\//.test(value),
app/components/task-item.js
Outdated
| return /^(http|ftp)s?:\/\//.test(value); | ||
| }, | ||
| }, | ||
| formatHref: function (href, type) { |
There was a problem hiding this comment.
This can also be an arrow function. Doesn't have much benefit besides consistency, but that's pretty important.
app/controllers/tasks.js
Outdated
| export default Controller.extend({ | ||
| organizations: inject(), | ||
| queryParams: ['org'], | ||
|
|
app/graphql/github.js
Outdated
|
|
||
| export const queryBuilder = function queryBuilder({orgs}) { | ||
| let queries = ['sort:updated-desc', 'state:open']; | ||
| if(isIterable(orgs)) { |
There was a problem hiding this comment.
Space after if (at least that's how you've been doing it everywhere else). Not sure what the progress is yet on an eslint?
app/routes/application.js
Outdated
| controller.set('organizations', organizationList); | ||
| controller.set('searchParams', model.q) | ||
| // show modal when user has no github token | ||
| if(!this.userSettings.get('githubTokenModalSeen')) |
| @@ -0,0 +1,3 @@ | |||
| import Service from '@ember/service'; | |||
| export default Service.extend({ | |||
| }); | |||
There was a problem hiding this comment.
Doesn't match formatting of similar files
app/utils/storage.js
Outdated
| @@ -0,0 +1,12 @@ | |||
| export const setObject = function(key, value) { | |||
| localStorage.setItem(key, JSON.stringify(value)); | |||
| }; | |||
app/utils/storage.js
Outdated
| localStorage.setItem(key, JSON.stringify(value)); | ||
| }; | ||
|
|
||
| export const getObject = function(key) { |
app/routes/tasks/github.js
Outdated
|
|
||
| let tasks = github.tasks({orgs: identifiers}); | ||
| tasks.then((data) => { | ||
| data.forEach(function(task) { |
There was a problem hiding this comment.
This should definitely be an arrow function
3704f11 to
1b502d7
Compare
app/controllers/tasks.js
Outdated
| export default Controller.extend({ | ||
| organizations: inject(), | ||
| queryParams: ['org'], | ||
|
|
app/services/gitlab.js
Outdated
| @@ -0,0 +1,50 @@ | |||
| // https://gitlab.com/api/v4/projects/coala%2Fmobans/issues?order_by=created_at&state=opened | |||
app/services/gitlab.js
Outdated
| _issueUrl: '', | ||
| init(...arg) { | ||
| this._super(...arg); | ||
| this.set('headers', { 'Private-Token': 'sVfZzagWtemrV-suxYK-' }); |
app/services/gitlab.js
Outdated
| _issueUrl: '', | ||
| init(...arg) { | ||
| this._super(...arg); | ||
| this.set('headers', { 'Private-Token': 'sVfZzagWtemrV-suxYK-' }); |
| { | ||
| type: 'gitlab', | ||
| identifier: 'coala', | ||
| identifier: 'coala/mobans', |
There was a problem hiding this comment.
This is obviously wrong, as it is not an org identifier. It is a project identifier.
This is not too different from the problem I raised in the PR a month ago.
#44 (comment)
fetchGitlabProjects still doesnt get the projects for the org.
There was a problem hiding this comment.
Identifier in gitlab currently only support per repository, however, in github, only support per organization.
In gitlab, supporting per org, will make multiple request.
It fit nicely with wikidata where, it already support github organization, but not gitlab. It can be identified via issue tracker used, which is currently support full link.
101c4b0 to
ea3fc0a
Compare
Move GitHub Tasks to github namespace `/tasks/github` Add a new gitlab route `/tasks/gitlab` Add a new gitlab serializer Closes coala#38
No description provided.