Git Product home page Git Product logo

elasticms's People

Contributors

coppee avatar davidmattei avatar isamic avatar sylver4 avatar theus77 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

elasticms's Issues

Releases for revisions

Why

When comparing environments, sometimes only a subset of data needs to be published. When environments are not synced, or when many maintainances are ongoing, the risk of error is growing.
Therefore we should be able to attach revisions to a release, and publish (apply) that release to an environment.

How

As discussed with Mathieu:

  • No changes in the UX when creating and editing content revisions
  • Have an admin view "Releases" in which
    • new releases can be created
    • existing releases can be applied to an existing environment
    • a release can be reverted

Create a new release

  • Chose a name and add revisions to your release.
  • By default all content is shown to be selected, showing the most recent changed revisions first. Only revisions in their default environment are available to select.
  • Facets are available to filter on content type.
  • Search field is available to filter (at least introducing the ouuid of a revision should work)

Apply a release

  • Select an environment to apply the release to.
  • If the selected environment is the default environment of a release, nothing happens
  • if the selected environment is another environment, the revision in the default environment will be published to that environment
  • Save this action to allow for a revert
    • Store database ID of every revision that was originally in the "to" environment

Revert the application of a release

  • Select an applied release to rollback
  • Verify for every stored database ID that it is still available (with revision_to date null) --> This might not be a good check!
  • If the rollback is possible: apply it
  • Else generate an error message that rollback is not possible

JsonMenuNested child type removed

When we remove a child type from a json menu structure.

Any existing document using this type, is throwing an error.

Cause because we want to get the node which is not there anymore.

Maintain relationship between 2 revisions (update referrer) and with JsonMenuNested

Simple case:

  • Club content type with a multiple data link field related_players.
  • Player content type with a single or multiple data link field type called club(s) and a update referrers value related_players
    If we create or update a player and we change the club, the referred club field related_players will be updated.

Advanced case (jsonMenuNested)

A content type called structure for creating league nodes, which can contain club nodes, which can contain player nodes. The player node has a data link field type to the player document. When we save the structure, all changed player nodes should be updated.
A content type called player which should contain the club based from the structure.

Issues

  • To many revisions: a dashboard view for managing a structure, is already creating a lot of revisions. Now also updating the related changed relationships, will create even more revisions.

Todo

  • The revision event listener, which is responsible for updating changed relationships, should NOT touch revisions that are already in draft. This relationship will be updated on finalization of the draft, but what if the draft gets discard? The relationship is broken.

Proposal

Image we can define a new view type: searchable. In this view we can query for documents, normally starting from the attached contentType. And it will create new documents. This way we can merge documents and make it easy for the frontend to aggregate.

This view should be called after rebuild, reindex, recompute. And maybe also if we finalize a revision passing the revision ouuid, so that the view knows he only needs too recreate for the passed revision.

If something changed in the jsonMenuNested, instead of updating the referrer (+++revisions), we are just triggering the new view type and passing the ouuids. The view will then update the passed ouuids.

Once at night to be sure, we can just rebuild the searchable view types.

Not able to get boolean values from select

I have a field EMS\CoreBundle\Form\DataField\SelectFieldType defined with the options :

true
false

But it gets indexed as strings ("true", "false") but I want to get the real boolean values out of it in elasticsearch

New users should change their password

When a user logs in for the first time, he should be required to change his password.

Alternatively, there should be a checkbox "user is required to change their password" on the create user form, which is checked by default.

Feature request: copy/paste

Make the copy/paste fully javascript. Currently you get redirect to the raw view and then need to go back for pasting the copied data.

Also nice improvement: When pasting the copied data, show a modal for modifying the copied data before pasting it.

Agnostic front-end ?

$builder->add('remove', SubmitEmsType::class, [
        'attr' => [
                'class' => 'btn btn-primary btn-sm ',
        ],
        'icon' => 'fa fa-trash',
]);
$builder->add('remove', SubmitEmsType::class, [
        'attr' => [
                'class' => 'ems-button ems-button--primary ems-button--small',
        ],
        'icon' => 'ems-icon-trash',
]);

User content type + login form

Some route shoulb be defined for some role. The user should be able to login based on a user defined in a ems content type

AlignCommand gives 403 error after 5 minutes

The command "php bin/console ems:env:align preview template --force" crashes after exactly 5 minutes with the following error message:

Message: "" {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\Forbidden403Exception(code: 403):  at /opt/src/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:600)","command":"'ems:env:align' preview template --force --verbose","message":""} []
09:32:20 ERROR     [console] Error thrown while running command "'ems:env:align' preview template --force --verbose". Message: "" ["exception" => Elasticsearch\Common\Exceptions\Forbidden403Exception^ { …},"command" => "'ems:env:align' preview template --force --verbose","message" => ""]
In Connection.php line 600:  [Elasticsearch\Common\Exceptions\Forbidden403Exception (403)]  

Specifying the ScrollSize and ScrollTimeout doesn't seem to make a difference.

According to some fora, this error usually relates to lack of space. The command works locally so most likely server limitations are the cause. However, we need to adapt the script to bypass these limitations (e.g. bulkSize parameter)

Refactor asset processors as tagged services

With that approach it will be easier to add a processor. In this bundle or somewhere else. Like a processor specific to the core or a project specific processor.

The processor will be identified with the config attribute _config_type.

Once this refactoring done, with 3 first processors; default, image, zip, a next processor could be a chained one allowing to apply multiple config:

{
     "_config_type": "chain",
     "_chained": [{
          "_config_type": "rotate-image",
          "_rotate": 66
     },{
          "_config_type": "image",
          "_flip_horizontal": true
     }] 
}

Silent publish jsonMenuNested multiplex

The silent publish does not work for multiplex fields

example document:

{"fr":{"title":"Title FR","structure":"{}"},"nl":{"title":"Title NL","structure":"{}"}}

They controller should support nl.structure as field_document.

src/Controller/Revision/JsonMenuNestedController.php -> silentPublish(...

$rawData = $revision->getRawData();
RecursiveMapper::mapPropertyValue($rawData, function (string $property, $v) use ($field, $updateJson) {

Suggestion improve the RecursiveMapper function so that he return the full property path.

Warning CollectionFieldType -> max restriction options with no data

When we define the max value of a collectionFieldType and there is no data we get a warning

Warning: count(): Parameter must be an array or an object that implements Countable

if (!empty($restrictionOptions['max']) && \count($dataField->getRawData()) > $restrictionOptions['max']) {

in vendor/elasticms/core-bundle/src/Form/DataField/CollectionFieldType.php (line 156)

Comming back from "switch user" without going through the "exit" button.

Expected Behavior

When you impersonate a user using the "Switch User" button. You can go back to your own user/rights using the "Exit" button. However, it is possible to ge back in the browser history and find yourself on a page where you are your own again (without using the Exit button).

When the back button is used, and you find yourself on the page of your own user without using the "exit" button. You should either get an error and offered the option to click on "exit". Or the "exit" functionality should automatically trigger. --> Whenever using "Back" on the browser, the user token should be verified to be the one corresponding to the page we opened.

Current Behavior

When going back to your original user via the "browser back button". You are presented the screen of your own user. However if you decide to perform an action (e.g. edit a user) you get a "access denied" error.

Possible Solution

Steps to Reproduce

  1. In a backend, go to the /user url.
  2. Click on "switch user" for a user that has minimal permissions
  3. Use the browser back button.
  4. Click on "edit" button next to a user
  5. Access denied error will be thrown as the system thinks you are still impersonating the user, however the system is showing you as your own user.

Context (Environment)

Detailed Description

Possible Implementation

Performance issue for the "edit structure" page of a content type

The "edit structure" page of any content type that has a substantial amount of fields loads slow.
Route: /content-type/structure/{id}

This is because we load 3 modals (+field, options, duplicate) for every field.

Possible solutions are to optimize the page by reusing fields, making the modals load with ajax or moving the modals to different routes. To be discussed.

Splitted Role for "create" and "edit" content-type

Currently, for each contenttype we can define a create and edit role. However, if you only have the create role, you can create a new draft. Which redirects to the edit route, for which you do not have permissions.

So you can create empty drafts, but not fill in any details.

Can we define what should happen in this case? Is this expected behavior? Should we not split up these two permissions? Or should "create" be able to do the very first "finalize" step?

Add custom data transformers

Today we have one datatransformer available for fields that are 100% numeric:

  • EMS\FormBundle\Components\DataTransformers\ForgivingNumberDataTransformer

The same DataTransformer should be created for alphanumeric fields:

  • EMS\FormBundle\Components\DataTransformers\ForgivingAlphaNumericDataTransformer

And this should be made extendeable so that we can add custom dataTransformers for specific custom fields.

Database submit endpoint not configurable

The DB endpoint should not use Symfony by default (via config). We should be able from one backend to post into multiple databases. This would align the strategy of the DBsubmit to the strategy of our other submits.

Front packages refactoring

The goals are :

  • remove the hard dependency with Admin-LTE
  • lighten our dependencies and update them
  • try to choose and use 1 script by need/feature: e.g. date-time-range-picker (5 scripts) or sortable/draggable (4 scripts)
  • update dev dependencies (Webpack 5)

Dependencies

Name Current Latest Using
@a2lix/symfony-collection ^0.4.0 (Apr 2, 2020) core.js
ace-builds ^1.4.12 (Jul 6, 2020) core.js
admin-lte 2.4.18 3.1.0 core.js
bootstrap-fileinput 4.5.3 5.2.6 core.js
bootstrap-sass 3.4.1 app.scss
bootstrap-select ^1.13.18 core.js
ckeditor4 4.16.0 4.16.2 core.js
crypto-js 3.3.0 4.1.1 core.js
datepicker ^0.0.0 ??
daterangepicker 3.1.0 3.1.0 (Jul 31, 2020) core.js
eonasdan-bootstrap-datetimepicker 4.17.49 (Feb 28, 2017) core.js
fullcalendar 3.10.2 5.9.0 core.js (2x)
icheck 1.0.2 1.0.3 core.js
jquery-lazyload ^1.9.7 (Mar 26, 2016) core.js
jquery-match-height ^0.7.2 (Aug 24, 2018) core.js
jquery-ui ^1.12.1 core.js
moment ^2.29.1 (Oct 6, 2020) core.js (2x)
nestedSortable ^1.3.4 (Apr 28, 2011) 2.0.0 (Mar 31, 2016) core.js
select2 4.0.13 4.1.0-rc.0 core.js
sortablejs ^1.14.0
uuid 3.4.0 8.3.2

Dependencies Admin-lte

Name Current Latest Using
bootstrap ^3.4 core.js
bootstrap-colorpicker ^2.5.3 3.4.0 (Aug 19) core.js
bootstrap-datepicker ^1.8 1.9.0 (May 20, 2019) core.js
bootstrap-daterangepicker ^2.1.25 3.1 (May 24, 2020) Commented in core.js
bootstrap-slider 9.10.0 core.js
chart.js ^1 3.5.1 (Aug 18) core.js
ckeditor4 ^4.11.2 already core.js
datatables.net ^1.10.19 1.11.3 core.js
datatables.net-bs ^1.10.19 1.11.3 core.js
fastclick ^1.0.6 (Jan 26, 2015) core.js
flot ^0.8.3 4.2.2 core.js
font-awesome ^4.7 app.scss
fullcalendar ^3.10 already core.js
inputmask ^3.3.7 5.0.6 core.js
ion-rangeslider ^2.3 (Dec 19, 2019) core.js
ionicons 3.0.0 5.5.3 (Aug 3) app.scss
jquery 3.5.1 3.6.0 core.js (2x)
jquery-knob ^1.2.11 1.2.13 (Dec 16, 2015) core.js
jquery-sparkline ^2.4 (Sep 14, 2013) core.js
jquery-ui ^1.12.1 already core.js
jvectormap ^1.2.2 2.0.5 (Jan 19, 2020) core.js
moment ^2.24 already core.js
morris.js ^0.5 (Sep 13, 2016)
pace 0.0.4 (Aug 24, 2012) core.js
raphael ^2.2.7 core.js
select2 ^4.0.3 already core.js
slimscroll ^0.9.1 (May 16, 2014) core.js

Dev dependencies

Name Current Latest Using
@babel/core 7.14.2 7.15.5
@babel/polyfill ^7.12.1
@babel/preset-env 7.14.2 7.15.6
@babel/register 7.13.16 7.15.3
babel-loader ^8.2.2
bootstrap-timepicker ^0.5.2 (Jan 4, 2016)
chokidar ^3.5.2
copy-webpack-plugin 5.1.2 9.0.1
css-loader 1.0.1 6.3.0
file-loader 2.0.0 6.2.0
less 3.13.1 4.1.1
less-loader 4.1.0 10.0.1
mini-css-extract-plugin 0.4.5 2.3.0
node-sass 4.14.1 6.0.1
postcss-loader 3.0.0 6.1.1
sass-loader 7.3.1 12.1.0
style-loader 0.23.1 3.3.0
url-loader 1.1.2 4.1.1
webpack 4.46.0 5.54.0
webpack-cli 3.3.12 4.8.0

JSON menu nested use asset saveConfig

Just like the datatables the JsonMenuNested should use the asset saveConfig, for preventing that url's and post data get's to big.

Config & defaultData parameter.

Permalinks

Static applications might reference pages on websites generated by the ClientHelperBundle. However, the title of a page determines the URL, so the URL changes on every title update.

Problem

This requires a deployement to fix these static applications.

Solution

Generate permalinks for every page that uses dynamic slugs for access.

Proposition

We could make it possible to access a page through its technical details, for example:
/_locale/permalink/<content_type_name>/<_ouiid>

  • Nice to have: an automatic redirect to the more readable slug, which requires reverse engineering of the routing configurations [at a first glance this seems hard to achief]
  • There might be issues with contents that are not accessible "on their own", for example content that is only shown in a list would now be accessible directly using its permalink.

Task improvement/suggestion

Suggestion (keep version):

When we create a new version we now create a new revision with a new ouuid. We should keep the ouuid and give the pervious version a new ouuid. This solves the following issue:

  • Tasks are saved on a revision, creating a new version is not moving the tasks.
  • Internal links are not going to the current version.

Switching the ouuid or changing the ouuid on the previous version, we should update offcourse all revisions of that version (silent publications)

Document Signature - EMSCO_PUBLIC_KEY (not used?)

The EMSCO_PUBLIC_KEY is not used in any service, we are just looking at the private key.
We should also make a seperate SigningService and remove logic from DataService

For the documentation:

  • EMSCO_PUBLIC_KEY (mandatory): Path to a public key. The public key file needs to be in OpenSSH's format. It should look something like: ssh-rsa AAAAB3NzaC1yc2EAAA....NX6sqSnHA8= rsa-key-20121110
  • EMSCO_PRIVATE_KEY (mandatory): Path to a private key.

Expression Language for 'expression' and 'required if'

We should think about a way to log information when is_bool returns false. That would make it easier for debugging of custom expressions written in the backend of our forms.

For example: creation of an expressionLanguageService that covers the try/catch block, and adds logging in the case that an expression does not evaluate to a boolean.

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.