Coder Social home page Coder Social logo

rezo-labs / directus-extension-schema-management-module Goto Github PK

View Code? Open in Web Editor NEW
121.0 5.0 6.0 909 KB

UI to easily share schema/role between Directus apps

License: GNU General Public License v3.0

TypeScript 2.26% Vue 97.74%
directus directus-extension directus-extension-module schema-as-code role-as-code

directus-extension-schema-management-module's People

Contributors

duydvu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

directus-extension-schema-management-module's Issues

install on directus docker

for my directus docker instance (10.6.1), i had to install using the following:

yarn add argon2 2> /dev/null
yarn add directus-extension-schema-management-module
reboot

Unfortunately it needs argon2, I don't know why. And furthermore, it errors out while installing argon2 hence the redirected errors. This is more of an afterthought but wondering if there's a way to shed light on this.

Empty Schema Value Causes Schema Apply Failure

Using Directus 9.21.* When exporting the schema of a collection, the schema value is empty, which seems to cause relationships to fail. When I add the name of the collection to the schema value in the JSON, I can apply the schema without errors.

Example Exported Collection
"collections": [ { "collection": "test_collection_2", "meta": { "collection": "test_collection_2", "icon": null, "note": null, "display_template": null, "hidden": false, "singleton": false, "translations": null, "archive_field": "status", "archive_app_filter": true, "archive_value": "archived", "unarchive_value": "draft", "sort_field": null, "accountability": "all", "color": null, "item_duplication_fields": null, "sort": 68, "group": null, "collapse": "open" }, "schema": {} } removed fields and relations ]

When I use the above with npx directus schema apply ./file.json I get the following error:

ERROR: Failed to create relation "test_collection_2.image"
ERROR: Invalid payload. Collection "test_collection_2" doesn't exist.
    err: {
      "type": "",
      "message": "Invalid payload. Collection \"test_collection_2\" doesn't exist.",
      "stack":
          DirectusError: Invalid payload. Collection "test_collection_2" doesn't exist.
              at RelationsService.createOne (file:///directus/node_modules/.pnpm/file+api/node_modules/@directus/api/dist/services/relations.js:119:19)
              at file:///directus/node_modules/.pnpm/file+api/node_modules/@directus/api/dist/utils/apply-diff.js:206:44
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      "name": "DirectusError",
      "extensions": {
        "reason": "Collection \"test_collection_2\" doesn't exist"
      },
      "code": "INVALID_PAYLOAD",
      "status": 400
    }

After changing schema to be:
"schema": {"name": "test_collection_2"}
The apply works.

Maybe this is more of a Directus issue with the data coming out of the API? Thank you for considering this.

Add management for Roles & Permissions

To make this package complete, it would be really helpful to include roles and permissions in the export / import.

I know this technically is not schema, but is a key component for a full dev / prod sync.

Public Role Export

Great job on supporting also roles and permissions. am only missing public role import/export ?

Roles exports cannot be imported like schema exports

When importing a schema file, I can choose between two strategies:

Screenshot 2023-12-12 at 02-31-21 Ecobytes

  • Only create new collections
  • Create new collections and patch existing ones

Instead when importing roles that exist already, an error is thrown:

Screenshot 2023-12-11 at 18-29-44 Ecobytes

Maybe the same resolution logic that is used for choosing to skip existing collections or to identify the patch can also be offered for role imports?

Allow folder collections to be exported.

When i exporting my scheme from ui. i can't select "folder" collection.
when i importing my schema from another instance. i got following error:
Invalid foreign key for field "group" in collection "directus_collections" when importing.

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.