Commit Graph

1983 Commits

Author SHA1 Message Date
Michael Stenta 462f606625 Issue #3214097 by paul121: The file permissions could not be set on keys/*.key 2021-09-09 16:39:12 -04:00
paul121 92f197a3fa Log errors when creating key files. 2021-09-09 16:30:43 -04:00
paul121 26d717521c Do not modify key file permissions. 2021-09-09 16:30:43 -04:00
Michael Stenta 929da330f4 Issue #3230933 by paul121: Use composer-merge-plugin to include farmOS-map instead of Asset Packagist 2021-09-09 15:13:55 -04:00
paul121 bec02f680e Update farmOS-map to v2.0.1. 2021-09-09 15:03:27 -04:00
paul121 73a4fdc529 Move farmOS-map composer dependency to composer.libraries.json. 2021-09-09 15:03:27 -04:00
Michael Stenta dcd01c169f Issue #3187558 by paul121, m.stenta: Create action links to add logs from the asset view pages 2021-09-09 15:03:00 -04:00
Michael Stenta 6c7c238ab8 Copy localized_options into the dropbutton URL options.
This is necessary to maintain any query parameters that
were added to the action links.
2021-09-09 15:02:18 -04:00
Michael Stenta ee21d1e38d Override Gin local actions block to render links in a dropbutton. 2021-09-09 15:02:18 -04:00
Michael Stenta c327472dc4 Move UI modules into core directory. 2021-09-09 14:27:31 -04:00
Michael Stenta 118250db66 Add the entity_bundles cache tag so action links are recreated after new bundles are installed. 2021-09-09 14:27:31 -04:00
Michael Stenta 1ea5f0069e The Seed module depends on farm_plant_type, not farm_plant. 2021-09-09 14:27:31 -04:00
Michael Stenta 22ae662113 Merge FarmAssetAddLogAction and FarmAddLogPrepopulate into FarmActions and AddEntity classes in farm_ui_actions module. 2021-09-09 14:27:31 -04:00
Michael Stenta 6379e8b59f Split Animal type and Plant type vocabularies out to their own modules.
This is mainly for consistency with the other vocabs, in
case there are future modules that want to vocab without
the asset type (like we needed with Material Type). By
putting all vocabs in modules/taxonomy we make it easy to
quickly see all the vocabularies that farmOS provides in
both the file system and module list.

The one remaining exception is Crop Family, which is
included in the farm_plant_type module.
See https://www.drupal.org/project/farm/issues/3191115
2021-09-09 14:27:31 -04:00
Michael Stenta 59e25655ae Generalize AddEntity LocalAction bundle parameter logic.
Derivatives can either define a bundle_parameter to look for
(eg: 'arg_0' in the case of Views), OR explicitly define the
bundle.

This will allow FarmAddLogPrepopulate to be merged into the
Menu/LocalAction/AddEntity class, and FarmAssetAddLogAction
to be merged into the Derivative\FarmActions class.
2021-09-09 14:27:31 -04:00
Michael Stenta 2a52a82d4f Fix hook_farm_api_meta_alter() documentation. 2021-09-09 14:27:31 -04:00
Michael Stenta a4aa8a1859 Update FarmAddLogPrepopulate links to use ?asset=X query parameter. 2021-09-09 14:27:31 -04:00
paul121 6fd2a871d8 Add the entity_bundles cache tag so action links are created after new log types are installed. 2021-09-09 14:27:31 -04:00
paul121 7cdc0eb67b Prepopulate the asset field when creating a log from the asset page. 2021-09-09 14:27:31 -04:00
paul121 85f3f1ad79 Create an action link class to create logs and prepopulate fields. 2021-09-09 14:27:31 -04:00
paul121 b06248623b Create an action link to add each log type from the asset view. 2021-09-09 14:27:31 -04:00
Michael Stenta 8febc54dc7 Merge branch '2.x-record-layout' into 2.x 2021-09-09 14:27:12 -04:00
Michael Stenta 3d6161453f Hide geometry field label in asset and log page top region. 2021-09-09 14:26:15 -04:00
Michael Stenta 7e67a71c06 Add some vertical padding to layout regions. 2021-09-09 14:26:15 -04:00
Michael Stenta abd21f53b5 Put asset "Group membership" field in the second region. 2021-09-09 14:26:15 -04:00
Michael Stenta c6112ff7f6 Add hook_farm_ui_theme_region_items() for defining asset, log, and plan content region items. 2021-09-09 10:24:44 -04:00
Michael Stenta 98aa8b5ee0 Use a stacked two-column layout for full asset, log, and plan pages. 2021-09-09 10:16:29 -04:00
Michael Stenta 1e3c018fe0 Fix map.js in farm_ui_theme.libraries.yml. 2021-09-06 16:08:36 -04:00
Michael Stenta 08c50d7fde Fix TypeError: Argument 1 passed to Drupal\Core\Entity\EntityStorageBase::loadMultiple() must be of the type array or null, string given.
This error occurs if ?asset=X is used instead of ?asset[]=X.
We can take a more defensive approach by automatically
wrapping the input in an array if it isn't already one.
2021-09-06 11:00:51 -04:00
Michael Stenta 345464c6ad Restrict new user registration via hook_install() instead of config/install. 2021-09-06 11:00:51 -04:00
Michael Stenta 434b473e14 Move toolbar-toggle map resize event listener JS to farm_ui_theme. 2021-09-06 11:00:51 -04:00
Michael Stenta 99eb69434a Install Gin via farm_ui_theme_install() instead of config/install. 2021-09-06 11:00:51 -04:00
Michael Stenta 453063f64b Install all blocks to Claro theme by default. 2021-09-06 11:00:51 -04:00
Michael Stenta e4c35aca19 Set $defaultTheme to stark in all WebDrivcerTestBase tests. 2021-09-06 11:00:51 -04:00
Michael Stenta b49441efe4 Set $defaultTheme to stark for all descendants of FarmBrowserTestBase. 2021-09-06 10:46:20 -04:00
Michael Stenta 118b448170 Decouple FarmMap render element and JS instantiation #436 2021-09-06 07:04:33 -04:00
Symbioquine c92fe90985 Refactor most of farm_map.js into factory method #436
**Why?** Allow JS in contrib modules to take advantage of
now decoupled map instantiation code to create canonically
extensible/styled maps where the life-cycle of those maps
is controlled by the contrib module JS code.

For example, a contrib module's controller can return;

```php
return [
  'map-prototype' => [
    '#type' => 'farm_map',
    '#attributes' => [
        'id' => 'example-tool-map-prototype',
        'data-map-instantiator' => 'example-tool',
    ],
  ],
];
```

Then create map instances from custom JS like this;

```js
const mapPrototypeElement = document.getElementById('example-tool-map-prototype');

const mapElement = mapPrototypeElement.cloneNode();
mapElement.removeAttribute('id');

myParentContainer.appendChild(mapElement);

const mapInstance = Drupal.behaviors.farm_map.createMapInstance(mapElement, mapElement, 'example-tool-map-prototype', {});
```
2021-09-03 15:20:26 -04:00
Symbioquine 6ce9ec2480 Reduce coupling between map element id and other logic #436
**Why?** There were a bunch of places where farmOS implicitly depends
on the id of the map element to look up settings and access the map
element after the map is instantiated.

This change makes it so there is only one place in the JS that depends
on the map id to dereference the drupalSettings and assign them under
`instance.farmMapSettings` so behaviors can access them.
2021-09-03 15:20:26 -04:00
Symbioquine 9c94dab9db Decouple FarmMap render element styling and JS instantiation #436
**Why?** It should be possible to leverage the farm_map
module's extension mechanism and default styling without
necessarily giving it full control over when the map
instance gets created.

Currently, the FarmMap render element uses the 'farm-map'
CSS class to inform the JS code in `farm_map.js` that it should
instantiate the map. This is problematic since that CSS class
is also used for styling and there's a bunch of code in the
FarmMap render element and in `farm_map.js` which should
be common to pretty much all farmOS maps.

To fix that, this change introduces a new [data attribute] which
is used instead of the CSS class to signal the JS code in `farm_map.js`
that it should actually instantiate the map.

[data attribute]: https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
2021-09-03 15:20:26 -04:00
Michael Stenta 8f9123b975 Set popup behavior weight to -100.
...so that behaviors that use instance.popup.on()
(including asset_type_layers) don't need to worry
about setting their weight heavier.
2021-09-03 15:19:03 -04:00
Michael Stenta fcf32771bd Only show popups for features that have a name.
This fixes the annoying issue where a mostly-blank popup
appears while drawing shapes in Geofield widget.
2021-09-03 15:16:33 -04:00
Michael Stenta 475610fa0d Remove test-runner and Disable XDebug with XDEBUG_MODE: off #441 2021-09-03 12:59:10 -04:00
Michael Stenta 2bc77bb4b2 Remove test-runner service. 2021-09-02 14:44:51 -04:00
Michael Stenta 36fb1809fc Run tests in www service instead of test-runner. 2021-09-02 14:44:26 -04:00
Michael Stenta e8702df7ac Disable XDebug in testing services. 2021-09-02 14:30:19 -04:00
Michael Stenta 37d10f738a Add @see link to Issue #3230970: Generalize KML importer to create any asset type 2021-09-01 23:21:37 -04:00
Michael Stenta 6128fa1ae1 Merge branch '2.x-geofield-import-files' into 2.x 2021-09-01 23:07:18 -04:00
paul121 70ad63479d Allow geojson and gpx file extensions. 2021-09-01 22:47:08 -04:00
Michael Stenta 71db605a98 Merge geometries from multiple uploaded files together. 2021-09-01 22:47:08 -04:00
Michael Stenta 2b7408e87c Support KMZ files in GeofieldWidget "Import geometry from uploaded files". 2021-09-01 22:47:08 -04:00