What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Good morning 🙂 I want to introduce a new zed backend section for our current p

UPWG9AYH2
UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

Good morning 🙂
I want to introduce a new zed backend section for our current project. One form here will use a date time field which should behave like the “Valid From(GMT)” in the “Edit concrete products” form ( mainly to have a continous UX). So when moving to the input field, a calendar opens. I noticed, that the /assets/js/spryker-zed-productmanagement-main.js is responsible in the “Edit concrete products” form which is doing the additional calendar js magic … my question: whats the easiest/cleanest way to transfer that behaviour to my current (new) form? I can’t find anything in the docs, so i don’t know where to put new js at all for zed. Also tried to install current default js modules via run npm install for the projects package.json but it leads to many dependency errors (many module not found errors). Can somebody give me a clue? Best regards and have a nice day!

Comments

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Hi Ingo, here is a feedback from our development:

    The basic documentation for that is here: <https://documentation.spryker.com/front-end_developer_guide/zed/oryx/oryx-for-zed.htm?Highlight=oryx%20for%20zed>
    
    But it's not complete. The content of build.js  should be something like:
    
    const oryx = require('@spryker/oryx');
    const oryxForZed = require('@spryker/oryx-for-zed');
    const path = require('path');
    const myCustomZedSettings = Object.assign({}, oryxForZed.settings, {
        entry: {
            dirs: [path.resolve('./vendor/spryker'),path.resolve('./src/Pyz')],
            patterns: ['**/Zed/**/*.entry.js'],
            description: 'looking for entry points...',
            defineName: p => path.basename(p, '.entry.js')
        },
    });
    const configuration = oryxForZed.getConfiguration(myCustomZedSettings);
    oryx.build(configuration);
    
    on the package.json , the lines for running the zed scripts should be like:
    
    "zed": "node ./build",
        "zed:watch": "node ./build --dev",
    
    then, we can create a file, in any point of the zed module path, as long as it's name end with .entry.js
    
  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    And another one:

    this is not valid for the latest Suite, since we've changed the format of the configuration.
    here's version for latest suite:
    
    'use strict';
    const oryx = require('@spryker/oryx');
    const api = require('@spryker/oryx-for-zed/lib');
    const path = require('path');
    const settings = Object.assign({}, api.settings, {
        entry: {
            dirs: [
                path.resolve('./vendor/spryker'),
                path.resolve('./vendor/spryker-eco'),
                path.resolve('./src/Pyz')
            ],
            patterns: ['**/Zed/**/*.entry.js'],
            description: 'looking for entry points...',
            defineName: p => path.basename(p, '.entry.js')
        },
    });
    api.getConfiguration(settings)
    .then(configuration => oryx.build(configuration))
    .catch(error => console.error('An error occurred while creating configuration', error));
    
  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    Ok thanks, i’ll try that!