Skip to content
Snippets Groups Projects

Add locale peram in Drupal State.

5 unresolved threads

Closes #3243643

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
68 69 constructor({
69 70 apiBase,
70 71 apiPrefix = 'jsonapi',
72 locale = 'en',
  • 6 6 const store: any = new DrupalState({
    7 7 apiBase: 'https://live-contentacms.pantheonsite.io',
    8 8 apiPrefix: 'api',
    9 locale: '',
  • 21 21 const store: DrupalState = new DrupalState({
    22 22 apiBase: 'https://live-contentacms.pantheonsite.io',
    23 23 apiPrefix: 'api',
    24 locale: '',
  • 77 81 const store: DrupalState = new DrupalState({
    78 82 apiBase: 'http://demo-decoupled-bridge.lndo.site',
    79 83 apiPrefix: 'en/jsonapi',
    84 locale: '',
  • @abhisekmazumdar added a few comments - mostly pretty small changes. We also should have some test coverage for this as well. Maybe just

    • A locale is honored if specified - maybe set locale to es in this test?
    • Locale can be optional. And if not provided it won't be used as part of the URL structure.
  • There also looks to be a merge conflict that needs to be resolved here.

  • Abhisek Mazumdar added 3 commits

    added 3 commits

    Compare with previous version

  • added 1 commit

    • c722eafd - Restructure locale to defaultLocale.

    Compare with previous version

  • added 1 commit

    • d495ba06 - Restructure locale to defaultLocale.

    Compare with previous version

  • added 1 commit

    • d9c2e742 - Restructure locale to defaultLocale.

    Compare with previous version

  • Abhisek Mazumdar added 2 commits

    added 2 commits

    • c112e45f - Restructure locale to defaultLocale.
    • b008a7c8 - Jest for defaultLocale peram.

    Compare with previous version

  • 240 }
    241 );
    242 expect(
    243 await store.getObject({
    244 objectName: 'node--page',
    245 id: '04fe66ed-1161-47f4-8a3f-6450eb9a8fa9',
    246 query: `{
    247 title
    248 id
    249 }`,
    250 })
    251 ).toEqual(nodePageSpanishResourceQueryObject);
    252 expect(fetchMock).toBeCalledTimes(1);
    253 });
    254
    255 test("Locale not provided it won't be used as part of URL structure", async () => {
    • I think this test provides a false positive given what assembleEndpoint does. If I add defaultLocale: 'es', when creating the store, the test still passes. I think you might have meant assembleApiRoot() here. I'll make an update for this.

    • Please register or sign in to reply
  • Brian Perry approved this merge request

    approved this merge request

  • Brian Perry added 2 commits

    added 2 commits

    Compare with previous version

  • Brian Perry approved this merge request

    approved this merge request

  • merged

  • Please register or sign in to reply
    Loading