Skip to content

Commit

Permalink
Merge pull request #37 from CU-CommunityApps/dev-latest
Browse files Browse the repository at this point in the history
prod-build
  • Loading branch information
philwilliammee authored Sep 14, 2021
2 parents bea74eb + c5df43e commit b62b973
Show file tree
Hide file tree
Showing 19 changed files with 18,786 additions and 15,665 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cd modules/custom && git clone https://github.com/CU-CommunityApps/CD_cwd_events
Development to compile sass and javascript.

```bash
cd ./dev
cd ./src/app
npm install
npm run watch
```
Expand Down
1 change: 1 addition & 0 deletions config/install/cwd_events.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cwd_events:
heading: ''
target: ''
id: ''
api: 'loacalist'
calendarurl: "//events.cornell.edu/api/2.1/events"
apikey: "KLhy2GtuSAGirYGY"
format: "standard"
Expand Down
2 changes: 1 addition & 1 deletion includes/cwd_events.css

Large diffs are not rendered by default.

102 changes: 101 additions & 1 deletion includes/cwd_events.js

Large diffs are not rendered by default.

57 changes: 56 additions & 1 deletion includes/cwd_events.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1 +1,56 @@
/*! For license information please see index.js.LICENSE.txt */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

/**
* build-url - A small library that builds a URL given its components
* @version v6.0.0
* @link https://github.com/steverydz/build-url#readme
* @license MIT
*/

/** @license Material-UI v5.0.0-rc.1
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

//! moment.js
24 changes: 23 additions & 1 deletion src/Plugin/Block/EventsBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
*/
class EventsBlock extends BlockBase implements BlockPluginInterface {


/**
* List of supported format options.
*
* @var array
*/
private $apiOptions = [
'localist' => 'localist',
'drupal' => 'drupal',
'wordpress' => 'wordpress',
];

/**
* List of supported format options.
*
Expand Down Expand Up @@ -66,6 +78,7 @@ public function blockForm($form, FormStateInterface $form_state) {
$config = $this->getConfiguration();
$formatOptions = $this->formatOptions;
$filterOptions = $this->filterOptions;
$apiOptions = $this->apiOptions;

$form['cwd_events_localist_config'] = [
'#type' => 'fieldset',
Expand All @@ -75,6 +88,14 @@ public function blockForm($form, FormStateInterface $form_state) {
'#collapsed' => TRUE,
];

$form['cwd_events_localist_config']['api'] = [
'#type' => 'select',
'#title' => $this->t('Api'),
'#description' => $this->t('Select the api to fetch the data from.'),
'#options' => $apiOptions,
'#default_value' => isset($config['api']) ? $config['api'] : 'localist',
];

$form['cwd_events_localist_config']['calendarurl'] = [
'#type' => 'textfield',
'#title' => $this->t('Calendar url'),
Expand Down Expand Up @@ -160,7 +181,7 @@ public function blockForm($form, FormStateInterface $form_state) {
'#title' => $this->t('Read More Title'),
'#description' => $this->t('Read More Title to be used with readmore url to link to the events page. Leave blank to remove from display.'),
'#default_value' => isset($config['readmore']) ? $config['readmore'] :
'More Events »',
'More Events »',
];

$form['cwd_events_display_options']['url'] = [
Expand Down Expand Up @@ -256,6 +277,7 @@ public function blockSubmit($form, FormStateInterface $form_state) {
$this->configuration['id'] = $id;
$this->configuration['target'] = "events-listing-$id";

$this->configuration['api'] = $values['cwd_events_localist_config']['api'];
$this->configuration['calendarurl'] = $values['cwd_events_localist_config']['calendarurl'];
$this->configuration['apikey'] = $values['cwd_events_localist_config']['apikey'];

Expand Down
Loading

0 comments on commit b62b973

Please sign in to comment.