Code Monkey home page Code Monkey logo

a3-docs's People

Contributors

abea avatar agilbert avatar awan1 avatar bodonkey avatar boutell avatar dharmesh-hemaram avatar etlaurent avatar falkodev avatar fxpr avatar gregvanbrug avatar haroun avatar jamie-lemon avatar jithutj avatar myovchev avatar saikiran76 avatar siddhantpadma avatar stuartromanek avatar valjed avatar wyndace avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

a3-docs's Issues

[DOCS ISSUE] Page: Front end helper methods

Hello everybody, i'm a french junior dev on apostrophecms3.
Here is my problem :
I have a customer module with a favorites field :

favorites: {
label: 'apostrophe:favorites',
type: 'array',
titleField: 'favorite',
fields: {
add: {
type: {
type: 'string',
label: 'apostrophe:favoriteType',
},
id: {
type: 'string',
label: 'apostrophe:favoriteId',
},
}
}
},

I would like to add a new favorite for this customer by clicking a button on the article page.

But i can't find the way to do it in my index.js front file.

Here is a part of my code :

favorite.addEventListener('click', () => {

      addFavorite(favorite.id)  // favorite.id is defined
   
    })

async function addFavorite(favoriteId) {

  const customerId = sessionStorage.getItem('aposCustomerId')

  try {
    
        ???? what's going on here ????
  
  } catch (err) {
    console.error(err)
  } finally {
  }
}

Thanks a lot for your help !

Example localization configuration produces error

module.exports = {
options: {
locales: {
en: {
label: 'English'
},
es: {
label: 'Spanish'
},
'es-MX': {
label: 'Spanish (Mexico)'
},
'fr-CA': {
label: 'French (Canada)'
},
'en-CA': {
label: 'English (Canada)'
}
}
}
}

Gives me the error

Error: The locale "es" cannot be distinguished from earlier locales.
Make sure it is uniquely distinguished by its hostname option,
prefix option or a combination of the two.
One locale per site may be a default with neither hostname nor prefix,
and one locale per hostname may be a default for that hostname without a prefix.

I reset my local db, thinking it could have been previous config get tangled up but it also happens on a fresh db. Is this config wrong?

Demonstrate how publishing workflows differ for admins and contributors

The problem to solve

Documenting a discussion in Discord: I was not aware that the publishing workflow looked different for admins (draft --> published) and contributors (draft --> submitted for review). Providing a short demo, e.g. on the Users doc page, could highlight this, which may be an important feature for users (it was for me!).

Proposed solution

On the Users doc page, provide the following demo (with screenshots as appropriate)

  1. Log on as admin (already created during setup)
  2. Create new content, publish it. Call out the buttons that were clicked and how draft went to published
  3. Create a new user that has contributor permissions (following instructions higher up on the page)
  4. Log in as the new user
  5. Modify the content created in step 2, submit it. Call out the different workflow.
  6. Log back in as the admin, show how the submitted draft appears in the inbox, and how to publish the proposed changes.

Alternatives

The demo isn't strictly necessary, e.g. this could just be described. Seeing how the UI changes might be valuable though.

Additional context

N/A

[DOCS ISSUE] Page: Setting up

how to boot up a project that is already initiated. not migration but setup to start up and populate the database from a fresh custom git pull that has the framework... ? I might be getting the wrong perspective i don't know help please ...

[DOCS ISSUE] Page: select

Hello, i'm starting a project with the new version and i was looking to add the showFields to the choices array but can't find how to do it, it is enabled on this version?

[DOCS ISSUE] Page: Accessing the database directly

Syntax error in code, methods self should have a return statement.

 methods (self) {
    return {
async addNewDog(req, initialInfo) {

Also, it is unclear how to actually do this step: "For example, if we had a dog adoption website that used an external API, we may want to update dog pieces periodically with adoption status. This may be using a command line task that is run regularly by a cron job."

So, how would you do that kind of command-line task? How do you get access to the module and invoke addNewDog?

Best regards

Showing the relationshipReverse

Hello, i am actually trying to show the relationshipReverse on the editor from the other side so the editors can check which elements are related but the guide says that "There is no editing interface for this field type as the relationship is defined in the paired relationship field.", is there a way to enable it for the editors to see the relationshipReverse?.

I have tried by adding an array field that it's being updated when the relation changes but it's hard to make it work so the relations are actualized for both sides.

That's why i am trying to enable the editing interface but can't find how

No favicon set

The problem to solve

Is your feature request related to a problem you are experiencing that is not a bug? Please describe.

A clear and concise description of what the problem is. Ex: "When I do [some task], I find it frustrating when [something happens]." If this is a bug report (things are actually breaking), open a bug report instead.

Currently, the a3 doc pages do not have a favicon set.

Proposed solution

Describe the solution you'd like

A clear and concise description of what you want to happen.

An ApostropheCMS or other appropriate favicon should be added to the documentation pages. It is unclear if this should be the same as the main pages or not.

Alternatives

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered. For example, should this be done on the project level instead?

Additional context

Mention any other context or attach screenshots regarding the feature request.
Check the existing issue labels and add any you think are relevant, e.g.,
UI, UX, accessibility, security.

TYPO - PR - Question

Typo on line 10 of

apos-app/modules/@apostrophecms/home-page/views/page.html

"Even with fancy spell checking IDE plugins, mistakes happen. If you've found spelling mistakes"

Should I submit this as a bug?

typo-apos-app-html

Grouping New Pieces in the Admin Bar

How can I Group New Pieces in the Admin Bar?

When I create new piece types, I get a link to manage that piece type in the admin bar.
I would like to be able to group these new pieces - and potentially existing default pieces - into dropdowns in the admin bar, for example:

Page Content

  • Reviews
  • Testimonials
  • Offices

Imagery

  • Images
  • Image Tags

Etc...

Is this something that is already possible?
I have not found it covered in the docs.

Thanks

[DOCS ISSUE] Page: Customizing the user interface

Sorry for troubling again, i was looking to make the editor interface more user friendly and i have managed to do it like that:

// modules/asset/ui/src/scss/_widgets.scss -> follows the structure from the A3-Boilerplate from the tutorial
/// more styles rules
.apos-area-widget-wrapper {
  .apos-area-widget-inner {
    .apos-area-widget-controls {
      opacity: 0.3;
      &.apos-is-visible {
        opacity: 1;
      }
    }
  }
}
.apos-button-group--vertical .apos-button-group__inner {
  flex-direction: row !important;
}
/// more styles rules

But looking at the next info i'm not sure if i can do it in other way for also add new icons/buttons to the editor modal:

  1. Customizing the user interface
  2. Overriding standard Vue.js components through configuration
  3. Custom schema field types

There is any info about things like those?:

  • Add a new option to the pieces list modal that allow publish/duplicate multiple selection.
  • Add a new button to any widget editor modal (like the move up/down for contextual editing).
  • Modify the widget modal for add tabs with the groups like the pieces.

I have taken a look to the source code from rich-text, image and others but i am not sure enough about where i can modify/add those kinds of things and when is recommended to work with vue.

[DOCS ISSUE] Page: dateAndTime

Per the docs here for the date nunjucks filter provided by apostrophe:
https://v3.docs.apostrophecms.org/reference/field-types/dateAndTime.html#use-in-templates

To print them in the format of your choice pass a momentjs/datejs compliant format string to the date Nunjucks filter

The problem is that what's actually being used is dayjs, per the following line:
https://github.com/apostrophecms/apostrophe/blob/4dbfe8e5fc2b470bcee08e8f7cca5f4d925e3a66/modules/%40apostrophecms/template/index.js#L493

This can cause confusion because, aside from the fact that datejs is not actually used anywhere, those libraries don't necessarily have cross-compatible format options. As an example, the docs link directly to the format options for momentjs in the line above, which has had the formatting option X for Unix timestamp since moment v2.0. This is not available in dayjs, which is the actual library used.

I'd suggest removing any mentions of momentjs, since that's only used in the launder dependency now, fixing the incorrect datejs reference to dayjs, and linking to dayjs' formatting docs:
https://day.js.org/docs/en/display/format

[DOCS ISSUE] Page: Setting up

On the paragraph "Install the CLI tool:" the command is:

npm install @apostrophecms/cli
# Or `yarn install`, if you prefer. We'll stick to npm commands.

But since the CLI is "global", maybe is better to do -g instead? Because when I try to use apos it give me an error.

npm install -g @apostrophecms/cli
# Or `yarn install`, if you prefer. We'll stick to npm commands.

Addition to Conditional Section of A3 Docs

The problem to solve

Is your feature request related to a problem you are experiencing that is not a bug? Please describe.

While working on a feature implementation for a project, my coworker and I were blocked by an issue and were referring to the conditional docs detailed here: https://v3.docs.apostrophecms.org/guide/conditional-fields/

This documentation takes care of these scenarios:

  1. One conditional statement
  2. Two conditional statements for two different fields (both must pass)
  3. An $or operator condition for two different fields (either must pass)

However, there is no mention of whether it is possible to create an if conditional in case of two conditional statements when they are from the same field in the schema instead of different fields.

Hence I want to create a pull request to solve this issue and introduce another case in the example to improve the clarity of the docs for future users. Hence, I am also creating this issue.

Proposed solution

Describe the solution you'd like

Updating the code examples in the document to detail about the case my coworker and I were blocked by.

Additional context

My coworker and I tried these methods before finding the solution:

if: {
field1: value1,
field2: value1 $or field2: value2,
}

if: {
$or [
field1: value1,
field2: value1 || value2,
]
}

if: {
field1: value1,
field2: value1 || field2: value2,
}

if: {
field1: value1,
field2: value1 OR field2: value2,
}

if: {
field1: value1,
field2: value1 OR field2: value2,
}

if: {
field1: value1,
field2: value1
field2: value2,
}

[DOCS ISSUE] Page: Setting up

This is a detail.

Consider replacing:

Before starting up you'll need to create an admin-level user so that you can log in. After running the following command, Apostrophe will ask you to enter a password for this user.

with

If you used 'apos create', you already set an "admin" user and password. Otherwise, before starting up you'll need to create an admin-level user so that you can log in. After running the following command, Apostrophe will ask you to enter a password for this user.

[DOCS ISSUE] Page: Building site navigation

The custom URL field is incorrectly referenced in the views/layout.html example. For this to work:

{% elif item.type === 'custom' %}
   {% set path = item.url %}
{% endif %}

Needs to be changed to:

{% elif item.type === 'custom' %}
   {% set path = item.customUrl %}
{% endif %}

...might save someone scratching their heads ๐Ÿ‘‹

[DOCS ISSUE] Page: attachment - Custom File Groups

Hi,

In the docs it states:

Developers can configure file type groups in addition to office and image using the fileGroups option of the @apostrophecms/attachment module. Those custom groups names can then be used for an attachment field's fileGroup setting.

Can you give me a bit more information about how I would do this please? I would like to add an mp4 option.
I guess that I could download the github @apostrophecms/attachment/index.js and create a local version in a new folder in
modules/@apostrophecms/attachment and then add another fileGroup something like the following:

self.fileGroups = self.options.fileGroups || [
      ...
      {
        name: 'localVideo',
        label: 'apostrophe:localvideo',
        extensions: [
          'mp4'
        ]
      },

But I'm wondering if there's a simpler method that doesn't involve duplicating the whole index.js file?

Thanks

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.