Skip to content

Commit

Permalink
Merge pull request #5642 from kiva/MP-980-fe-change-contentful-level-…
Browse files Browse the repository at this point in the history
…to-a-string-and-update-code-accordingly

feat: change contentful level to a string and update code accordingly
  • Loading branch information
dyersituations authored Nov 4, 2024
2 parents 4163475 + 26e9062 commit 45e2207
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 150 deletions.
84 changes: 42 additions & 42 deletions .storybook/mock-data/badge-journey-data-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,49 @@ export const badgeWomensEquality = {
{
"id": "womens-equality",
"level": 1,
"levelName": "Women's equality",
"levelName": "1",
"challengeName": "Women's equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/3dAEh0zYSkqK5Up5q8Flv8/70d21f8db5f93b20be1581ef333dc60e/Women_10.svg"
},
{
"id": "womens-equality",
"level": 2,
"levelName": "Women's equality",
"levelName": "2",
"challengeName": "Women's equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/6PcVN0gI5MIwytZm5AFQ32/08e39f77b0ecbeb4dd67f7e4625e3e07/Women_20.svg"
},
{
"id": "womens-equality",
"level": 3,
"levelName": "Women's equality",
"levelName": "3",
"challengeName": "Women's equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/25FLM7Cyv1kik5nFkdIT2O/654e6fa5affd8d05b17b57291e8a5a73/Women_30.svg"
},
{
"id": "womens-equality",
"level": 4,
"levelName": "Women's equality",
"levelName": "4",
"challengeName": "Women's equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/15RLZ1WiHmGQgtlkkMZTH0/b45086ce91aadae2b74c4adeae294f0d/Women_40.svg"
},
{
"id": "womens-equality",
"level": 5,
"levelName": "Women's equality",
"levelName": "5",
"challengeName": "Women's equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/6mqr1eJTJHksfTlRmpI7bB/ef75875bffc8c437b2d21725cd87ffae/Women_50.svg"
},
{
"id": "womens-equality",
"level": 6,
"levelName": "Women's equality ✨50✨",
"levelName": "✨50✨",
"challengeName": "Women's equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/5SpskyxoH08WfjVuzXjq6T/95fdd254220d2dccae8a40552f602846/Women_75.svg"
},
{
"id": "womens-equality",
"level": 7,
"levelName": "Women's equality ✨100✨",
"levelName": "✨100✨",
"challengeName": "Women's equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/2rJH0UWfITf7KPuySP8x9/3de2dff5953335b9bcebc5e875a8ccfa/Women_70.svg"
}
Expand Down Expand Up @@ -118,49 +118,49 @@ export const badgeUsEconomicEquality = {
{
"id": "us-economic-equality",
"level": 1,
"levelName": "U.S. economic equality",
"levelName": "1",
"challengeName": "U.S. economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/3C3ddaga4hEXBlb9WxsdlQ/0155bb0e9a32be6b00071afa4769b10c/US_Business_10.svg"
},
{
"id": "us-economic-equality",
"level": 2,
"levelName": "U.S. Economic equality",
"levelName": "2",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/62zEUpZbO7qWZPoV1z2pZU/9664408940c996a953658c0d7508ecca/US_Business_20.svg"
},
{
"id": "us-economic-equality",
"level": 3,
"levelName": "U.S. Economic equality",
"levelName": "3",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/4q0Das9uTU0gfrwtld137n/6cb471c2c85e39c7cc98d9795ea1e066/US_Business_30.svg"
},
{
"id": "us-economic-equality",
"level": 4,
"levelName": "U.S. Economic equality",
"levelName": "4",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/4f5MR6ggWdXx3AC7oxx596/96c431c599c42c56483f7d18f43fe0aa/US_Business_40.svg"
},
{
"id": "us-economic-equality",
"level": 5,
"levelName": "U.S. Economic equality",
"levelName": "5",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/2s7t7DyW1EBoF4S7HhO4eZ/9d9c46c77f5dac5f4e979c23d213a875/US_Business_50.svg"
},
{
"id": "us-economic-equality",
"level": 6,
"levelName": "U.S. Economic equality ✨50✨",
"levelName": "✨50✨",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/4nUE568E3WCZ1rYpbH3G1z/e2b568f72e76ef888b97e28fb2cd21b3/US_Business_60.svg"
},
{
"id": "us-economic-equality",
"level": 7,
"levelName": "U.S. Economic equality ✨100✨",
"levelName": "✨100✨",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/6p6BcDBlAb7ZoCaZaypJIT/959a8c1e856fc5f9bf3227f6b92edbd4/US_Business_70.svg"
}
Expand Down Expand Up @@ -232,49 +232,49 @@ export const badgeClimateAction = {
{
"id": "climate-action",
"level": 1,
"levelName": "Climate action",
"levelName": "1",
"challengeName": "Climate action",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/3YklKNLbiA4kAcOgk5ouaw/14b41006455dfd756f141e0217bb8e9c/Climate_10.svg"
},
{
"id": "climate-action",
"level": 2,
"levelName": "Climate action",
"levelName": "2",
"challengeName": "Climate action",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/7crCD9q1xCii5mcLAj3SKa/86d912839e1785e4ebc4d00a633d2595/Climate_20.svg"
},
{
"id": "climate-action",
"level": 3,
"levelName": "Climate action",
"levelName": "3",
"challengeName": "Climate action",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/6dKOH8W4ZCWxTO7OXPfAWo/e809280605febcc79f4178b582b48ecc/Climate_30.svg"
},
{
"id": "climate-action",
"level": 4,
"levelName": "Climate action",
"levelName": "4",
"challengeName": "Climate action",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/4FAMdCiqyrNBzGH7IzYJ6G/dfc9dc1f2025387315d1667c429fecb2/Climate_40.svg"
},
{
"id": "climate-action",
"level": 5,
"levelName": "Climate action",
"levelName": "5",
"challengeName": "Climate action",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/7LVRDYs9PmApE3LhZ4D4Ek/18738b77ee8cd2ca090792b203a30b41/Climate_50.svg"
},
{
"id": "climate-action",
"level": 6,
"levelName": "Climate action ✨50✨",
"levelName": "✨50✨",
"challengeName": "Climate action",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/3vmiyohO4jjDEwnzO4QMZh/f724ce214554fd10b7bd5980cf34d0a0/Climate_60.svg"
},
{
"id": "climate-action",
"level": 7,
"levelName": "Climate action ✨100✨",
"levelName": "✨100✨",
"challengeName": "Climate action",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/JdDGpZIjI7FXBouv3bJa4/14ccc8f267f9232c784243c1c25e87c4/Climate_70.svg"
}
Expand Down Expand Up @@ -345,49 +345,49 @@ export const badgeRefugeeEquality = {
{
"id": "refugee-equality",
"level": 1,
"levelName": "Refugee equality",
"levelName": "1",
"challengeName": "Refugee equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/1SEhQMUbYUqZopjP2o67XK/c9b1f51837d87905d2a71578c0d6c434/Refugees_10.svg"
},
{
"id": "refugee-equality",
"level": 2,
"levelName": "Refugee equality",
"levelName": "2",
"challengeName": "Refugee equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/4EfRGWaySxx9eCxkwJJ71S/524e2d4220f0c593171f5019b5684cc1/Refugees_20.svg"
},
{
"id": "refugee-equality",
"level": 3,
"levelName": "Refugee equality",
"levelName": "3",
"challengeName": "Refugee equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/5TO71LArbZCXuey6JJnrm8/8f0f4bdc54a00a7a9420b26c20f59feb/Refugees_30.svg"
},
{
"id": "refugee-equality",
"level": 4,
"levelName": "Refugee equality",
"levelName": "4",
"challengeName": "Refugee equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/2rCdTrkgqrajqscTGgt6YZ/1266c781e4b92e999a3a2fe7cf7925ff/Refugees_40.svg"
},
{
"id": "refugee-equality",
"level": 5,
"levelName": "Refugee equality",
"levelName": "5",
"challengeName": "Refugee equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/6oSmu0Kc94YpMllGEsw2o4/1d7dc0a0ace39dc673e0f969cf2ea155/Refugees_50.svg"
},
{
"id": "refugee-equality",
"level": 6,
"levelName": "Refugee equality ✨50✨",
"levelName": "✨50✨",
"challengeName": "Refugee equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/4sN0hJtCkirthBDrSOh2YA/d2e9935c50443577ccc5344cd548d78c/Refugees_60.svg"
},
{
"id": "refugee-equality",
"level": 7,
"levelName": "Refugee equality ✨100✨",
"levelName": "✨100✨",
"challengeName": "Refugee equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/1vGn9ZCa3OFC7Tiqv14G7K/d26af7d84652d82625a7df5414115fc6/Refugees_70.svg"
}
Expand Down Expand Up @@ -458,49 +458,49 @@ export const badgeBasicNeeds = {
{
"id": "basic-needs",
"level": 1,
"levelName": "Basic needs",
"levelName": "1",
"challengeName": "Basic needs",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/694uSymh8om0MxbiCjWZxl/b55c8cb3f3743efdd56b56beea8dfb42/Basic_Needs_10.svg"
},
{
"id": "basic-needs",
"level": 2,
"levelName": "Basic needs",
"levelName": "2",
"challengeName": "Basic needs",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/SHdA5oclQUy5T5YQhfTd2/e508b6444f2d2da060962b4f286e3f43/Basic_Needs_20.svg"
},
{
"id": "basic-needs",
"level": 3,
"levelName": "Basic needs",
"levelName": "3",
"challengeName": "Basic needs",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/1dZrR0nnWsEB9AGjW2qOL6/b347be0178ead388ef75a23761c854a2/Basic_Needs_30.svg"
},
{
"id": "basic-needs",
"level": 4,
"levelName": "Basic needs",
"levelName": "4",
"challengeName": "Basic needs",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/2AptyhDdjcbumiax0upWWZ/9c94a554f7126c41ad8f584d73b9e35b/Basic_Needs_40.svg"
},
{
"id": "basic-needs",
"level": 5,
"levelName": "Basic needs",
"levelName": "5",
"challengeName": "Basic needs",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/6m9RP1jcZxZMz5EqWyl8a8/95c9827a6d097703b1c048391634178a/Basic_Needs_50.svg"
},
{
"id": "basic-needs",
"level": 6,
"levelName": "Basic needs ✨50✨",
"levelName": "✨50✨",
"challengeName": "Basic needs",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/ESTL9bCh4khif4gxZO8ft/14e72f360d5adb4e4be6f94ef6b1dbae/Basic_Needs_60.svg"
},
{
"id": "basic-needs",
"level": 7,
"levelName": "Basic needs ✨100✨",
"levelName": "✨100✨",
"challengeName": "Basic needs",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/1LLL9K4PgaUZb3H0JLWEPU/4ed0ec9c5515fa25410b9e32d6a8e7cf/Basic_Needs_70.svg"
}
Expand Down Expand Up @@ -571,49 +571,49 @@ export const badgeFirstTierComplete = {
{
"id": "us-economic-equality",
"level": 1,
"levelName": "U.S. economic equality",
"levelName": "1",
"challengeName": "U.S. economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/3C3ddaga4hEXBlb9WxsdlQ/0155bb0e9a32be6b00071afa4769b10c/US_Business_10.svg"
},
{
"id": "us-economic-equality",
"level": 2,
"levelName": "U.S. Economic equality",
"levelName": "2",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/62zEUpZbO7qWZPoV1z2pZU/9664408940c996a953658c0d7508ecca/US_Business_20.svg"
},
{
"id": "us-economic-equality",
"level": 3,
"levelName": "U.S. Economic equality",
"levelName": "3",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/4q0Das9uTU0gfrwtld137n/6cb471c2c85e39c7cc98d9795ea1e066/US_Business_30.svg"
},
{
"id": "us-economic-equality",
"level": 4,
"levelName": "U.S. Economic equality",
"levelName": "4",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/4f5MR6ggWdXx3AC7oxx596/96c431c599c42c56483f7d18f43fe0aa/US_Business_40.svg"
},
{
"id": "us-economic-equality",
"level": 5,
"levelName": "U.S. Economic equality",
"levelName": "5",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/2s7t7DyW1EBoF4S7HhO4eZ/9d9c46c77f5dac5f4e979c23d213a875/US_Business_50.svg"
},
{
"id": "us-economic-equality",
"level": 6,
"levelName": "U.S. Economic equality ✨50✨",
"levelName": "✨50✨",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/4nUE568E3WCZ1rYpbH3G1z/e2b568f72e76ef888b97e28fb2cd21b3/US_Business_60.svg"
},
{
"id": "us-economic-equality",
"level": 7,
"levelName": "U.S. Economic equality ✨100✨",
"levelName": "✨100✨",
"challengeName": "U.S. Economic equality",
"imageUrl": "//images.ctfassets.net/j0p9a6ql0rn7/6p6BcDBlAb7ZoCaZaypJIT/959a8c1e856fc5f9bf3227f6b92edbd4/US_Business_70.svg"
}
Expand Down
10 changes: 4 additions & 6 deletions src/components/MyKiva/BadgeCompleted.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="container">
<div class="badge-container tw-flex-col tw-mb-4">
<h2 class="tw-text-center tw-mb-2">
{{ badgeCategory }}
{{ badgeData.tierName }}
</h2>
<div class="tw-relative tw-z-1 tw-mb-3" :style="{ minWidth: '16rem'}">
<div
Expand All @@ -14,7 +14,7 @@
<img
:src="badgeImage"
class="badge tw-z-2"
:alt="badgeCategory"
:alt="badgeData.tierName"
>
</div>
<h2 class="tw-italic tw-font-medium tw-text-desert-rose-4 tw-mb-2 tw-text-center">
Expand Down Expand Up @@ -117,8 +117,6 @@ const badgeImage = computed(() => {
return badgeData.value.contentfulData?.imageUrl ?? '';
});
const badgeCategory = computed(() => badgeData.value?.challengeName ?? '');
const badgeLevel = computed(() => {
return badgeData.value?.achievementData?.target ?? 0;
});
Expand Down Expand Up @@ -157,7 +155,7 @@ const trackLearnMore = () => {
'portfolio',
'click',
label,
badgeCategory.value,
badgeData.value.challengeName,
badgeLevel.value
);
};
Expand All @@ -171,7 +169,7 @@ const trackSharing = () => {
'portfolio',
'click',
label,
badgeCategory.value,
badgeData.value.challengeName,
badgeLevel.value
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/MyKiva/BadgeInProgress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
</BadgeContainer>
<div>
<h3>{{ badge.challengeName }}</h3>
<h3>{{ tierBadgeData.tierName }}</h3>
<p>{{ subHeader }}</p>
</div>
</div>
Expand Down
Loading

0 comments on commit 45e2207

Please sign in to comment.