This commit is contained in:
Your Name 2021-08-04 00:56:18 +02:00
parent 51941b88ee
commit f01509cab1
12 changed files with 112 additions and 139 deletions

View File

@ -14,10 +14,9 @@ class Authentication
public function handle($request, Closure $next)
{
if ($request->input('gql_session') === 'SUPER_SECRET_TOKEN') {
return "false";
}
else {
return "true";
return 'false';
} else {
return 'true';
}
return $next($request);

View File

@ -43,8 +43,11 @@ class Plugin extends PluginBase
$this->app->singleton(DatabaseManager::class, function ($app) {
return $app->make('db');
});
\Illuminate\Support\Facades\Broadcast::routes(['prefix' => '', 'middleware' => 'GermanAirlinesVA\\Graphql\\Classes\\Authentication']);
require("channels/channels.php");
\Illuminate\Support\Facades\Broadcast::routes([
'prefix' => '',
'middleware' => 'GermanAirlinesVA\\Graphql\\Classes\\Authentication',
]);
require 'channels/channels.php';
Config::set('database.connections.germanairlinesva_graphql', Config::get('germanairlinesva.graphql::connection'));
}

View File

@ -15,10 +15,9 @@ class Authentication
public function handle($request, Closure $next)
{
if ($request->header('Gql-Session') === 'SUPER_SECRET_KEY_HEADER') {
return "";
}
else {
throw new AccessDeniedHttpException;
return '';
} else {
throw new AccessDeniedHttpException();
}
return $next($request);

View File

@ -69,6 +69,6 @@ class Dummy extends GraphQLSubscription
*/
public function resolve($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo): array
{
return array($root);
return [$root];
}
}

View File

@ -5,12 +5,12 @@ use BackendMenu;
class GraphqlKey extends Controller
{
public $implement = [ 'Backend\Behaviors\ListController' ];
public $listConfig = 'config_list.yaml';
public $implement = ['Backend\Behaviors\ListController'];
public function __construct()
{
parent::__construct();
}
public $listConfig = 'config_list.yaml';
public function __construct()
{
parent::__construct();
}
}

View File

@ -1,17 +1,18 @@
<div data-control="toolbar">
<button
class="btn btn-default oc-icon-trash-o"
disabled="disabled"
onclick="$(this).data('request-data', {
<button
class="btn btn-default oc-icon-trash-o"
disabled="disabled"
onclick="$(this).data('request-data', {
checked: $('.control-list').listWidget('getChecked')
})"
data-request="onDelete"
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
data-trigger-action="enable"
data-trigger=".control-list input[type=checkbox]"
data-trigger-condition="checked"
data-request-success="$(this).prop('disabled', true)"
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
data-request="onDelete"
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
data-trigger-action="enable"
data-trigger=".control-list input[type=checkbox]"
data-trigger-condition="checked"
data-request-success="$(this).prop('disabled', true)"
data-stripe-load-indicator
>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
</div>

View File

@ -6,6 +6,6 @@ showSetup: true
showCheckboxes: true
recordsPerPage: 20
toolbar:
buttons: list_toolbar
search:
prompt: 'backend::lang.list.search_prompt'
buttons: list_toolbar
search:
prompt: 'backend::lang.list.search_prompt'

View File

@ -1,5 +1,4 @@
title = "CMS"
==
title = "CMS" ==
<?php
use Cms\Classes\Theme;
use Cms\Classes\Content;
@ -12,12 +11,6 @@ function resolveCmsContent($root, $args) {
return Content::loadCached($theme, $args['name']);
}
?>
==
# Content
extend type Query { cmsContent(name: String!): CmsContent! }
type CmsContent { fileName: String! content: String markup: String parsedMarkup: String }
# CMS-wide types
# Backend\Models\User
type BackendUser { id: ID! }
#System\Models\File
type SystemFile { id: ID path: String title: String description: String }
== # Content extend type Query { cmsContent(name: String!): CmsContent! } type CmsContent { fileName: String! content:
String markup: String parsedMarkup: String } # CMS-wide types # Backend\Models\User type BackendUser { id: ID! }
#System\Models\File type SystemFile { id: ID path: String title: String description: String }

View File

@ -1,32 +1,8 @@
title = "Fleet"
==
==
# Content
extend type Query {
aircraft: [Aircraft] @all(model: "GermanAirlinesVa\\Fleet\\Models\\Aircraft")
aircraftType: [AircraftType] @all(model: "GermanAirlinesVa\\Fleet\\Models\\AircraftType")
}
extend type Subscription {
aircraftAdded: Aircraft @subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\AircraftAdded")
}
extend type Mutation {
addAircraft(
aircraft_type_id: ID!,
home_airport_id: ID!,
name: String!,
registration: String!
): Aircraft
@create(model: "GermanAirlinesVa\\Fleet\\Models\\Aircraft")
@broadcast(subscription: "aircraftAdded")
}
type Aircraft {
id: ID!
aircraft_type_id: ID!
home_airport_id: ID!
name: String!
registration: String!
}
type AircraftType { type: String! aircrafts: [Aircraft] @hasMany }
title = "Fleet" == == # Content extend type Query { aircraft: [Aircraft] @all(model:
"GermanAirlinesVa\\Fleet\\Models\\Aircraft") aircraftType: [AircraftType] @all(model:
"GermanAirlinesVa\\Fleet\\Models\\AircraftType") } extend type Subscription { aircraftAdded: Aircraft
@subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\AircraftAdded") } extend type Mutation { addAircraft(
aircraft_type_id: ID!, home_airport_id: ID!, name: String!, registration: String! ): Aircraft @create(model:
"GermanAirlinesVa\\Fleet\\Models\\Aircraft") @broadcast(subscription: "aircraftAdded") } type Aircraft { id: ID!
aircraft_type_id: ID! home_airport_id: ID! name: String! registration: String! } type AircraftType { type: String!
aircrafts: [Aircraft] @hasMany }

View File

@ -1,33 +1,35 @@
<?php return [
'plugin' => [
'name' => 'GA GraphQL',
'description' => '',
'plugin' => [
'name' => 'GA GraphQL',
'description' => '',
],
'menu' => [
'main' => 'GA GraphQL',
'keys' => 'GraphQL Keys',
'playground' => 'GraphiQL',
],
'permission' => [
'tab' => [
'schemas' => 'German Airlines VA - GraphQL',
],
'menu' => [
'main' => 'GA GraphQL',
'keys' => 'GraphQL Keys',
'playground' => 'GraphiQL',
'label' => [
'schemas' => 'Access GraphiQL',
],
'permission' => [
'tab' => [
'schemas' => 'German Airlines VA - GraphQL',
],
'label' => [
'schemas' => 'Access GraphiQL',
],
],
'settings' => [
'label' => 'German Airlines VA - GraphQL',
'description' => 'Configure GrapQL',
'general' => 'General',
'engine' => 'Engine',
'enable_cache' => [
'label' => 'Enable Schema Cache',
'comment' =>
'A large part of the Schema generation is parsing the various graph definition into an AST. These operations are pretty expensive so it is recommended to enable caching in production mode.',
],
'settings' => [
'label' => 'German Airlines VA - GraphQL',
'description' => 'Configure GrapQL',
'general' => 'General',
'engine' => 'Engine',
'enable_cache' => [
'label' => 'Enable Schema Cache',
'comment' => 'A large part of the Schema generation is parsing the various graph definition into an AST. These operations are pretty expensive so it is recommended to enable caching in production mode.',
],
'batched_queries' => [
'label' => 'Batched Queries',
'comment' => 'GraphQL query batching means sending multiple queries to the server in one request. You may set this flag to process/deny batched queries.',
],
'batched_queries' => [
'label' => 'Batched Queries',
'comment' =>
'GraphQL query batching means sending multiple queries to the server in one request. You may set this flag to process/deny batched queries.',
],
];
],
];

View File

@ -1,13 +1,13 @@
columns:
id:
label: id
type: number
member_id:
label: member_id
type: number
valid_from:
label: valid_from
type: datetime
key:
label: key
type: text
id:
label: id
type: number
member_id:
label: member_id
type: number
valid_from:
label: valid_from
type: datetime
key:
label: key
type: text

View File

@ -1,26 +1,26 @@
plugin:
name: 'germanairlinesva.graphql::lang.plugin.name'
description: 'germanairlinesva.graphql::lang.plugin.description'
author: 'German Airlines VA'
icon: oc-icon-database
homepage: ''
name: 'germanairlinesva.graphql::lang.plugin.name'
description: 'germanairlinesva.graphql::lang.plugin.description'
author: 'German Airlines VA'
icon: oc-icon-database
homepage: ''
permissions:
schemas:
tab: 'germanairlinesva.graphql::lang.permission.tab.schemas'
label: 'germanairlinesva.graphql::lang.permission.label.schemas'
schemas:
tab: 'germanairlinesva.graphql::lang.permission.tab.schemas'
label: 'germanairlinesva.graphql::lang.permission.label.schemas'
navigation:
menu:
label: 'germanairlinesva.graphql::lang.menu.main'
url: /
menu:
label: 'germanairlinesva.graphql::lang.menu.main'
url: /
icon: icon-database
permissions:
- schemas
sideMenu:
side-menu-item:
label: 'germanairlinesva.graphql::lang.menu.playground'
url: germanairlinesva/graphql/playground
icon: icon-database
permissions:
- schemas
sideMenu:
side-menu-item:
label: 'germanairlinesva.graphql::lang.menu.playground'
url: germanairlinesva/graphql/playground
icon: icon-database
side-menu-item2:
label: 'germanairlinesva.graphql::lang.menu.keys'
url: germanairlinesva/graphql/graphqlkey
icon: icon-key
side-menu-item2:
label: 'germanairlinesva.graphql::lang.menu.keys'
url: germanairlinesva/graphql/graphqlkey
icon: icon-key