Skip to content

Use GraphQL for GitHub #33

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,24 @@ module.exports = {
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
'plugin:ember/recommended',
'airbnb-base'
],
env: {
browser: true
},
rules: {
// This rule has no support for @ember import system.
// Ember build have their own mechanism to managing dependency.
// Ember build will raise error on build if there is an import error.
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
// Ember use underscore dangling, e.g _super. Which is enforced by ember's
// own linter to be used on init() method.
'no-underscore-dangle': 'off',
// Ember Routes and tests utilize `this` inside their callback.
'prefer-arrow-callback': 'off',
},
overrides: [
// node files
Expand Down
18 changes: 15 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,15 @@ typings/
# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

Expand Down Expand Up @@ -222,7 +228,8 @@ flycheck_*.el
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Expand Down Expand Up @@ -261,8 +268,7 @@ tags
.idea/**/libraries

# CMake
cmake-build-debug/
cmake-build-release/
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml
Expand Down Expand Up @@ -419,6 +425,9 @@ local.properties
# Code Recommenders
.recommenders/

# Annotation Processing
.apt_generated/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
Expand Down Expand Up @@ -451,3 +460,6 @@ cscope.po.out
*.patch
*.orig
*.diff

# Pytest profile files
prof/
12 changes: 0 additions & 12 deletions app/adapters/application.js

This file was deleted.

25 changes: 0 additions & 25 deletions app/adapters/issue.js

This file was deleted.

14 changes: 0 additions & 14 deletions app/adapters/repository.js

This file was deleted.

4 changes: 2 additions & 2 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Application from '@ember/application';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import Resolver from './resolver';
import config from './config/environment';

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

loadInitializers(App, config.modulePrefix);
Expand Down
12 changes: 0 additions & 12 deletions app/components/search-card.js

This file was deleted.

28 changes: 28 additions & 0 deletions app/components/settings-modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Component from '@ember/component';
import { oneWay } from '@ember/object/computed';
import { inject } from '@ember/service';

export default Component.extend({
// Services
userSettings: inject(),

// Properties
token_github_com: oneWay('userSettings.tokens.github_com'),

init(...args) {
this._super(...args);
},
actions: {
hideModal() {
this.set('isActive', false);
this.userSettings.setSetting('githubTokenModalSeen', true);
},
saveSettings() {
this.userSettings.setToken('github_com', this.get('token_github_com'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect the modal to be closed after hitting "Save"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page is expected to have long list of token info when githlab ce is supported. Which is next phase. Save and close no longer be expected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I don't understand.

I imagine it would be like this:

  • Show modal with 2 input, GitHub token & GitLab token
  • User either fill all of them, or just one, no problem
  • User click save, the modal is closed
  • Show the tasks from both platform if user filled all tokens, otherwise show from whatever platform that has token.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely I should add it now. My thought was "When supporting GitHub CE", there will be > 5 inputs, one for each orgs copy and pasting and switch tab is expected user may want to save and then go back to another github ce website to copy token.

I realize that would be a very rare case that people will have account in those 5 repository. I shouldn't think to far for that. Anyway, it was easier to not do that in the code. 😄 .

I will add that.

Copy link
Member

@blazeu blazeu Jun 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean GitLab CE/GitHub EE/self-hosted? I haven't thought of that :)

But surely it's the same deal, and if there is like >5 inputs, I don't want to hit save after filling each input, I just want to hit it once after filling the token I needed, and then use the app.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An annoying thing about the modal is that when it is opened a second time and then closed, the fetched issue list is lost , requiring a refetch. Is that fixable without much effort?

this.set('isActive', false);
},
},
classNames: ['modal'],
classNameBindings: ['isActive'],
isActive: false,
});
31 changes: 31 additions & 0 deletions app/components/task-item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Component from '@ember/component';
import { calculateForegroundColor } from '../utils/label-utils';

export default Component.extend({
init(...args) {
this._super(...args);
},
didReceiveAttrs() {
this.get('task').labels.map((label) => {
const decoratedLabel = label;
decoratedLabel.fontColor = calculateForegroundColor(label.color);
return decoratedLabel;
});
},
didInsertElement() {
this.$().linkify({
validate: {
url(value) {
return /^(http|ftp)s?:\/\//.test(value);
},
},
formatHref(href, type) {
if (type === 'mention') {
return `https://github.com/${
href.substring(1)}`;
}
return href;
},
});
},
});
13 changes: 3 additions & 10 deletions app/controllers/application.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import Controller from '@ember/controller';

export default Controller.extend({
toggleSidenav: true,
actions: {
searchIssues(query) {
this.transitionToRoute('issues', { queryParams: { q: query } });
showSettingsModal() {
this.set('showModal', true);
},
toggleSidenav() {
return this.set('toggleSidenav', !this.get('toggleSidenav'));
},
searchByOrg(org) {
this.send('searchIssues', org.query.q);
}
}
},
});
26 changes: 0 additions & 26 deletions app/controllers/issues.js

This file was deleted.

7 changes: 7 additions & 0 deletions app/controllers/tasks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Controller from '@ember/controller';
import { inject } from '@ember/service';

export default Controller.extend({
organizations: inject(),
queryParams: ['org'],
});
108 changes: 108 additions & 0 deletions app/data/organizations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
export default {
coala: {
name: 'coala association e.V.',
trackers: [
{
type: 'github',
identifier: 'coala',
defaultLabels: [
'difficulty/newcomer',
],
},
{
type: 'gitlab',
identifier: 'coala',
},
],
},
'52-north-initiative-for-geospatial-open-source-software-gmbh': {
name: '52° North Initiative for Geospatial Open Source Software GmbH',
trackers: [
{
type: 'github',
identifier: '52North',
},
],
},
discourse: {
name: 'Discourse',
trackers: [
{
type: 'github',
identifier: 'discourse',
},
],
},
wikimedia: {
name: 'Wikimedia',
trackers: [
{
type: 'github',
identifier: 'wikimedia',
},
],
},
opensuse: {
name: 'Opensuse',
trackers: [
{
type: 'github',
identifier: 'opensuse',
},
],
},
elm: {
name: 'Elm',
trackers: [
{
type: 'github',
identifier: 'elm-lang',
},
],
},
cadasta: {
name: 'Cadasta',
trackers: [
{
type: 'github',
identifier: 'cadasta',
},
],
},
enketo: {
name: 'Enketo',
trackers: [
{
type: 'github',
identifier: 'enketo',
},
],
},
kobotoolbox: {
name: 'Kobotoolbox',
trackers: [
{
type: 'github',
identifier: 'kobotoolbox',
},
],
},
movingblocks: {
name: 'Movingblocks',
trackers: [
{
type: 'github',
identifier: 'movingblocks',
},
],
},
nexB: {
name: 'Nexb',
trackers: [
{
type: 'github',
identifier: 'nexB',
},
],
},
};
Loading