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

Change Links to Link(s) to match the rest of the messages #360

Conversation

n8-dev
Copy link
Contributor

@n8-dev n8-dev commented Jan 6, 2025

Description

Tweaked messaging to handle the situation when context is both Plural and Singular.
Much like how it already is here.

    "LinkField.FAILED_TO_LOAD_LINKS": "Failed to load link(s)",

i.e.

- "LinkField.SAVE_RECORD_FIRST": "Cannot add links until the record has been saved",
+ "LinkField.SAVE_RECORD_FIRST": "Cannot add link(s) until the record has been saved",

Manual testing steps

Update text should show when loading an item that has a relation to 1/many linkfields that isn't saved and you wish to add a link to it.

Issues

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
    • Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • Code changes follow our coding conventions
  • This change is covered with tests (or tests aren't necessary for this change)
  • Any relevant User Help/Developer documentation is updated; for impactful changes, information is added to the changelog for the intended release
  • CI is green

@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Working on updating the dist file

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

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

Please remove all of the changes to localised files for languages other than English - those are managed in transifex. Feel free to update the references in transifex if you like, they'll get pulled down whenever our next localisation run is (I think those are every 3 months if I'm remembering correctly)

@GuySartorelli
Copy link
Member

GuySartorelli commented Jan 6, 2025

Actually, looking at this - we should probably have two separate messages. The javascript component knows whether this is a multi-link field or a single link field, so we should always use the existing "links" message for a multi link field and use a new "link" message for single link fields.

@n8-dev n8-dev force-pushed the feature/359-Plural-and-Singular-CMS-Message-update branch 2 times, most recently from 52b1630 to 6492fa3 Compare January 6, 2025 00:47
@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Linkfield isn't in https://explore.transifex.com/silverstripe/ ?

@GuySartorelli
Copy link
Member

Weird. It's definitely in the app: https://app.transifex.com/silverstripe/silverstripe-linkfield/dashboard/
I'll have to look into how that explore page gets its info

@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Cool, can see that, is there anything specific to do with the new option added?

@GuySartorelli
Copy link
Member

Nah, that'll get collected and added to transifex when we do our next localisation round.

client/lang/en.js Outdated Show resolved Hide resolved
client/src/components/LinkField/LinkField.js Outdated Show resolved Hide resolved
@n8-dev n8-dev force-pushed the feature/359-Plural-and-Singular-CMS-Message-update branch from 074f503 to 9b8e40c Compare January 6, 2025 01:07
@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Think this is ready.

Unsure about a few things...

  • ENH vs TRN
  • I think this is the right target based on change level...
  • Is CI green?

@GuySartorelli
Copy link
Member

  • ENH is correct here since you're enhancing the functionality to include a second separate message, you're not only affecting the localisation strings and keys.
    • Usually the colon shouldn't be included, i.e. it should be ENH My commit message here. not ENH: My commit message here.. It doesn't matter much really, but since you need to make changes anyway (see below about reverted change) you may as well fix that at the same time.
  • Target branch is correct
  • CI doesn't look like it has run for some reason (you can see in the "checks" tab at the top, it's got 0 items) - GitHub does this sometimes. Another force push usually gets it to right itself.

You've reverted #360 (comment) and #360 (comment) in your commit squashing efforts, though.

@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Dang!

Onwards!

@n8-dev n8-dev force-pushed the feature/359-Plural-and-Singular-CMS-Message-update branch from 9b8e40c to 8566b8f Compare January 6, 2025 01:38
@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Hmm, workflow awaiting approval?

https://github.com/silverstripe/silverstripe-linkfield/actions/runs/12624941936

This because it's a fork PR and something isn't connected quite right?

@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Now its running idk 🤷

@GuySartorelli
Copy link
Member

Oh yeah, I forgot the new merge experience doesn't actually tell me when I need to approve CI runs, nor gives me the option to do so. Had to swap back to the old one. 😓

@n8-dev n8-dev requested a review from GuySartorelli January 6, 2025 01:56
@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Hmm, only 1 version is failing on the CI. Could it be a isolated thing?

@GuySartorelli
Copy link
Member

GuySartorelli commented Jan 6, 2025

Looks like CI doesn't like your dist build. Did you remember to rebuild it after updating #360 (comment) and #360 (comment)?

only 1 version is failing on the CI

There is only one version of the JS CI job

@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Will re-rebuild 🤷

only 1 version is failing on the CI

There is only one version of the JS CI job

I mean only mysql57 failed 🤔

@n8-dev n8-dev force-pushed the feature/359-Plural-and-Singular-CMS-Message-update branch from 8566b8f to 05a0082 Compare January 6, 2025 02:00
@GuySartorelli
Copy link
Member

GuySartorelli commented Jan 6, 2025

I mean only mysql57 failed

Right, but it's mysql57 js which is the only js one.
The mysql57 shouldn't really be there and is just a result of the way we create and name the job matrix for CI runs.

We don't use the database for JS tests/linting, so there's no need to create another JS run with a different database, unlike unit and end-to-end tests.

@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Woohoo that passed.

Can we merge and maybe a cheeky release @GuySartorelli ? 🎉

@GuySartorelli
Copy link
Member

GuySartorelli commented Jan 6, 2025

Once I have tested it and approved it, I will merge it.
Once it has been merged, GitHub Actions will automagically tag it. Sorry forgot what branch it's targetting.
It will be included as part of the April minor release.

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

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

LGTM, works well locally.
I don't understand why that client got confused, given "Cannot add links" includes the single link that field would support... but now there will be less cause for confusion.

@GuySartorelli GuySartorelli merged commit d5684f7 into silverstripe:4 Jan 6, 2025
15 checks passed
@n8-dev
Copy link
Contributor Author

n8-dev commented Jan 6, 2025

Maybe confused is not the right word.
They always want to improve CMS details for their CMS authors.

Single links were saying links so reported as Bug. 😄

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.

2 participants