Code Monkey home page Code Monkey logo

dst-entity-generate's Introduction

Drupal Entity Generator(DEG)

Drupal Entity Generator (DEG) is a tool to build Drupal entities using the architecture defined in the Google spreadsheet. We recommend using a Drupal Spec Tool for creating the Google spreadsheet to define the content architecture for your Drupal site.

Getting started

Follow the documentation for detailed instructions about the installation and usage of Drupal Entity Generator (DEG).

Documentation

There is docs directory having all documents related to Drupal Entity Generator (DEG). We have used Sphinx for generating the documents. Install Sphinx to update and manage the documents. There are .rst source files for documents in 'docs/source' directory.

Known issues

See open bug reports in the issue queue.

Contribution

Contributions are welcome! See CONTRIBUTING.md.

Creators

Mukesh Sah

Ashutosh Gupta

Praveen Singh

Sharique Farooqui

Omkar Pednekar

Gaurav Goyal

Amit Vyas

dst-entity-generate's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dst-entity-generate's Issues

Cannot upload credentials file

Steps to reproduce

  • Enable dst_entity_generate module
  • Goto configuration page
  • Try to upload a credentials.json file
  • You will see an error.

image

Expected outcome:

  • I should be able to upload a file without any error\

Possible solution:

  • Check if private file path destination is set, if not throw an error.

DSTEG-62: Code cleanup and Code refactor after removing debug mode

  1. Remove Debug mode.
  2. Code cleanup related to Debug mode.
  3. As per new form settings, update skipEntitySync method.
  4. Use skipEntitySync method in all command.
  5. Create a common method to display message if sync is disabled.
  6. Create a common method to display and log exception.
  7. Code cleanup.

Update Mode: Possible approach

We can update existing commands to handle update mode.

Possible implementation approach:

  1. Add new configuration item in form to set implementation status value. If row is updated after implementation, c will be the value in X column.
  2. Currently we are filtering data by matching rows where w value is set in x column. This logic can be found in filterApprovedData function of BaseEntityGenerate class.
  3. We need to grab content with value w as well as c. So, logic written in filterApprovedData function need to correct.
  4. Create a new function in individual command to update respective entity type.
  5. In original command execution, If we get a row with value c in x column and entity type is already exist,
    pass row to update function.
  6. Update function will have predefined column list that we can consider to update entity type. E.g. Label, description.
  7. Once entity type get updated, display message and return to original command execution.

Scope:

  1. Update only entity types in first phase.
  2. Updation of fields can be consider after we are able to update entity types.

Possible fields that can be consider to update entity type:
Content type

  1. Name
  2. Description
  3. Mod.
  4. Trns.
  5. Cmnt.
  6. URL alias pattern

User roles

  1. Name

Workflows

  1. Label

Workflow states

  1. Label
  2. Workflow(Need to check whether it is possible or not.)

Workflow transitions

  1. Label
  2. Workflow(Need to check whether it is possible or not.)
  3. From state
  4. To state

Menus

  1. Title
  2. Description

Image styles

  1. Style name

Image effects
N/A

The commands executes even if the sync (in General tab) is off

drush dst:ie

➜ Generating Image Effects.

➜ Image effect Scale created in Large (480×480)
➜ Image effect Scale created in Media Library thumbnail (220×220)
➜ Image effect Scale created in Medium (220×220)
➜ Image effect Scale and crop created in Thumbnail (100×100)

➜ Finished generating Image Effects.


drush dst:ur

➜ Generating user roles.

➜ New role Site Configurator created.
➜ New role Content Editor created.
➜ New role Content Manager created.

➜ Finished generating User roles.


drush dst:w

➜ Generating Workflows.

➜ State Draft created successfully for workflow Editorial
➜ State In review created successfully for workflow Editorial
➜ State Published created successfully for workflow Editorial
➜ State Test created successfully for workflow Editorial
➜ State Archived created successfully for workflow Editorial
➜ Transitions Create New Draft created successfully for workflow Editorial
➜ Transitions Create New Draft created successfully for workflow Editorial
➜ Transitions Create New Draft created successfully for workflow Editorial
➜ Transitions Send to review created successfully for workflow Editorial
➜ Transitions Send to review created successfully for workflow Editorial
➜ Transitions Publish created successfully for workflow Editorial
➜ Transitions Publish created successfully for workflow Editorial
➜ Transitions Publish created successfully for workflow Editorial
➜ State ADraft created successfully for workflow Administrator
➜ State A In review created successfully for workflow Administrator
➜ State Published created successfully for workflow Administrator
➜ State Test created successfully for workflow Administrator
➜ State Archived created successfully for workflow Administrator
➜ To state Draft is not present for workflow Administrator
➜ Transitions Restore to Draft not created for workflow Administrator
➜ Transitions Archive created successfully for workflow Administrator
➜ Transitions Restore from archive created successfully for workflow Administrator
➜ New workflow Administrator created along with states and transitions.

➜ Finished generating workflows, states and transitions.

DSTEG-00: Decide and Create a tool skeleton

What is done?
Created this MR - #2

  1. Created a module skeleton.
  2. Added all the composer related stuff to make sure the contributors can get started with this.

Require discussion

  • Should we go with the module OR should we just drush commands files?
  • Shall we use the composer? If not required, we can remove it.

Column and value identifier configuration for data sync

Require a new configuration to identify whether or not the row requires to be sync or not.

  1. Column Name - Add a column to be used to identify whether the row needs to be synced or not.
  2. Value - Add a value of the column to be used to identify whether the row needs to be synced or not.

Error, when Menu sync is off and try to run the menu sync

➜ Generating Menus.

[error] Error: Call to a member function getData() on null in Drupal\dst_entity_generate\Commands\Menu->generateMenus() (line 66 of /var/www/eeavyas/docroot/modules/contrib/dst-entity-generate/src/Commands/Menu.php) #0 /var/www/eeavyas/docroot/modules/contrib/dst-entity-generate/src/Commands/GenerateAll.php(127): Drupal\dst_entity_generate\Commands\Menu->generateMenus()
#1 [internal function]: Drupal\dst_entity_generate\Commands\GenerateAll->generate(Array)
#2 /var/www/eeavyas/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#3 /var/www/eeavyas/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#4 /var/www/eeavyas/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#5 /var/www/eeavyas/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(311): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#6 /var/www/eeavyas/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/eeavyas/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/eeavyas/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/eeavyas/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/eeavyas/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/eeavyas/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/eeavyas/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#13 /var/www/eeavyas/vendor/drush/drush/includes/preflight.inc(18): require('/var/www/eeavya...')
#14 phar:///usr/local/bin/drush/bin/drush.php(141): drush_main()
#15 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#16 {main}.

DSTEG-56: List all available entity options for entity type on General settings form.

On General settings form(/admin/config/dst_entity_generate/settings):

  1. Display only those entities/Bundles who's entries present in respective tabs. E.g. In sheet, if there is no any data for Paragraph types, don't show to sync it.
  2. In non-bundle entity selection, we are giving only All option to select. Provide all available entities/fields for selection.

If same field is reused in multiple content types then consider adding field.

Issue: Currently, if the field is mapped with multiple content types, only the first content type is generated with that field and others are not.

Ex: field_title | available in multiple content types, then only the first instance will have that field and other content types will not have the same field.

Expectation: We should consider the re-usage of any field.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.