Skip to content

Commit a99b062

Browse files
authored
Merge pull request #16 from mulesoft/ux_changes
Portal UX improvements: status dropdown, skill badges, icons, and alp…
2 parents f4ba7a2 + 40caa52 commit a99b062

14 files changed

Lines changed: 91 additions & 71 deletions

File tree

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading
-5.4 KB
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

scripts/portal_generator/assets/portal.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function openXOriginModal(opId, paramName, location) {
125125

126126
// Build source selector dropdown (no execute button here - it's in the panel)
127127
var html = '<div class="xorigin-selector-container">';
128-
html += '<select id="xorigin-source-selector" class="xorigin-source-select" onchange="switchXOriginSource()">';
128+
html += '<select id="xorigin-source-selector" class="" onchange="switchXOriginSource()">';
129129

130130
origins.forEach(function(origin, idx) {
131131
var apiSlug = (origin.api || '').replace('urn:api:', '');
@@ -3970,10 +3970,7 @@ function renderOperationForm(opId, opMeta, options) {
39703970
html += '<button type="button" class="btn-xorigin-search" ';
39713971
html += 'onclick="openXOriginModal(\'' + opId + '\', \'' + paramName + '\', \'' + section.location + '\'); return false;" ';
39723972
html += 'title="Fetch values from ' + origins.length + ' source(s)" aria-label="Search values">';
3973-
html += '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">';
3974-
html += '<path d="M7 12C9.76142 12 12 9.76142 12 7C12 4.23858 9.76142 2 7 2C4.23858 2 2 4.23858 2 7C2 9.76142 4.23858 12 7 12Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>';
3975-
html += '<path d="M14 14L10.65 10.65" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>';
3976-
html += '</svg>';
3973+
html += '<img src="assets/icons/search.svg" width="16" height="16" alt="Search">';
39773974
html += '</button>';
39783975
// Show resolved value in grey italic AFTER the button
39793976
if (hasVarRef && substitutedValue !== yamlValue) {
@@ -5694,10 +5691,7 @@ function renderWorkflowStepForms(skillSlug) {
56945691
html += '<button type="button" class="btn-xorigin-search" ';
56955692
html += 'onclick="openXOriginModal(\'' + sid + '\', \'' + escapeHtml(paramName) + '\', \'' + section.location + '\'); return false;" ';
56965693
html += 'title="Fetch values from ' + origins.length + ' source(s)" aria-label="Search values">';
5697-
html += '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">';
5698-
html += '<path d="M7 12C9.76142 12 12 9.76142 12 7C12 4.23858 9.76142 2 7 2C4.23858 2 2 4.23858 2 7C2 9.76142 4.23858 12 7 12Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>';
5699-
html += '<path d="M14 14L10.65 10.65" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>';
5700-
html += '</svg>';
5694+
html += '<img src="assets/icons/search.svg" width="16" height="16" alt="Search">';
57015695
html += '</button>';
57025696
html += '</div>';
57035697
} else if (schema.enum) {
@@ -7106,10 +7100,8 @@ function addManualVariable(slug) {
71067100
'<td><input type="text" class="manual-var-value" placeholder="value" /></td>' +
71077101
'<td><span class="var-source">User Input</span></td>' +
71087102
'<td><button class="btn-delete-variable" onclick="deleteVariable(this, \'' + slug + '\')" title="Delete variable">' +
7109-
'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: top;">' +
7110-
'<line x1="18" y1="6" x2="6" y2="18"></line>' +
7111-
'<line x1="6" y1="6" x2="18" y2="18"></line>' +
7112-
'</svg></button></td>';
7103+
'<img src="assets/icons/x-mark.svg" width="14" height="14" alt="Delete" style="vertical-align: top;">' +
7104+
'</button></td>';
71137105

71147106
tbody.appendChild(row);
71157107

scripts/portal_generator/assets/styles.css

Lines changed: 26 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -481,16 +481,17 @@ code {
481481
.logo-link {
482482
display: inline-block;
483483
transition: opacity 0.2s;
484+
height: 48px;
484485
}
485486

486487
.logo-link:hover {
487488
opacity: 0.8;
488489
}
489490

490491
.mulesoft-dev-logo {
491-
height: 48px;
492492
width: auto;
493493
vertical-align: middle;
494+
padding: 2px 0px;
494495
}
495496

496497
/* ============================================================================
@@ -781,12 +782,12 @@ code {
781782

782783
.tag-chip {
783784
display: inline-flex;
785+
border: 1px solid var(--color-neutral-5);
784786
align-items: center;
785787
gap: var(--space-xx-small);
786788
padding: var(--space-xxx-small) var(--space-x-small);
787-
background: var(--color-primary);
788-
color: var(--color-neutral-1);
789-
border-radius: var(--radius-small);
789+
color: var(--color-neutral-5);
790+
border-radius: var(--radius-xl);
790791
font-size: var(--font-size-3);
791792
font-weight: var(--font-weight-regular);
792793
transition: background 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
@@ -795,9 +796,7 @@ code {
795796
line-height: 1;
796797
}
797798

798-
.tag-chip:hover {
799-
background: var(--color-primary-dark);
800-
}
799+
801800

802801
.tag-chip-remove {
803802
display: flex;
@@ -808,7 +807,6 @@ code {
808807
background: var(--overlay-light);
809808
border-radius: 50%;
810809
border: none;
811-
color: var(--color-white);
812810
cursor: pointer;
813811
font-size: var(--font-size-4);
814812
line-height: 1;
@@ -1047,6 +1045,7 @@ code {
10471045
.unified-catalog {
10481046
max-width: 1400px;
10491047
margin: 0 auto;
1048+
padding-right: 80px;
10501049
padding: 0 var(--space-lg);
10511050
box-sizing: border-box;
10521051
}
@@ -1299,7 +1298,16 @@ code {
12991298
border: 1px solid var(--color-indigo);
13001299
}
13011300

1302-
.badge-skills,
1301+
.badge-skills {
1302+
font-size: var(--font-size-2);
1303+
font-weight: var(--font-weight-regular);
1304+
color: #2080c0;
1305+
padding: 4px 15px;
1306+
border-radius: 21px;
1307+
border: 1px solid #e0e7ff;
1308+
background: #DBF1FF;
1309+
}
1310+
13031311
.badge-count {
13041312
font-size: var(--font-size-2);
13051313
font-weight: var(--font-weight-regular);
@@ -1815,7 +1823,7 @@ code {
18151823
top: 0;
18161824
z-index: 100;
18171825
background: var(--color-bg-surface);
1818-
margin: 32px 0px 0px 0px;
1826+
margin: 25px 0px 0px 0px;
18191827
border-bottom: 1px solid var(--color-neutral-4);
18201828
}
18211829

@@ -1828,6 +1836,7 @@ code {
18281836
display: flex;
18291837
align-items: center;
18301838
gap: var(--space-small);
1839+
padding-top: 0;
18311840
}
18321841

18331842
.sidebar-search {
@@ -1987,7 +1996,8 @@ code {
19871996
font-size: var(--font-size-3);
19881997
font-weight: var(--font-weight-semibold);
19891998
color: var(--color-gray-600);
1990-
margin: 10px 0px 10px 0px;
1999+
margin: 10px;
2000+
border-radius: var(--radius-xl);
19912001
}
19922002

19932003
.nav-link[href="#overview"] svg {
@@ -2247,6 +2257,7 @@ button.nav-group-header {
22472257
border-radius: 30px;
22482258
border-bottom: none;
22492259
overflow: visible;
2260+
height: 100%;
22502261
}
22512262

22522263
.content-section:last-child {
@@ -5220,7 +5231,7 @@ details[open] .examples-toggle-icon {
52205231
font-family: var(--font-mono);
52215232
}
52225233

5223-
.btn-env-remove:hover {
5234+
.btn-env-remove:hover {
52245235
border-color: rgba(239, 68, 68, 0.3);
52255236
background: rgba(239, 68, 68, 0.05);
52265237
}
@@ -5281,7 +5292,7 @@ details[open] .examples-toggle-icon {
52815292
content: '';
52825293
width: 16px;
52835294
height: 16px;
5284-
background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 4L10 8L6 12" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
5295+
background-image: url('../assets/icons/chevron-right.svg');
52855296
background-size: contain;
52865297
background-repeat: no-repeat;
52875298
transition: transform 0.2s;
@@ -5644,39 +5655,6 @@ details[open] .examples-toggle-icon {
56445655
border: 1px solid var(--color-border-primary);
56455656
}
56465657

5647-
.xorigin-source-select {
5648-
flex: 1;
5649-
padding: var(--space-x-small) var(--space-small);
5650-
border: 1px solid var(--color-neutral-5);
5651-
border-radius: var(--radius-small);
5652-
background: var(--color-neutral-1);
5653-
color: var(--color-neutral-10);
5654-
font-size: var(--font-size-3);
5655-
font-family: var(--font-sans);
5656-
cursor: pointer;
5657-
transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
5658-
appearance: none;
5659-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23666' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
5660-
background-repeat: no-repeat;
5661-
background-position: right var(--space-small) center;
5662-
padding-right: calc(var(--space-small) * 3);
5663-
}
5664-
5665-
.xorigin-source-select:hover {
5666-
border-color: var(--hover-border);
5667-
background-color: var(--hover-bg);
5668-
}
5669-
5670-
.xorigin-source-select:focus {
5671-
outline: none;
5672-
border-color: var(--color-primary);
5673-
box-shadow: 0 0 0 3px var(--shadow-blue);
5674-
}
5675-
5676-
.xorigin-source-select option {
5677-
font-style: italic;
5678-
}
5679-
56805658
.btn-execute-xorigin {
56815659
padding: var(--space-x-small) var(--space-large);
56825660
background: var(--color-primary);
@@ -5951,7 +5929,7 @@ details[open] .examples-toggle-icon {
59515929
content: '';
59525930
width: 16px;
59535931
height: 16px;
5954-
background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 4L10 8L6 12" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
5932+
background-image: url('../assets/icons/chevron-right.svg');
59555933
background-size: contain;
59565934
background-repeat: no-repeat;
59575935
transition: transform 0.2s;
@@ -6405,7 +6383,7 @@ details[open] .examples-toggle-icon {
64056383
display: block;
64066384
width: 16px;
64076385
height: 16px;
6408-
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="%2300A2DF"><circle cx="8" cy="8" r="7" fill="none" stroke="%2300A2DF" stroke-width="1.5"/><path d="M8 7v4M8 5v.5" stroke="%2300A2DF" stroke-width="1.5" stroke-linecap="round"/></svg>');
6386+
background-image: url('../assets/icons/info-icon.svg');
64096387
background-size: contain;
64106388
background-repeat: no-repeat;
64116389
background-position: center;

scripts/portal_generator/generator.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,33 @@ def _generate_homepage(self):
189189
"""Generate index.html"""
190190
print(" ✓ Generating homepage...")
191191
template = self.env.get_template('homepage.html')
192+
193+
# Create unified list of APIs and skills, sorted alphabetically by name
194+
all_items = []
195+
196+
# Add APIs with type marker
197+
for api in self.public_apis:
198+
api_copy = api.copy()
199+
api_copy['_item_type'] = 'api'
200+
all_items.append(api_copy)
201+
202+
# Add skills with type marker
203+
if self.all_skills:
204+
for skill in self.all_skills:
205+
skill_copy = skill.copy()
206+
skill_copy['_item_type'] = 'skill'
207+
all_items.append(skill_copy)
208+
209+
# Sort all items alphabetically by name
210+
all_items.sort(key=lambda x: x.get('name', '').lower())
211+
192212
html = template.render(
193213
css_path='assets/styles.css',
194214
icons_path='assets/icons',
195215
apis=self.public_apis,
196216
stats=self.stats,
197217
all_skills=self.all_skills,
218+
all_items=all_items,
198219
proxy_url=self.proxy_url,
199220
chrome=self.chrome,
200221
build_label=self.build_label,

0 commit comments

Comments
 (0)