Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add <span> tag to (optional) suffix for customization #7103

Merged
merged 9 commits into from Mar 29, 2024

Conversation

leomp12
Copy link
Contributor

@leomp12 leomp12 commented Feb 14, 2024

With the (or any) tag we can add CSS like:

body {
  [class*=FieldLabel-fieldLabel] span {
    display: none;
  }
}

to hide or customize the (optional) suffix.

It'll specially useful when majority of the fields are optional, we can also use CSS :has to select required fields and add a * for example.

Summary

Test plan

Checklist

Please add a x inside each checkbox:

A picture of a cute animal (not mandatory but encouraged)

With the <span> (or any) tag we can add CSS like:

```css
body {
  [class*=FieldLabel-fieldLabel] span {
    display: none;
  }
}
```

to hide or customize the _(optional)_ suffix.

It'll specially useful when majority of the fields are optional, we can also use CSS :has to select required fields and add a _*_ for example.
@leomp12 leomp12 requested a review from a team as a code owner February 14, 2024 18:50
Copy link
Member

@martinjagodic martinjagodic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leomp12 this is a good idea. before we can merge this, please fix the lint error.

@leomp12
Copy link
Contributor Author

leomp12 commented Mar 5, 2024

hey @martinjagodic ,
I don't know why the linter is failing tbh 😐
JSX seems to be valid and there's no useful output on execution here https://github.com/decaporg/decap-cms/actions/runs/8160169924/job/22306202350?pr=7103

@demshy
Copy link
Member

demshy commented Mar 8, 2024

Hi @leomp12 lint checker is blaming the packages/decap-cms-core/src/components/Editor/EditorControlPane/EditorControl.js file
can you please run npm run format and see what changes it does?

@leomp12
Copy link
Contributor Author

leomp12 commented Mar 8, 2024

done @demshy 👍🏾

Copy link
Member

@martinjagodic martinjagodic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leomp12 an e2e test is failing: Markdown widget code block. I think there's an extra space after Code Block in the expected code.

@demshy
Copy link
Member

demshy commented Mar 15, 2024

@leomp12 to find the cause for the test fail easier you can run cypress in dev mode locally with npm run test:e2e:dev and run only the test in question (I think markdown_widget_code_block_spec.js) until it passes

@martinjagodic martinjagodic merged commit dd31fcf into decaporg:main Mar 29, 2024
9 checks passed
@leomp12 leomp12 deleted the patch-1 branch March 29, 2024 17:35
yuri-g-taboola pushed a commit to taboola/decap-cms that referenced this pull request May 22, 2024
* Add <span> tag to (optional) suffix for customization

With the <span> (or any) tag we can add CSS like:

```css
body {
  [class*=FieldLabel-fieldLabel] span {
    display: none;
  }
}
```

to hide or customize the _(optional)_ suffix.

It'll specially useful when majority of the fields are optional, we can also use CSS :has to select required fields and add a _*_ for example.

* Update EditorControl.js

* chore: format

* chore: preventing empty space on field label

* Update EditorControl.js

* test: remove extra space from expected result in e2e test

---------

Co-authored-by: Anze Demsar <anze.demsar@p-m.si>
Co-authored-by: Martin Jagodic <jagodicmartin1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants