3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00
Commit graph

960 commits

Author SHA1 Message Date
paul121 b770db6552 Allow quantity fields to be rendered before and after the standard fields. 2021-09-15 15:35:40 -04:00
paul121 f534299d38 Add view of inventory adjustments in an inventory tab on asset pages. 2021-09-15 15:35:40 -04:00
Michael Stenta 19e2c845c1 Translate inventory adjustment widget validation errors. 2021-09-15 15:35:40 -04:00
paul121 7cb61108b9 Add custom validation for quantity inventory values. 2021-09-15 15:35:40 -04:00
paul121 e9caab4e4a Hide the inventory asset field until an inventory adjustment is selected. 2021-09-15 15:35:40 -04:00
paul121 b236424bc0 Default the quantity inventory_adjustment to N/A. 2021-09-15 15:35:40 -04:00
Michael Stenta a30acfb82e Delete parent references to taxonomy terms during migration rollback. 2021-09-15 15:33:17 -04:00
Michael Stenta ff547ed8a5 Delete companion references to plant type terms during migration rollback. 2021-09-15 14:59:54 -04:00
Michael Stenta 1652c4746f Add a farm_migrate:rollback Drush command that rolls back all farmOS migrations. 2021-09-15 14:22:09 -04:00
Michael Stenta a24c3ff221 Add a farm_migrate:import Drush command that executes all farmOS migrations. 2021-09-15 14:22:03 -04:00
Michael Stenta c477e05896 Only delete quantity references for quantities that were created by migrations in the farm_migrate_quantity migration group.
This ensures that references to quantities created with the
create_quantity process plugin are maintained, so those
quantities can be deleted normally when the log is deleted.
2021-09-15 14:21:54 -04:00
Michael Stenta f3ec44d43e Issue #3189740 by m.stenta: Cannot rollback farm_migrate_asset_parent group migrations 2021-09-15 12:03:04 -04:00
Michael Stenta 14bb01e681 Rename farm_migrate_reference group to farm_migrate_asset_parent. 2021-09-15 12:03:04 -04:00
Michael Stenta 44a14b5422 Issue #3229503: Rolling back log migration deletes quantities 2021-09-15 12:03:04 -04:00
Michael Stenta 53dc64258e Temporarily allow access to private file referencing during migration. 2021-09-15 09:01:50 -04:00
Michael Stenta 09ed36b10b Grant/revoke 'use text format default' permission to/from anonymous role during farm_migrate_taxonomy group migrations.
This is necessary because Drush runs migrations as anonymous
user, which does not have access to 'use text format default'
permission, so any terms that need that format fail validation.
2021-09-15 09:00:10 -04:00
Michael Stenta 359a1f8aea Generalize migration event subscriber so that more events can be added. 2021-09-14 20:42:54 -04:00
Michael Stenta b90f00e5ed Ensure that no migrate entities end up with a uid of 0. Make user 1 the default. 2021-09-14 19:25:34 -04:00
Michael Stenta 03e6572f6a Set the user ID of migrated area assets to 1. 2021-09-14 19:25:34 -04:00
Michael Stenta fc51877a89 Enable entity validation for area, asset, log, plan, and taxonomy term migrations. 2021-09-14 19:25:34 -04:00
Symbioquine 3152895f15 Enable the map side panel with layer switcher by default #442
**Why?** Provide a place for more settings and information
to be included on farmOS maps without introducing more and more
border clutter.
2021-09-12 10:23:03 -07:00
paul121 71159d83c3 Issue #3232237 by paul121: Allow the map widget textarea to be hidden
Add display_raw_geometry setting to the map widget.
2021-09-10 07:17:47 -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
paul121 73a4fdc529 Move farmOS-map composer dependency to composer.libraries.json. 2021-09-09 15:03:27 -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 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 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 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 c327472dc4 Move UI modules into core directory. 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 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 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 434b473e14 Move toolbar-toggle map resize event listener JS to farm_ui_theme. 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
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 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 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
Michael Stenta a01cc1a930 Change "Find using files field" to "Import geometry from uploaded files". 2021-09-01 22:47:08 -04:00
Michael Stenta e2a1c112e4 Ensure field wrapper DOM ID is unique with Html::getUniqueId(). 2021-09-01 22:47:08 -04:00
paul121 edc107d74a Add warning messages. 2021-09-01 22:47:08 -04:00
paul121 c123e3d2b4 Disable the find using files field button until a file is uploaded. 2021-09-01 22:47:08 -04:00