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

Add "Conditional content" block #238

Closed
wants to merge 8 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
13 changes: 13 additions & 0 deletions .lagoon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ environments:
schedule: '*/15 * * * *'
command: drush cron
service: cli
demo-bg:
routes:
- nginx:
- bg.cms.amazeelabs.dev
- build:
- bg.build.amazeelabs.dev
- preview:
- bg.preview.amazeelabs.dev
cronjobs:
- name: drush cron
schedule: '*/15 * * * *'
command: drush cron
service: cli
7 changes: 7 additions & 0 deletions apps/cms/.lagoon.env.demo-bg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PROJECT_NAME=bg
PUBLISHER_URL="https://bg.build.amazeelabs.dev"
NETLIFY_URL="https://bg.amazeelabs.dev"
PREVIEW_URL="https://bg.preview.amazeelabs.dev"

# Used to set the original client secret.
PUBLISHER_OAUTH2_CLIENT_SECRET=REPLACE_ME
1 change: 1 addition & 0 deletions apps/cms/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"drupal/masquerade": "^2.0@RC",
"drupal/menu_admin_per_menu": "^1.5",
"drupal/metatag": "^2.0",
"drupal/pate": "^1.2",
"drupal/pathauto": "^1.11",
"drupal/redirect": "^1.8",
"drupal/reroute_email": "^2.2",
Expand Down
119 changes: 118 additions & 1 deletion apps/cms/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apps/cms/config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ module:
node: 0
options: 0
page_cache: 0
pate: 0
path: 0
path_alias: 0
phpass: 0
redirect: 0
replicate: 0
reroute_email: 0
role_delegation: 0
serialization: 0
Expand Down
3 changes: 3 additions & 0 deletions apps/cms/config/sync/node.type.page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ status: true
dependencies:
module:
- menu_ui
- pate
third_party_settings:
menu_ui:
available_menus:
- footer
- main
parent: 'main:'
pate:
is_templatable: true
name: 'Basic page'
type: page
description: ''
Expand Down
4 changes: 2 additions & 2 deletions apps/cms/config/sync/system.date.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ first_day: 0
country:
default: ''
timezone:
default: UTC
default: Europe/Zurich
user:
configurable: true
configurable: false
default: 0
warn: false
30 changes: 27 additions & 3 deletions apps/cms/config/sync/workflows.workflow.basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,31 @@ type_settings:
states:
draft:
label: Draft
weight: 0
weight: -2
published: false
default_revision: false
not_published:
label: 'Not published'
weight: 3
weight: 1
published: false
default_revision: true
published:
label: Published
weight: 1
weight: 0
published: true
default_revision: true
review:
label: Review
weight: -1
published: false
default_revision: false
transitions:
accept:
label: Accept
from:
- review
to: published
weight: 7
create_new_draft:
label: 'Create New Draft'
from:
Expand All @@ -42,6 +53,19 @@ type_settings:
- published
to: published
weight: 1
reject:
label: Reject
from:
- review
to: draft
weight: 6
to_review:
label: 'To review'
from:
- draft
- not_published
to: review
weight: 5
unpublish:
label: Unpublish
from:
Expand Down
1 change: 1 addition & 0 deletions apps/preview/.lagoon.env.demo-bg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DRUPAL_URL="https://bg.cms.amazeelabs.dev"
29 changes: 29 additions & 0 deletions apps/website/.lagoon.env.demo-bg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PROJECT_NAME=bg
DRUPAL_INTERNAL_URL="http://nginx:8080"
DRUPAL_EXTERNAL_URL="https://bg.cms.amazeelabs.dev"
NETLIFY_URL="https://bg.amazeelabs.dev"
NETLIFY_SITE_ID="3e8afb6a-2960-4c67-9065-7b739b86c3a0"

# -----------------------------------------------
# Publisher authentication with Drupal (OAuth2).
# See main ./README.md for more information.
# -----------------------------------------------
# Set to true to fully skip authentication.
PUBLISHER_SKIP_AUTHENTICATION=false

# Secret from the Drupal Publisher Consumer.
PUBLISHER_OAUTH2_CLIENT_SECRET=REPLACE_ME

# Client id from the Drupal Publisher Consumer.
PUBLISHER_OAUTH2_CLIENT_ID=publisher

# A random string, used to encrypt the session.
PUBLISHER_OAUTH2_SESSION_SECRET=REPLACE_ME

# "development" or "production", production will trust first proxy
# and serve secure cookies.
PUBLISHER_OAUTH2_ENVIRONMENT_TYPE=production

# DRUPAL_EXTERNAL_URL is used by default, but can be overridden
# to match the Drupal production url, without the nginx prefix.
PUBLISHER_OAUTH2_TOKEN_HOST="${DRUPAL_EXTERNAL_URL}"
22 changes: 22 additions & 0 deletions packages/drupal/custom/src/SimpleDirectives.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Drupal\custom;

use Drupal\Component\Datetime\DateTimePlus;
use Drupal\graphql_directives\DirectiveArguments;

class SimpleDirectives {

public static function fromJsDatetime(DirectiveArguments $args): ?string {
$datetime = trim((string) $args->args['datetime']);
if (!$datetime) {
return NULL;
}
return DateTimePlus::createFromFormat(
'Y-m-d\TH:i',
$datetime,
\Drupal::config('system.date')->get('timezone.default')
)?->format('c');
}

}
3 changes: 3 additions & 0 deletions packages/drupal/gutenberg_blocks/gutenberg_blocks.module
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@ function gutenberg_blocks_form_node_form_alter(&$form, FormStateInterface $form_
'label' => $form->label(),
], $webforms);
$form['#attached']['drupalSettings']['customGutenbergBlocks']['forms'] = array_values($forms);

$form['#attached']['drupalSettings']['customGutenbergBlocks']['timezone'] =
\Drupal::config('system.date')->get('timezone.default') ?: @date_default_timezone_get();
}
}
Loading
Loading