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

asana.CreateProject (patch update) Color Palette not showing colors #208

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

sayam-nasir
Copy link
Contributor

Problem 1
The initial issue was that the color palette in the Asana Create Project component displayed Asana’s color names (e.g., "dark-pink") but these names were not valid CSS color values. This caused the color picker in the UI to not display colors correctly, as it could not interpret non-standard CSS values like "dark-pink".

Problem 2
some components have wrong description that can cause confusion between action and trigger

Fix:
Updated the color palette to use valid hex codes for the color options instead of Asana’s internal color names. The color names were still required by the Asana API, so I introduced a mapping between hex values and Asana color names. The UI now displays hex values, and when submitting the project, the hex value is mapped back to the corresponding Asana color name before being sent to the API. This ensures both proper color display in the UI and compatibility with Asana’s API.

Updated the verbs of the descriptions of action components

@sayam-nasir sayam-nasir changed the title Asana.CreateProject (bug fix) Color Palete not showing colors Asana.CreateProject (bug fix) Color Palette not showing colors Oct 4, 2024
@sayam-nasir sayam-nasir self-assigned this Oct 4, 2024
color: {
label: 'Color',
type: 'color-palette',
options: Object.entries(asanaColorMap).map(([asanaColorName, hexValue]) => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

the inspector is generated dynamically due to this color palette inputs, is that right?
is it really needed? it's only converting hard-coded asanaColorMap to another format (key: value -> value:key) why it's not in the {value: hex, content: "name"} directly in the component.json?

it could be reasonable if the asanaColorMap is somehow configurable.

BTW you don't need to make the whole inspector dynamic because of one input, you can generate inspector field separately, like it's here:

"data": { "properties": { "generateInspector": true } }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vtalas youre right,
I will just take the input from the user, keep inspector in component.json. Create a mapper in CreateProject.js that will map user's input to asana specific color names and send to the API that will be cleaner simpler solution

@DavidDurman DavidDurman changed the title Asana.CreateProject (bug fix) Color Palette not showing colors asana.CreateProject (patch update) Color Palette not showing colors Oct 4, 2024
@sayam-nasir sayam-nasir requested review from vtalas and removed request for jirihofman October 4, 2024 18:20
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