Giter Club home page Giter Club logo

crowdsignal-ui's Introduction

Crowdsignal UI

This repository contains the front-end code for Crowdsignal.com

Development

After cloning the repo here are the steps to run the project. NOTE: This project needs exactly Node v14.15.0 and NPM 6.14.8. You will also need to install Yarn.

Install dependencies

yarn install
yarn build-gutenberg

We recommend running yarn install often to pull in added/updated packages. This will make sure you are all up to date.

Update Host File

For the CS-UI project to run in your browser, you will need to add this record in your hosts file:

127.0.0.1 crowdsignal.localhost

This can be done with iHosts or Gasmask

To be able to load resources on localhost, you'll need to be sandboxed. You can open up a blank terminal window and connect to sandbox.

In addition, add these to the host file:

192.0.123.182 app.crowdsignal.com
192.0.123.182 api.crowdsignal.com
192.0.123.182 survey.fm
192.0.123.182 poll.fm
192.0.123.182 polldaddy.com
192.0.123.182 api.polldaddy.com
192.0.123.182 files.polldaddy.com

where 192.0.123.182 is your Polldaddy sandbox ID

Clear Cache

Whenever a change is made to the hosts file, it's good to clear out the browser's host cache. Use this script to run:

# Flush DNS cache.
sudo dscacheutil -flushcache;
sudo killall -HUP mDNSResponder;

# Clear Chrome's DNS cache.
osascript <<EOD
        tell application "Google Chrome"
                tell front window

                set curTab to active tab index

                set dnsTab to make new tab with properties {URL:"chrome://net-internals/#dns"}
                set dnsTabReady to not loading of dnsTab

                repeat until dnsTabReady
                        set dnsTabReady to not loading of dnsTab
                end repeat

                execute dnsTab javascript "
                        document.getElementById('dns-view-clear-cache').click();
                        document.getElementById('sockets-view-flush-button').click();
                "
                close dnsTab
                set active tab index to curTab

                end tell
        end tell
EOD

Start development

yarn start

Site can be viewed at https://crowdsignal.localhost:9000/project

Run storybook

To leverage Storybook running on http://localhost:8000 run

yarn storybook

Generate release build

yarn build

Then copy the files in /dist to your crowdsignal sandbox at /app.crowdsignal.com/public_html/ui/:

  • /next is for internal testing
  • /stable is for public release

Create a PR and deploy once you're satisfied everything is working.

Troubleshooting

How to Install Node 14.15 If you have an M1 Machine (non-Intel), you'll need to use Terminal in a Rosetta to install Node 14.15

Check for correct IP Address Some assets won't load properly if you aren't connected to your sandbox. Run ping app.crowdsignal.com. This should return your sandbox IP address.

crowdsignal-ui's People

Contributors

cgastrell avatar dustinhartzler avatar ice9js avatar jcheringer avatar jgcaruso avatar oskosk avatar thestevek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crowdsignal-ui's Issues

Attribute name change

As seen on

that attribute should be called “question”. Otherwise we’ll need to parse the attributes different than text-question or do some mapping. The reason being there can’t be an input without a question (by design). If this needs to be optional, we can come up with the question as a sidebar entry or some other magic that can hold some default value. This is specially true for the results view where, without a question, responses to that question are somewhat confusing. Not to mention our results view can’t handle a question block without a question.

What do you think @jcheringer @ice9js ?

Inserter showing incorrect blocks

There's an issue with the inserter where it will start showing unwanted block types once you start editing the content.

Steps to reproduce

  • Go to crowdsignal.localhost:9000/project and start a new project.
  • Open the inserter, it should only contain blocks from the allowed list.
  • Write some text in the editor, wait for the project to change and write some more. (The editor reloads when it first saves, which will reset the inserter state).
  • You'll see additional blocks including theme and layout specific ones appear in the inserter.

This issue occurs repeatedly when switching pages. When switching to a new page the inserter will feature the correct selection of blocks and add the remaining ones as soon as you start editing.

Possible fix

This issue seems to be caused by this line in Automattic/isolated-block-editor.
Commenting out the line fixes the issue however that's not necessarily the correct fix. Once the issue is addressed in Automattic/isolated-block-editor, we'll need to update our dependencies to fix it here as well.

Title gets cut if typing while a save happens

Type something on a new project, click on title and start typing. The auto-save will trigger and whatever you're typing will get truncated against whatever comes back from the save process

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.