Skip to content

Commit 61f6e39

Browse files
authored
feat: update templates list to namespaced names (#227)
<img width="410" height="538" alt="Screenshot 2026-02-02 at 1 16 14 PM" src="https://github.com/user-attachments/assets/ae52f9c8-dd97-4c9d-b53e-931a0da26e40" /> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes API contracts and generated types (new endpoints, deprecated fields) and updates the template list rendering logic, which can break clients if backend responses don’t match the new `names`/tagging shapes. > > **Overview** > Updates the templates API and UI to support **namespaced template names** via a new `names` array, deprecating `aliases` for display and wiring default-template fetching to build names from `env_aliases.namespace` + `alias`. > > Extends the OpenAPI spec with **template tagging** endpoints (`POST/DELETE /templates/tags`), a `GET /templates/aliases/{alias}` lookup, and a new `PATCH /v2/templates/{templateID}` (while deprecating the existing `/templates/{templateID}` patch); also updates generated types and mock data accordingly, plus shows `team.slug` in settings. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6513daf. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 06edfd8 commit 61f6e39

File tree

9 files changed

+1102
-452
lines changed

9 files changed

+1102
-452
lines changed

spec/openapi.infra.yaml

Lines changed: 671 additions & 433 deletions
Large diffs are not rendered by default.

src/configs/mock-data.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { nanoid } from 'nanoid'
1515
const DEFAULT_TEMPLATES: DefaultTemplate[] = [
1616
{
1717
aliases: ['code-interpreter'],
18+
names: ['code-interpreter'],
1819
buildID: 'build_000',
1920
cpuCount: 1,
2021
memoryMB: 1024,
@@ -36,6 +37,7 @@ const DEFAULT_TEMPLATES: DefaultTemplate[] = [
3637
},
3738
{
3839
aliases: ['web-starter'],
40+
names: ['web-starter'],
3941
buildID: 'build_005',
4042
cpuCount: 2,
4143
memoryMB: 2048,
@@ -54,6 +56,7 @@ const DEFAULT_TEMPLATES: DefaultTemplate[] = [
5456
},
5557
{
5658
aliases: ['data-science'],
59+
names: ['data-science'],
5760
buildID: 'build_006',
5861
cpuCount: 4,
5962
memoryMB: 8192,
@@ -78,6 +81,7 @@ const DEFAULT_TEMPLATES: DefaultTemplate[] = [
7881
const TEMPLATES: Template[] = [
7982
{
8083
aliases: ['node-typescript', 'node-ts'],
84+
names: ['node-typescript', 'node-ts'],
8185
buildID: 'build_001',
8286
cpuCount: 2,
8387
memoryMB: 2048,
@@ -97,6 +101,7 @@ const TEMPLATES: Template[] = [
97101
},
98102
{
99103
aliases: ['react-vite'],
104+
names: ['react-vite'],
100105
buildID: 'build_002',
101106
cpuCount: 1,
102107
memoryMB: 1024,
@@ -113,6 +118,7 @@ const TEMPLATES: Template[] = [
113118
},
114119
{
115120
aliases: ['postgres', 'pg'],
121+
names: ['postgres', 'pg'],
116122
buildID: 'build_003',
117123
cpuCount: 2,
118124
memoryMB: 4096,
@@ -129,6 +135,7 @@ const TEMPLATES: Template[] = [
129135
},
130136
{
131137
aliases: ['redis'],
138+
names: ['redis'],
132139
buildID: 'build_004',
133140
cpuCount: 1,
134141
memoryMB: 2048,
@@ -145,6 +152,7 @@ const TEMPLATES: Template[] = [
145152
},
146153
{
147154
aliases: ['python-ml', 'ml'],
155+
names: ['python-ml', 'ml'],
148156
buildID: 'build_005',
149157
cpuCount: 4,
150158
memoryMB: 8192,
@@ -161,6 +169,7 @@ const TEMPLATES: Template[] = [
161169
},
162170
{
163171
aliases: ['elastic', 'es'],
172+
names: ['elastic', 'es'],
164173
buildID: 'build_006',
165174
cpuCount: 2,
166175
memoryMB: 4096,
@@ -177,6 +186,7 @@ const TEMPLATES: Template[] = [
177186
},
178187
{
179188
aliases: ['grafana'],
189+
names: ['grafana'],
180190
buildID: 'build_007',
181191
cpuCount: 1,
182192
memoryMB: 2048,
@@ -193,6 +203,7 @@ const TEMPLATES: Template[] = [
193203
},
194204
{
195205
aliases: ['nginx'],
206+
names: ['nginx'],
196207
buildID: 'build_008',
197208
cpuCount: 1,
198209
memoryMB: 1024,
@@ -209,6 +220,7 @@ const TEMPLATES: Template[] = [
209220
},
210221
{
211222
aliases: ['mongodb', 'mongo'],
223+
names: ['mongodb', 'mongo'],
212224
buildID: 'build_009',
213225
cpuCount: 2,
214226
memoryMB: 4096,
@@ -225,6 +237,7 @@ const TEMPLATES: Template[] = [
225237
},
226238
{
227239
aliases: ['mysql'],
240+
names: ['mysql'],
228241
buildID: 'build_010',
229242
envdVersion: '0.1.0',
230243
cpuCount: 2,
@@ -241,6 +254,7 @@ const TEMPLATES: Template[] = [
241254
},
242255
{
243256
aliases: ['nextjs', 'next'],
257+
names: ['nextjs', 'next'],
244258
buildID: 'build_011',
245259
envdVersion: '0.1.0',
246260
cpuCount: 2,
@@ -260,6 +274,7 @@ const TEMPLATES: Template[] = [
260274
},
261275
{
262276
aliases: ['vue', 'vue3'],
277+
names: ['vue', 'vue3'],
263278
buildID: 'build_012',
264279
cpuCount: 1,
265280
envdVersion: '0.1.0',
@@ -276,6 +291,7 @@ const TEMPLATES: Template[] = [
276291
},
277292
{
278293
aliases: ['django'],
294+
names: ['django'],
279295
buildID: 'build_013',
280296
envdVersion: '0.1.0',
281297
cpuCount: 2,
@@ -295,6 +311,7 @@ const TEMPLATES: Template[] = [
295311
},
296312
{
297313
aliases: ['flask'],
314+
names: ['flask'],
298315
buildID: 'build_014',
299316
envdVersion: '0.1.0',
300317
cpuCount: 1,
@@ -311,6 +328,7 @@ const TEMPLATES: Template[] = [
311328
},
312329
{
313330
aliases: ['golang', 'go'],
331+
names: ['golang', 'go'],
314332
buildID: 'build_015',
315333
envdVersion: '0.1.0',
316334
cpuCount: 2,
@@ -330,6 +348,7 @@ const TEMPLATES: Template[] = [
330348
},
331349
{
332350
aliases: ['rust'],
351+
names: ['rust'],
333352
buildID: 'build_016',
334353
cpuCount: 2,
335354
memoryMB: 2048,
@@ -346,6 +365,7 @@ const TEMPLATES: Template[] = [
346365
},
347366
{
348367
aliases: ['java-spring', 'spring'],
368+
names: ['java-spring', 'spring'],
349369
buildID: 'build_017',
350370
cpuCount: 3,
351371
memoryMB: 4096,
@@ -365,6 +385,7 @@ const TEMPLATES: Template[] = [
365385
},
366386
{
367387
aliases: ['dotnet', 'csharp'],
388+
names: ['dotnet', 'csharp'],
368389
buildID: 'build_018',
369390
cpuCount: 2,
370391
memoryMB: 3072,
@@ -381,6 +402,7 @@ const TEMPLATES: Template[] = [
381402
},
382403
{
383404
aliases: ['php-laravel', 'laravel'],
405+
names: ['php-laravel', 'laravel'],
384406
buildID: 'build_019',
385407
cpuCount: 2,
386408
memoryMB: 2048,
@@ -400,6 +422,7 @@ const TEMPLATES: Template[] = [
400422
},
401423
{
402424
aliases: ['ruby-rails', 'rails'],
425+
names: ['ruby-rails', 'rails'],
403426
buildID: 'build_020',
404427
cpuCount: 2,
405428
memoryMB: 2048,
@@ -416,6 +439,7 @@ const TEMPLATES: Template[] = [
416439
},
417440
{
418441
aliases: ['jupyter', 'notebook'],
442+
names: ['jupyter', 'notebook'],
419443
buildID: 'build_021',
420444
cpuCount: 4,
421445
memoryMB: 6144,
@@ -435,6 +459,7 @@ const TEMPLATES: Template[] = [
435459
},
436460
{
437461
aliases: ['tensorflow'],
462+
names: ['tensorflow'],
438463
buildID: 'build_022',
439464
cpuCount: 8,
440465
memoryMB: 16384,
@@ -454,6 +479,7 @@ const TEMPLATES: Template[] = [
454479
},
455480
{
456481
aliases: ['pytorch'],
482+
names: ['pytorch'],
457483
buildID: 'build_023',
458484
cpuCount: 8,
459485
memoryMB: 16384,
@@ -473,6 +499,7 @@ const TEMPLATES: Template[] = [
473499
},
474500
{
475501
aliases: ['cassandra'],
502+
names: ['cassandra'],
476503
buildID: 'build_024',
477504
cpuCount: 4,
478505
memoryMB: 8192,
@@ -489,6 +516,7 @@ const TEMPLATES: Template[] = [
489516
},
490517
{
491518
aliases: ['docker', 'dind'],
519+
names: ['docker', 'dind'],
492520
buildID: 'build_025',
493521
cpuCount: 2,
494522
memoryMB: 4096,
@@ -508,6 +536,7 @@ const TEMPLATES: Template[] = [
508536
},
509537
{
510538
aliases: ['kubernetes', 'k8s'],
539+
names: ['kubernetes', 'k8s'],
511540
buildID: 'build_026',
512541
cpuCount: 4,
513542
memoryMB: 8192,
@@ -527,6 +556,7 @@ const TEMPLATES: Template[] = [
527556
},
528557
{
529558
aliases: ['terraform'],
559+
names: ['terraform'],
530560
buildID: 'build_027',
531561
cpuCount: 2,
532562
memoryMB: 2048,
@@ -543,6 +573,7 @@ const TEMPLATES: Template[] = [
543573
},
544574
{
545575
aliases: ['ansible'],
576+
names: ['ansible'],
546577
buildID: 'build_028',
547578
cpuCount: 1,
548579
memoryMB: 1536,
@@ -562,6 +593,7 @@ const TEMPLATES: Template[] = [
562593
},
563594
{
564595
aliases: ['prometheus'],
596+
names: ['prometheus'],
565597
buildID: 'build_029',
566598
cpuCount: 2,
567599
memoryMB: 3072,
@@ -578,6 +610,7 @@ const TEMPLATES: Template[] = [
578610
},
579611
{
580612
aliases: ['jenkins'],
613+
names: ['jenkins'],
581614
buildID: 'build_030',
582615
cpuCount: 3,
583616
envdVersion: '0.1.0',
@@ -597,6 +630,7 @@ const TEMPLATES: Template[] = [
597630
},
598631
{
599632
aliases: ['gitlab-ci'],
633+
names: ['gitlab-ci'],
600634
buildID: 'build_031',
601635
cpuCount: 2,
602636
envdVersion: '0.1.0',
@@ -613,6 +647,7 @@ const TEMPLATES: Template[] = [
613647
},
614648
{
615649
aliases: ['apache-spark', 'spark'],
650+
names: ['apache-spark', 'spark'],
616651
buildID: 'build_032',
617652
cpuCount: 8,
618653
envdVersion: '0.1.0',
@@ -632,6 +667,7 @@ const TEMPLATES: Template[] = [
632667
},
633668
{
634669
aliases: ['kafka'],
670+
names: ['kafka'],
635671
envdVersion: '0.1.0',
636672
buildID: 'build_033',
637673
cpuCount: 3,
@@ -648,6 +684,7 @@ const TEMPLATES: Template[] = [
648684
},
649685
{
650686
aliases: ['rabbitmq'],
687+
names: ['rabbitmq'],
651688
buildID: 'build_034',
652689
cpuCount: 2,
653690
memoryMB: 2048,
@@ -667,6 +704,7 @@ const TEMPLATES: Template[] = [
667704
},
668705
{
669706
aliases: ['zookeeper'],
707+
names: ['zookeeper'],
670708
envdVersion: '0.1.0',
671709
buildID: 'build_035',
672710
cpuCount: 1,
@@ -683,6 +721,7 @@ const TEMPLATES: Template[] = [
683721
},
684722
{
685723
aliases: ['solr'],
724+
names: ['solr'],
686725
buildID: 'build_036',
687726
cpuCount: 2,
688727
memoryMB: 4096,
@@ -702,6 +741,7 @@ const TEMPLATES: Template[] = [
702741
},
703742
{
704743
aliases: ['logstash'],
744+
names: ['logstash'],
705745
buildID: 'build_037',
706746
cpuCount: 2,
707747
memoryMB: 3072,
@@ -718,6 +758,7 @@ const TEMPLATES: Template[] = [
718758
},
719759
{
720760
aliases: ['kibana'],
761+
names: ['kibana'],
721762
buildID: 'build_038',
722763
cpuCount: 1,
723764
memoryMB: 2048,
@@ -734,6 +775,7 @@ const TEMPLATES: Template[] = [
734775
},
735776
{
736777
aliases: ['minio'],
778+
names: ['minio'],
737779
buildID: 'build_039',
738780
cpuCount: 2,
739781
memoryMB: 2048,
@@ -753,6 +795,7 @@ const TEMPLATES: Template[] = [
753795
},
754796
{
755797
aliases: ['vault'],
798+
names: ['vault'],
756799
buildID: 'build_040',
757800
cpuCount: 1,
758801
envdVersion: '0.1.0',

src/features/dashboard/settings/general/info-card.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export function InfoCard({ className }: InfoCardProps) {
3838
<span>{team.id}</span>
3939
<CopyButton value={team.id} variant="ghost" className="size-5" />
4040
</div>
41+
<div className="flex items-center gap-2">
42+
<Badge>Team Slug</Badge>
43+
<span>{team.slug}</span>
44+
<CopyButton value={team.slug} variant="ghost" className="size-5" />
45+
</div>
4146
</div>
4247
</CardContent>
4348
</Card>

0 commit comments

Comments
 (0)