Git Product home page Git Product logo

scrivito / scrivito_example_app_js Goto Github PK

View Code? Open in Web Editor NEW
74.0 74.0 60.0 11.73 MB

Scrivito is a flexible, scalable, and secure web CMS built to orchestrate digital experiences globally across multiple channels, react to market changes quickly and deliver great results cost-efficiently.

Home Page: https://scrivito.com/

License: MIT License

HTML 0.20% JavaScript 53.10% SCSS 46.36% EJS 0.33%
cms content-management content-management-system javascript react reactjs scrivito

scrivito_example_app_js's People

Contributors

7ack7 avatar aea-jr avatar agessler avatar agsiegert avatar apepper avatar aviebke avatar code-constructor avatar dawgoc avatar dcsaszar avatar dependabot[bot] avatar gorgos avatar gwilczynski avatar kadirumac avatar kirkol avatar markus-codewrangler avatar patrykboch avatar phorsuedzie avatar pietruszka avatar thomasritz avatar thomaswitt avatar toaster avatar x3phiroth 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

Watchers

 avatar  avatar  avatar  avatar  avatar

scrivito_example_app_js's Issues

Tabs in Thumbnail Gallery Widget

Tabs in the Thumbnail Gallery Widget don't filter the images by tag, instead if one click on a Tab the images with this tag are hidden. This is due this line of code:

if (currentTag && tags.includes(currentTag)) {
    classNames.push("squeezed");
}

Solution:

if (currentTag && !tags.includes(currentTag)) {
    classNames.push("squeezed");
}

Bug: Providing `SCRIVITO_ENDPOINT` is not used

If you add a SCRIVITO_ENDPOINT into .env it is not applied in the compiled app.

Reason being, that it isn't forwarded to the environment Webpack uses for compiling the app.

--- a/webpack.config.js
+++ b/webpack.config.js
@@ -113,7 +113,7 @@ function webpackConfig(env = {}) {
       chunkFilename: "assets/chunk-[id].[contenthash].js",
       path: path.join(__dirname, buildPath),
     },
-    plugins: generatePlugins({ isProduction, isPrerendering, scrivitoOrigin }),
+    plugins: generatePlugins({ isProduction, isPrerendering, scrivitoOrigin, endpoint }),
     resolve: {
       extensions: [".js"],
       modules: ["node_modules"],
@@ -145,13 +145,13 @@ function generateEntry({ isPrerendering }) {
   return entry;
 }

-function generatePlugins({ isProduction, isPrerendering, scrivitoOrigin }) {
+function generatePlugins({ isProduction, isPrerendering, scrivitoOrigin, endpoint }) {
   const ignorePublicFiles = ["**/_headersCsp.json", "**/_headers"];

   const plugins = [
     new webpack.EnvironmentPlugin({
       NODE_ENV: isProduction ? "production" : "development",
-      SCRIVITO_ENDPOINT: "",
+      SCRIVITO_ENDPOINT: endpoint,
       SCRIVITO_ORIGIN: scrivitoOrigin,
       SCRIVITO_PRERENDER: "",
       SCRIVITO_TENANT: "",

Search with only a space breaks the page

http://localhost:8080/search-results?q=+

I got issues like:

Uncaught ClientError: Missing non-blank value (query term: {"field"=>"*", "operator"=>"contains_prefix", "value"=>" "})
    at errorForResponse (webpack:///../node_modules/scrivito/index.js?:9826:12)
    at handleAjaxResponse (webpack:///../node_modules/scrivito/index.js?:9789:17)
The above error occurred in the <SearchResultsComponent> component:
    in SearchResultsComponent (created by Scrivito.CurrentPage)
    in Scrivito.CurrentPage (created by App)
    in div (created by App)
    in div (created by App)
    in HelmetProvider (created by App)
    in CookieConsentProvider (created by App)
    in ErrorBoundary (created by App)
    in App

React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.

Wish: i18n implementation for example app

Scrivito itself can be switched between german and english but unfortunately in the example app all widget descriptions ... are hardcoded in english. The user ends up with a wild mixture of english and german just running the example app.

Maybe just add https://react.i18next.com/ to the mix or whatever lib you are already internally using for scrivito?

Screenshot 2023-06-29 at 15 28 35 Screenshot 2023-06-29 at 15 29 38

Wish: Add ability to read the tenant globally

Currently there is no way to read the tenant for external packages/components without a workaround.
Adding it to the global Scrivito Object or similar could help those external packages/components to get the tenant without workarounds.
An example to get/read it could be: Scrivito.getTenant() or Scrivito.getInstanceId() .

Links in Blog Overview Widgets don't adjust color according to background-image

When using the BlogOverviewWidget with a background-image selected, the font of the links don't adjust their color.

Bildschirmfoto 2021-04-15 um 12 29 12

Bildschirmfoto 2021-04-15 um 12 40 16

When the Widget is wrapped inside a section, the text is not displayed correctly. It seems to adjust to the color of the background image, not the color of the section. Although I am not sure the widget is supposed to be used that way.

Bildschirmfoto 2021-04-15 um 12 44 34

The color of the font seems to be controlled by the css-class .bg-dark-image

Hidden Field Widget in Form shows error

In a Form Widget AND NOT in a Cloumn Widget I am able to add Hidden Fields. There is no view for it so one gets "Widget could not be rendered due to application error.".
Though editors are supposed to add the Hidden Field in the FormWidget Properties, they can add them in the Form container. Instead of the error above they should somehow get a hint to use the properties.

blog post preview with missing whitespace

The blog post preview uses a concatenated version of the blog entry's page content. The concatenator (regarding to @dcsaszar it is in src/utils/textExtractFromHtml.js) does not add whitespaces when stripping <p> or <div> tags.

This leads to missing whitespaces and looks as if the content was broken.

New Build - Uncaught type error

Error msg:

index.js:1

Uncaught TypeError: Super expression must either be null or a function, not undefined
at index.js:1
at index.js:1
at t.a (index.js:1)
at new e (index.js:1)
at Function.value (index.js:1)
at Object. (index.js:1)
at n (index.js:1)
at Object. (index.js:1)
at n (index.js:1)
at Object. (index.js:1)

Steps taken

  1. Git clone repo
  2. npm install
  3. Add .env file
  4. npm run-script build
  5. Upload build.zip to instance
  6. View installed file https://5b2d0a653672df57503fdfed--secure-raspberry-scrivito-0621.netlify.com/

Insights

The site works fine on my localhost. Problem occurs when I upload the build.zip to the dashboard and view it in the temporary netlify url. The download zipfile from the dashboard works fine but not the clone of this repo.

Your help greatly appreciated.

Wish: (multi) enum Form Field for Form Widget

It is a usual need, that people offering a form need an enum field. We do not have this by now.
For example in a Form where people can register for an event:
Which kind of food do you like?
Everything | Fish | Veggi

Contact form design broken

Minor issue, but the contact form box for the message goes all the way through the label:

image

This is how it looks on Chrome and Safari, on Firefox it looks correct.

NPM Security Audit error

This occured on a fresh install with repo cloned from GitHub

                   === npm audit security report ===                        

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Manual Review โ”‚
โ”‚ Some vulnerabilities require your attention to resolve โ”‚
โ”‚ โ”‚
โ”‚ Visit https://go.npm.me/audit-guide for additional guidance โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ High โ”‚ Prototype Pollution โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Package โ”‚ lodash โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Patched in โ”‚ >=4.17.12 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Dependency of โ”‚ b9a5ee7f87d612320db5571b76b7f140b21b3454c5b98081f5fe8e2d48fโ€ฆ โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Path โ”‚ b9a5ee7f87d612320db5571b76b7f140b21b3454c5b98081f5fe8e2d48fโ€ฆ โ”‚
โ”‚ โ”‚ > lodash โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ More info โ”‚ https://npmjs.com/advisories/1065 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
found 1 high severity vulnerability in 15550 scanned packages
1 vulnerability requires manual review. See the full report for details.

fs-extra requires node 9, but .nvmrc has version 8

Great job with that example app, I just started using it again. It's awesome! Greetings to all of you from quarantine on the other side of the world. ๐Ÿ˜‰

One issue I found is that the upgrade in e817f2a requires node version 9+, but the .nvmrc still sets the version to node 8 which results in the prerender command failing.

Wish: advanced table widget that can be populated with a csv

Idea:
Editors that want to create tables like pricing lists can import a csv with this data.

Use Case:
Sometimes editors need to create big or complicated tables. The editor has this table as a file on his device and copies every single table data/cell into his table widget. Some of these tables contain data that is legally binding and therefore must not contain any errors. So the editor needs much time for transferring the table and afterwards he needs to inspect by heart if erverything is correct.
Since he has the data already in a file, he could simply export this as csv and upload this in a Widget or copy the content of the csv into atext field.

Blog post preview list gets inconsistent after hydration

Leaving this here for reference and to discuss a fix:

Because of timezone differences on the prerendering server and the client, the list of blog posts, with month separators, can become inconsistent after hydration.
In our case, we had a month separator that moved to another position, because the post was on the last of a month and on the first of the following month in the server-side vs. client-side render.

After hydration this left us with "dead" DOM elements, that were not removed by React, even with a rerender by calling setState.
Quoting from facebook/react#10591:

A rare but plausible scenario is that you have a list or something that depends on time to determine the order. E.g. something that conditionally pushes something on the top of a list if some time has elapsed. Or changes the the class name based on time elapsing. These cases are very theoretical though. I haven't seen one yet.

This is the "plausible scenario" in the wild. ๐ŸŽ‰

My suggestion for a fix is twofold:

  1. Force a rerender on the client like I did in #282 (which wasn't good enough for a fix)
  2. Include this.state.hasMounted in the key attributes of the timeline

This fixed the issue in our case, although I'm not sure if the keying according to SSR/CSR is just working by chance. I suspect this fix works because in the current (broken) version we have the same keys pointing to different DOM locations, which triggers the React SSR patching problem.

Column editor leads to an error after concurrent widget removal

  • Open the widget editor in tab 1
  • Using in-place editing, clear one of the columns of the widget in tab 2
  • Make a change to the column widths in tab 1

Expected

The columns are updated, ideally taking the concurrent changes into account.

Actual

An error occurred
invalid value for key 'content' of widget 641ab6b3: no widget definition for '933e283e' found in '_widget_pool': ["933e283e"]

image

Discussion

The editor stores the initial column content as state. This state is stale after the concurrent update.

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.