Coder Social home page Coder Social logo

Comments (1)

baltpeter avatar baltpeter commented on August 22, 2024

To explain why this happens: The JSON on the suggest page is also generated through the json-forms library, just like in the company JSON generator.

However, on the suggest page, we don't expose the slug field to the user. Instead, we guess a slug after the JSON has been generated:

website/src/suggest-edit.js

Lines 138 to 145 in f857edf

// Do some post-processing on the user-submitted data to make the review easier.
if (!data.slug) {
const DOMAIN = domainFromUrl(data.web);
data.slug = slugify(DOMAIN ? DOMAIN.replace('www.', '') : data.name);
}
if (!data['relevant-countries']) data['relevant-countries'] = ['all'];
if (data.phone) data.phone = formatPhoneNumber(data.phone);
if (data.fax) data.fax = formatPhoneNumber(data.fax);

It should be possible to add the slug at the beginning instead. If someone wants to take a look at that, please feel free!


In the meantime, to propose a workaround: When reviewing suggestions, I just always click the Edit link in the issue which open the suggestion in the company JSON generator. Re-exporting it from there also fixes the order of the properties.

from website.

Related Issues (20)

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.