remove subdomain feature

This commit is contained in:
Krrish Ghimire
2026-07-06 23:04:16 +05:45
parent ea69080710
commit 708cac6848
6 changed files with 13 additions and 34 deletions

View File

@@ -3,7 +3,6 @@ export interface SiteResponse {
userId: string;
name: string;
description: string;
subdomain: string;
publishedUrl: string | null;
themeConfig: Record<string, unknown>;
status: 'DRAFT' | 'PUBLISHED';
@@ -16,7 +15,6 @@ export interface SiteResponse {
export interface SiteRequest {
name: string;
description: string;
subdomain: string;
deploymentTarget?: string;
themeConfig?: Record<string, unknown>;
}

View File

@@ -21,15 +21,6 @@ import { SiteService } from '../../core/services/site.service';
<mat-error>Name is required</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" class="w-full">
<mat-label>Subdomain</mat-label>
<input matInput formControlName="subdomain" placeholder="my-site" />
<mat-error *ngIf="form.get('subdomain')?.hasError('required')">Subdomain is required</mat-error>
<mat-error *ngIf="form.get('subdomain')?.hasError('pattern')">
Lowercase letters, numbers, and hyphens only
</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" class="w-full">
<mat-label>Description (optional)</mat-label>
<textarea matInput formControlName="description" rows="3" placeholder="What's your site about?"></textarea>
@@ -51,7 +42,6 @@ export class CreateSiteDialog {
form = this.fb.group({
name: ['', Validators.required],
subdomain: ['', [Validators.pattern(/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/)]],
description: [''],
});
loading = false;

View File

@@ -61,7 +61,6 @@ import { DeleteSiteDialog } from './delete-site-dialog/delete-site-dialog';
<mat-card *ngFor="let site of sites" class="cursor-pointer hover:shadow-lg transition-shadow" (click)="openBuilder(site)">
<mat-card-header>
<mat-card-title>{{ site.name }}</mat-card-title>
<mat-card-subtitle *ngIf="site.subdomain">{{ site.subdomain }}</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<p class="text-gray-600 text-sm mt-2">{{ site.description || 'No description' }}</p>

View File

@@ -56,10 +56,6 @@ import { SelfHostedConfigResponse } from '../../core/models/deployment';
<mat-label>Description</mat-label>
<textarea matInput rows="2" [(ngModel)]="siteDescription" [disabled]="saving"></textarea>
</mat-form-field>
<mat-form-field appearance="outline" class="w-full">
<mat-label>Subdomain</mat-label>
<input matInput [(ngModel)]="siteSubdomain" [disabled]="saving" />
</mat-form-field>
<div class="flex justify-end">
<button mat-flat-button color="primary" [disabled]="saving || !siteName.trim()" (click)="saveSettings()">
<mat-icon>save</mat-icon>
@@ -316,7 +312,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
siteId: string | null = null;
siteName = '';
siteDescription = '';
siteSubdomain = '';
siteStatus: 'DRAFT' | 'PUBLISHED' = 'DRAFT';
liveUrl = '';
deploymentTarget: 'GIT_PAGES' | 'SELF_HOSTED' | 'NONE' = 'NONE';
@@ -370,7 +365,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
next: (site) => {
this.siteName = site.name;
this.siteDescription = site.description || '';
this.siteSubdomain = site.subdomain || '';
this.siteStatus = site.status;
this.liveUrl = site.publishedUrl || '';
this.deploymentTarget = site.deploymentTarget || 'NONE';
@@ -491,7 +485,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
this.siteService.update(this.siteId, {
name: this.siteName,
description: this.siteDescription,
subdomain: this.siteSubdomain,
deploymentTarget: this.deploymentTarget,
}).pipe(takeUntil(this.destroy$))
.subscribe({
@@ -506,7 +499,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
this.siteService.update(this.siteId, {
name: this.siteName,
description: this.siteDescription,
subdomain: this.siteSubdomain,
deploymentTarget: this.deploymentTarget,
}).pipe(takeUntil(this.destroy$))
.subscribe({
@@ -593,7 +585,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
const name = this.siteSubdomain || this.siteId || 'site';
const name = this.siteId || 'site';
a.download = `site-export-${name}.zip`;
a.click();
window.URL.revokeObjectURL(url);