Giter Club home page Giter Club logo

manager's Introduction

BEdita Manager

Github Actions PHP Github Actions Javascript codecov phpstan psalm Scrutinizer Code Quality Version License

Backend Manager for BEdita API.

Prerequisites

Install

  • Create project via composer
composer create-project bedita/manager

This will create a new manager folder and install composer dependencies. If you are using a .zip or .tar.gz release file you just need to unpack it and then run composer install. Run same command if you do a git clone on this repo.

  • Build JS/CSS bundles with yarn from manager folder
yarn && yarn build
  • Configure BEdita API base URL and API KEY in config/.env like:
# set BEDITA base URL
export BEDITA_API="{bedita-url}"
# set BEDITA API KEY (optional)
export BEDITA_API_KEY="{bedita-api-key}"

To test the webapp you can simply run builtin webserver from manager folder like this

bin/cake server

And then point your browser to http://localhost:8765/

For any other use than a simple test we recommend to configure your preferred web server like Nginx/Apache and point to webroot/ as vhost document root.

## Configuration

You can further configure your BEdita Manager instance in config/app_local.php with environment and project specific settings.

Have look at the main Manager configuration wiki page on how to customize your Manager instance.

Docker

Pull official image

Get latest offical image build from Docker Hub

docker pull bedita/manager:4

Build image

If you want to build an image from local sources you can do it like this from root folder:

docker build -t manager-local .

You may of course choose whatever name you like for the generated image instead of manager-local.

Run

Run a Docker image setting API base url and API KEY like this:

docker run -p 8080:80 \
    --env BEDITA_API={bedita-api-url} --env BEDITA_API_KEY={bedita-api-key} \
    bedita/manager:latest

Replace bedita/manager:latest with manager-local (or other chosen name) to lanch a local built image.

JS Development with webpack

Using .env

It's easy to configure config/.env to match your web server and proxy requirements, see below. (default proxy: localhost:8080, default server: localhost:3000)

# BE Manager Entry Point
WEBPACK_SERVER_HOST=localhost
WEBPACK_SERVER_PORT=3000

# Proxy server
WEBPACK_PROXY_HOST=local-be4-web
WEBPACK_PROXY_PORT=8080

To start develop mode run

yarn develop

Production build with Bundle Report

yarn run bundle-report

ESlint

  • Run ESlint via yarn, to check linting on js files
yarn run eslint resources/js/app/pages/admin/index.js

Run unit tests

To setup tests locally simply copy tests/.env.example to tests/.env and set env vars accordingly. To launch tests:

vendors/bin/phpunit [test folder or file, default '/tests']

To run those tests you may want to use a Docker image as BEdita4 API endpoint. For instance if you can pull a Docker image via docker pull bedita/bedita:4 or docker pull bedita/bedita:5

Then you may run the image with

docker run -p 8090:80 --env BEDITA_ADMIN_USR=bedita --env BEDITA_ADMIN_PWD=bedita bedita/bedita:5

You can then set env vars accordingly like this:

export BEDITA_API="http://localhost:8090"
export BEDITA_ADMIN_USR="bedita"
export BEDITA_ADMIN_PWD="bedita"

and you're ready to go

Licensing

BEdita is released under LGPL, Lesser General Public License v3.

manager's People

Contributors

andresbautista avatar batopa avatar dariosacco avatar dependabot[bot] avatar didoda avatar edoardocavazza avatar fquffio avatar giacomor91 avatar le0m avatar nicolocarpignoli avatar nikazzio avatar paolosantarsiero avatar qwerg avatar stefanorosanelli avatar vallo87 avatar xho avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

manager's Issues

Alert on page change

In case of unsaved data in single object view page an alert must appear to user

thumb: response 'acceptable' and 'ready'

Response data in meta.thumbnails could contain info acceptable and ready.
Thumb helper should manage these cases:

  • acceptable is false, thumbnail for image won't be created
  • acceptable is true (or is absent) and ready is false, thumbnail for image is still not available, but it will
  • acceptable is true (or is absent) and ready is true, thumbnail is available

Object relations

In single object view:

  • display all available relations
  • for each relation a paginated list of related objects should be displayed with params - use ajax (??)
  • add object to relation -> modal view?
  • remove related object
  • modify related object params or relation position

Relations: add new object

Instead of associating existing objects we may need to create and associate new objects.
Typical use case: new files or images to attach -> upload action necessary.

Handle `date` properties

After bedita/bedita#1515 we must properly handle the new date type.

PS: currently in Profiles saving a birthdate generates an error

Related objects: add search and pagination

In related objects panel using add objects we need:

  • query filter to perform simple search using q query string
  • pagination
  • type selection if more types are available (this can be done later in another issue)

Date pickers

Date attributes with JSON Schema type:

{
  "type": "string",
  "format": "date-time"
}

should have a datepicker UI widget

Parent relation for folders

Every folder object can belong to only one folder or be root folder.
Select parent root browsing the tree.

Success and error message

Refactor is necessary

Success message should automatically disappear after a few seconds - or user must not be forced to click.
On error message a user may instead be forced to click, but other options are possibile.

Handle relations parameters

In /model/relations/$id inside data.attributes.params we may have a JSON Schema representation of the relation properties, could also be empty.

In the object card now relation parameters are displayed but may not be changed.
Form handling with JSON Schema should keep advantage of existing SchemaHelper

Profile page

Page with logged user data from User: ### on left menu

User should be able to change properties like:

  • password - with password confirm
  • name, surname, email.... and other attributes like city, address if available

Unchangeable properties:

  • username
  • uname
  • status

Current roles can be displayed but not changed

Show included `stream` in single item view

single object view should display included stream, if present
call to GET /images/{id} may include also:

 "included": [
        {
            "id": "b1f3e797-558d-4310-a9dc-f0c19927eb85",
            "type": "streams",
            "attributes": {
                "file_name": "my-image.png",
                "mime_type": "image/png"
            },
            "meta": {
                "version": 1,
                "file_size": 122927,
                "hash_md5": "23de017e93556d45f5b69dd508a868f7",
                "hash_sha1": "74fa37b617a0daad926c68d66fc451a246943ae5",
                "width": null,
                "height": null,
                "duration": null,
                "created": "2018-03-14T08:25:54+00:00",
                "modified": "2018-03-14T08:25:54+00:00",
                "url": "http://example.com/files/b1f3e797-558d-4310-a9dc-f0c19927eb85-doorway-platform.png"
            }
        }
    ]

attributes and meta shoud be displayed read-only they're not chengeable
link to image and image itself should be displayed.
[https://github.com/bedita/php-sdk/issues/10 will provide thumb generation, soon]

Error handling templates

API errors are handled but Internal app errors view are still missing.

Example: /documents/view or /documents/abc return missing controller page

Basic `Admin` module

  • only available to admin users
  • basic handling of applications, jobs, config and custom endpoints
  • also roles ??

Relation panel styles and more

After #112, relation panel contains filter search and pagination links.
Still to do:

  • better styles for pagination links (i.e. 1 ... [n-1] [n] [n+1] ... m)
  • show loader
  • show total items by filter/search

Object view refactor

Field order and positioning refactor.
Two columns and different attributes groups.

Find by id/uname

Like in BE3 a simple input to load directly an object by its id or uname

Users form field order

Form fields order in user view (existing o new) is misleading.

Main attributes here are:

  • username and passowrd - confirm password fields
  • name
  • surname
  • email

All other attributes may go in other attributes

Introduce EmbedMedia helper

Used in media object types view:

  • if object is remote with embedded HTML player -> display the player
  • if an image with a stream create a thumbnail with ThumbHelper

Properties groups

Current groups:

  • index - list view
  • core - core module properties
  • other - simply defined as all properties - core

Define new groups with configuration and set new groups for views

Object relations

In single object view:

  • display all available relations
  • for each relation a paginated list of related objects should be displayed with params - use ajax (??)
  • add object to relation -> modal view?
  • remove related object
  • modify related object params or relation position

Trash - better usability

Desiderata:

  • Mantain filter after click on Restore and Delete
  • Empty trash button (when filter selected, remove only current type, i.e. media, when page is /trash?filter%5Btype%5D=media, otherwise remove all objects from trash)

Error layout

Uniform error layout and pages to default layout with minimalist style.

Dynamic module colors

Colors cannot be statically defined in CSS like in BE3

Initial proposal:

  • in config/app.php
    'Modules' => [
        'colors' => [
            'documents' => '#FF6600',
            'users' => '#555555',
            'profiles' => '#003366',
       ],
   ],
  • simple inline CSS in default layout inside <head> tag using element

bulk operations in modules index

In module index page, it should possible perform bulk operations on elements, i.e.:

  • move to trash
  • change status (on/off/draft)
  • csv export (selected|all) ?

Richtext editor

Attributes with JSON Schema type:

{
  "type": "string",
  "contentMediaType": "text/html"
}

Should be displayed using a richtext editor like CKEditor

Handle type `array` schema

A JSON schema like the one provided below must be handled with checkboxes or other control in object view form.

{
  "type": "array",
  "uniqueItems": true,
  "items": {
      "type": "string",
      "enum": ["A", "B", "C", "D"]
  }
}

We don't need a general purpose array handler for now.
A simple string list case, like the one above, is enough.

Parents relation for leaf object

parents relation for every object not of type folders should display a browsable tree of available foders to select like in BE3

Checkboxes generated from SchemaHelper don't work

The SchemaHelper for checkbox doesn't generate checkbox in the right way.

For example see company field in Users object type. The checkbox is always checked and changing the check doesn't reflect on save.

Bulk action checkboxes

When in module list, selecting and deselecting multiple times brings to inconsistencies in the hidden input containing the array of ids.

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.