Skip to content

Commit

Permalink
Merge branch 'staging' into retina-favicons
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Mar 12, 2019
2 parents d14f701 + f139b5f commit c63b9ec
Show file tree
Hide file tree
Showing 80 changed files with 871 additions and 137 deletions.
50 changes: 50 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"projectName": "altair",
"projectOwner": "imolorhe",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "DaniloCaruso",
"name": "Danilo Caruso",
"avatar_url": "https://avatars1.githubusercontent.com/u/4080177?v=4",
"profile": "https://github.com/DaniloCaruso",
"contributions": [
"translation"
]
},
{
"login": "IgorSzymanski",
"name": "Igor Szymanski",
"avatar_url": "https://avatars0.githubusercontent.com/u/12682069?v=4",
"profile": "https://github.com/IgorSzymanski",
"contributions": [
"translation"
]
},
{
"login": "kporten",
"name": "Kevin Porten",
"avatar_url": "https://avatars2.githubusercontent.com/u/1839345?v=4",
"profile": "https://github.com/kporten",
"contributions": [
"translation"
]
},
{
"login": "disjukr",
"name": "JongChan Choi",
"avatar_url": "https://avatars0.githubusercontent.com/u/690661?v=4",
"profile": "https://0xabcdef.com/",
"contributions": [
"translation"
]
}
],
"contributorsPerLine": 7
}
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build](https://travis-ci.org/imolorhe/altair.svg?branch=master "Travis CI")](https://travis-ci.org/imolorhe/altair)
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors)
[![Build status](https://ci.appveyor.com/api/projects/status/qp69kxnlxntsumdj/branch/staging?svg=true)](https://ci.appveyor.com/project/imolorhe/altair/branch/staging)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fimolorhe%2Faltair.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fimolorhe%2Faltair?ref=badge_shield)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/altair-gql/localized.svg)](https://crowdin.com/project/altair-gql)
Expand Down Expand Up @@ -224,3 +225,15 @@ Support this project by becoming a sponsor. Your logo will show up here with a l

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fimolorhe%2Faltair.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fimolorhe%2Faltair?ref=badge_large)

## Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
| [<img src="https://avatars1.githubusercontent.com/u/4080177?v=4" width="100px;" alt="Danilo Caruso"/><br /><sub><b>Danilo Caruso</b></sub>](https://github.com/DaniloCaruso)<br />[🌍](#translation-DaniloCaruso "Translation") | [<img src="https://avatars0.githubusercontent.com/u/12682069?v=4" width="100px;" alt="Igor Szymanski"/><br /><sub><b>Igor Szymanski</b></sub>](https://github.com/IgorSzymanski)<br />[🌍](#translation-IgorSzymanski "Translation") | [<img src="https://avatars2.githubusercontent.com/u/1839345?v=4" width="100px;" alt="Kevin Porten"/><br /><sub><b>Kevin Porten</b></sub>](https://github.com/kporten)<br />[🌍](#translation-kporten "Translation") | [<img src="https://avatars0.githubusercontent.com/u/690661?v=4" width="100px;" alt="JongChan Choi"/><br /><sub><b>JongChan Choi</b></sub>](https://0xabcdef.com/)<br />[🌍](#translation-disjukr "Translation") |
| :---: | :---: | :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
"styleext": "scss",
"inlineStyle": true
},
"@schematics/angular:directive": {
"prefix": "app"
Expand Down
2 changes: 1 addition & 1 deletion chrome-ext-files/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Altair GraphQL Client",
"short_name": "Altair",
"description": "The only graphQL client you'll ever need.",
"version": "2.1.1",
"version": "2.1.2",
"icons": {
"16": "assets/img/altair_logo_128.png",
"48": "assets/img/altair_logo_128.png",
Expand Down
41 changes: 41 additions & 0 deletions electron/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const Application = require('spectron').Application;
const assert = require('assert');
const path = require('path');

console.log(__dirname);
let electronPath = path.join(__dirname, '../../node_modules', '.bin', 'electron');
const appPath = path.join(__dirname, '../main');
if (process.platform === 'win32') {
electronPath += '.cmd';
}
const app = new Application({
path: electronPath,
args: [appPath],
env: {
ELECTRON_ENABLE_LOGGING: true,
ELECTRON_ENABLE_STACK_DUMPING: true,
NODE_ENV: 'development'
},
startTimeout: 20000,
});

app.start().then(() => {
// Check if the window is visible
return app.browserWindow.isVisible();
}).then((isVisible) => {
// Verify the window is visible
assert.equal(isVisible, true);
}).then(() => {
// Get the window's title
return app.client.getTitle();
}).then((title) => {
// Verify the window's title
assert.equal(title, 'Altair');
}).then(() => {
// Stop the application
return app.stop();
}).catch((error) => {
// Log any failures
console.error('Test failed', error.message);
return app.stop();
})
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "2.1.1",
"version": "2.1.2",
"registry": "https://registry.npmjs.org/",
"npmClient": "yarn"
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "altair",
"productName": "Altair GraphQL Client",
"version": "2.1.1",
"version": "2.1.2",
"license": "MIT",
"author": "Samuel Imolorhe <samuelimolo4real@gmail.com> (https://sirmuel.design/)",
"description": "The best graphQL client you will ever need",
Expand Down Expand Up @@ -107,7 +107,7 @@
"prettier": "^1.14.3",
"rxjs": "^6.3.3",
"sortablejs": "^1.7.0",
"subscriptions-transport-ws": "0.9.14",
"subscriptions-transport-ws": "0.9.16",
"to-snake-case": "^1.0.0",
"uuid": "^3.1.0",
"valid-url": "^1.0.9",
Expand Down Expand Up @@ -142,6 +142,7 @@
"ncp": "^2.0.0",
"ngrx-store-freeze": "^0.2.0",
"protractor": "^5.2.2",
"spectron": "^5.0.0",
"ts-node": "^8.0.3",
"tslint": "^5.9.1",
"typescript": ">=3.1.1 <3.2",
Expand Down
21 changes: 21 additions & 0 deletions packages/altair-express-middleware/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 2 additions & 2 deletions packages/altair-express-middleware/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "altair-express-middleware",
"version": "2.1.1",
"version": "2.1.2",
"description": "Express middleware for altair graphql client",
"main": "./build/index.js",
"types": "./build/index.d.ts",
Expand Down Expand Up @@ -30,7 +30,7 @@
},
"homepage": "https://github.com/imolorhe/altair#readme",
"dependencies": {
"altair-static": "^2.1.1",
"altair-static": "^2.1.2",
"express": "^4.16.2"
},
"devDependencies": {
Expand Down
21 changes: 21 additions & 0 deletions packages/altair-static/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion packages/altair-static/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "altair-static",
"version": "2.1.1",
"version": "2.1.2",
"description": "Static package for altair graphql client",
"main": "./build/index.js",
"types": "./build/index.d.ts",
Expand Down
45 changes: 43 additions & 2 deletions packages/altair-static/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,54 @@ import { readFileSync } from 'fs';
import { resolve } from 'path';

export interface RenderOptions {
/**
* URL to be used as a base for relative URLs
*/
baseURL?: string;

/**
* URL to set as the server endpoint
*/
endpointURL?: string;

/**
* URL to set as the subscription endpoint
*/
subscriptionsEndpoint?: string;

/**
* Initial query to be added
*/
initialQuery?: string;

/**
* Initial variables to be added
*/
initialVariables?: string;

/**
* Initial headers object to be added
* @example
* {
* 'X-GraphQL-Token': 'asd7-237s-2bdk-nsdk4'
* }
*/
initialHeaders?: Object;
}

export const renderAltair = ({ endpointURL, subscriptionsEndpoint, initialQuery, initialVariables }: RenderOptions = {}) => {
const altairHtml = readFileSync(resolve(__dirname, 'dist/index.html'), 'utf8');
export const renderAltair = ({
baseURL = './',
endpointURL,
subscriptionsEndpoint,
initialQuery,
initialVariables,
initialHeaders,
}: RenderOptions = {}) => {
let altairHtml = readFileSync(resolve(__dirname, 'dist/index.html'), 'utf8');

let renderedOptions = '';

altairHtml = altairHtml.replace(/<base.*>/, `<base href="${baseURL}">`);
if (endpointURL) {
renderedOptions += `window.__ALTAIR_ENDPOINT_URL__ = '${endpointURL}';`;
}
Expand All @@ -27,6 +64,10 @@ export const renderAltair = ({ endpointURL, subscriptionsEndpoint, initialQuery,
renderedOptions += `window.__ALTAIR_INITIAL_VARIABLES__ = '${initialVariables}';`;
}

if (initialHeaders) {
renderedOptions += `window.__ALTAIR_INITIAL_HEADERS__ = ${JSON.stringify(initialHeaders)};`;
}

const renderedOptionsInScript = `<script>${renderedOptions}</script>`;
return altairHtml.replace('<body>', `<body>${renderedOptionsInScript}`);
};
Expand Down
21 changes: 21 additions & 0 deletions packages/gatsby-plugin-altair-graphql/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-altair-graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gatsby-plugin-altair-graphql",
"version": "2.1.1",
"version": "2.1.2",
"description": "A gatsby plugin for using Altair GraphQL client",
"main": "gatsby-node.js",
"scripts": {
Expand Down Expand Up @@ -28,6 +28,6 @@
"typescript": "^3.3.1"
},
"dependencies": {
"altair-express-middleware": "^2.1.1"
"altair-express-middleware": "^2.1.2"
}
}
8 changes: 8 additions & 0 deletions src/app/actions/collection/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Action } from '@ngrx/store';

export const CREATE_COLLECTION_AND_SAVE_QUERY_TO_COLLECTION = 'CREATE_COLLECTION_AND_SAVE_QUERY_TO_COLLECTION';
export const SAVE_QUERY_TO_COLLECTION = 'SAVE_QUERY_TO_COLLECTION';
export const UPDATE_QUERY_IN_COLLECTION = 'UPDATE_QUERY_IN_COLLECTION';
export const DELETE_QUERY_FROM_COLLECTION = 'DELETE_QUERY_FROM_COLLECTION';

export const DELETE_COLLECTION = 'DELETE_COLLECTION';
Expand All @@ -25,6 +26,12 @@ export class SaveQueryToCollectionAction implements Action {
constructor(public payload: { windowId: string, collectionId: number, windowTitle?: string }) {}
}

export class UpdateQueryInCollectionAction implements Action {
readonly type = UPDATE_QUERY_IN_COLLECTION;

constructor(public payload: { windowId: string }) {}
}

export class DeleteQueryFromCollectionAction implements Action {
readonly type = DELETE_QUERY_FROM_COLLECTION;
constructor(public payload: { collectionId: number, query }) {}
Expand Down Expand Up @@ -72,6 +79,7 @@ export class ImportCollectionAction implements Action {
export type Action =
| CreateCollectionAndSaveQueryToCollectionAction
| SaveQueryToCollectionAction
| UpdateQueryInCollectionAction
| DeleteQueryFromCollectionAction
| DeleteCollectionAction
| SetCollectionsAction
Expand Down

0 comments on commit c63b9ec

Please sign in to comment.