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

LPS-115484 Token definitions API and implementation #91387

Conversation

liferay-continuous-integration
Copy link
Collaborator

Forwarded from: liferay-frontend#111 (Took 2 ci:forward attempts in 1 hour 19 minutes)

@izaera
@liferay-frontend

Original pull request comment:
This PR defines the initial token definitions API and implementation. We will iterate on this PR to refine the API and maybe provide more functionality.

Initially we sent #91176 to Brian, but he made some objections which led to a full rework of the PR.

The main reasons to rework the PR were:

  1. In the previous PR we assumed that every theme is deployed in a single OSGi bundle but this is something that, even if it is usually true, it is not mandatory given the Portal architecture.
  2. In the previous PR we didn't map from themeId to Bundle, thus it was incorrect.
  3. Brian asked to rename token-definition.json to theme-token-definition.json, something which is incorrect because we may define tokens for things that are not themes.

So, after reviewing the three points we came up with a model where token definitions are associated to OSGi Bundles alone, not related to themes yet (this PR).

In the future we may provide tools to map from themes to OSGi bundles. Even if the existence of a bundle that contains the theme is not enforced by the portal we can define it as a requisite if you want to use token definitions and nothing would break/become inconsistent.

Also, the current API just lists all available token definitions, but doesn't let you query by any criteria. We may add more methods to the TokenDefinitionRegistry service in the future to query token definitions as needed.


This PR doesn't modify anything in the UI nor does it execute any code (because nobody uses TokenDefinitionRegistry yet). However, I have provided units tests to cover almost all production code.

In addition, once we add the token-definition.json file in classic-theme, I will test it manually to make sure it runs in production too.

✔️ ci:test:stable - 20 out of 20 jobs passed

✔️ ci:test:relevant - 46 out of 46 jobs passed in 1 hour 17 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: e67026449a8a6dae28fc7a7da27e3ff6a3f780b6

Copied in Private Modules Branch:

Branch Name: master-private
Branch GIT ID: 2d61577aa6a76425e17132e68f5aa901f720a686

ci:test:stable - 20 out of 20 jobs PASSED
20 Successful Jobs:
ci:test:relevant - 46 out of 46 jobs PASSED
46 Successful Jobs:
For more details click here.

✔️ ci:test:sf - 1 out of 1 jobs passed in 3 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 76f17290c7dd17e02dbd73c3babb438de273a272

Sender Branch:

Branch Name: LPS-115484
Branch GIT ID: 22a8281702d74493785158383631f9a351e322b3

1 out of 1jobs PASSED
1 Successful Jobs:
For more details click here.

@liferay-continuous-integration
Copy link
Collaborator Author

To conserve resources, the PR Tester does not automatically run for forwarded pull requests.

],
"tokens": [
{
"cssVariable": "white",

Choose a reason for hiding this comment

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

@eduardoallegrini @izaera
The mappings to a cssVariable need to adapted to:

{
    "editorType": "ColorPicker",
    "label": "gray-100",
     "mappings": [
          {
               "type": "cssVariable",
               "value": "gray-100"   
        }
    ],
    "name": "gray100Color",
    "tokenCategoryName": "colors",
    "tokenSetName": "general",
    "type": "String"
}

as discussed here so the token-definition.json file conforms with the updated JSON schema

Choose a reason for hiding this comment

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

ok! 😁

Choose a reason for hiding this comment

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

@izaera
Copy link

izaera commented Jul 16, 2020

ci:close

@izaera
Copy link

izaera commented Jul 16, 2020

I will resend the PR with the chnages and a new service that is needed.

@liferay-continuous-integration liferay-continuous-integration deleted the ci-forward-LPS-115484-pr-111-sender-izaera-ts-1594828246293 branch July 23, 2020 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants