This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch 
gh-readonly-queue/main/pr-9376-01cfd253bfbe8c04b39181f7f81c3f0e967bf273
in repository https://gitbox.apache.org/repos/asf/texera.git

commit 99c5ba3a25e04fe77472fa8a82fca365fc0f723d
Author: Xinyuan Lin <[email protected]>
AuthorDate: Tue Nov 10 02:49:47 2026 +0000

    refactor(frontend): share resource creation forms (#9376)
    
    ### What changes were proposed in this PR?
    Dataset and Model creation repeat the same form markup and styling. Both
    creators now render a new `texera-resource-creator-form` component,
    which holds the Formly fields, the visibility and downloadability
    switches, and the Create and Cancel buttons. Each creator passes in its
    form, model and flags and handles the component's events. The component
    and the contributor editor share one Sass mixin for the form width and
    the button styles, removing 67 net lines.
    
    The rendered controls behave as before, and the version creator still
    hides the switches. The one visible change: the model creator's Create
    button now hovers in the dataset creator's `#0062cc` instead of
    `#0069d9`.
    
    ### Any related issues, documentation, discussions?
    Closes #9374.
    
    ### How was this PR tested?
    - The 37 existing creator and contributor-editor tests pass before and
    after, with the same names in the same order. They drive the new
    component through each creator's rendered buttons and switches,
    including the version mode without switches.
    - Compiled each stylesheet with Sass and compared it with main: the
    contributor editor's CSS is identical, the dataset creator's matches the
    new component's apart from the two renamed classes, and the model
    creator's differs only in that hover color.
    - Full frontend formatting/lint and the application AOT build pass.
    
    ```sh
    cd frontend
    node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng.js test gui 
--watch=false --progress=false \
      --include 
src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.spec.ts
 \
      --include 
src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.spec.ts
 \
      --include 
src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-contributor-editor/user-dataset-contributor-editor.component.spec.ts
    node .yarn/releases/yarn-4.14.1.cjs run format:ci
    node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng.js build 
gui --aot=true --progress=false
    ```
    
    ### Was this PR authored or co-authored using generative AI tooling?
    Generated-by: Codex (GPT-6) and Claude Code (Claude Opus 5.5)
---
 .../component/user/_resource-form-shared.scss      | 58 +++++++++++++++++
 .../resource-creator-form.component.html}          | 20 +++---
 .../resource-creator-form.component.scss}          | 40 +-----------
 .../resource-creator-form.component.ts             | 62 ++++++++++++++++++
 .../user-dataset-contributor-editor.component.scss | 38 +----------
 .../user-dataset-version-creator.component.html    | 65 ++++---------------
 .../user-dataset-version-creator.component.ts      | 26 ++------
 .../user-model-creator.component.html              | 62 ++++--------------
 .../user-model-creator.component.scss              | 75 ----------------------
 .../user-model-creator.component.ts                | 23 ++-----
 10 files changed, 165 insertions(+), 304 deletions(-)

diff --git 
a/frontend/src/app/dashboard/component/user/_resource-form-shared.scss 
b/frontend/src/app/dashboard/component/user/_resource-form-shared.scss
new file mode 100644
index 0000000000..8754bcac29
--- /dev/null
+++ b/frontend/src/app/dashboard/component/user/_resource-form-shared.scss
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+@use "sass:color";
+
+@mixin editor-layout($form-selector, $primary-selector, $cancel-margin-top) {
+  #{$form-selector} {
+    width: 80%;
+    margin: auto;
+  }
+
+  #{$primary-selector} {
+    background-color: #ffffff;
+    color: #007bff;
+    border: 1px solid lightgray;
+    padding: 5px 20px;
+    cursor: pointer;
+    margin-left: 15%;
+    margin-right: 5%;
+    width: 30%;
+    text-align: center;
+    &:hover {
+      background-color: color.adjust(#007bff, $lightness: -10%);
+      color: #ffffff;
+    }
+  }
+
+  .cancel-btn {
+    background-color: #ffffff;
+    color: #ff0000;
+    border: 1px solid lightgray;
+    padding: 5px 20px;
+    cursor: pointer;
+    margin-right: 15%;
+    margin-left: 5%;
+    margin-top: $cancel-margin-top;
+    width: 30%;
+    text-align: center;
+    &:hover {
+      background-color: color.adjust(#ff0000, $lightness: -10%);
+      color: #ffffff;
+    }
+  }
+}
diff --git 
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.html
 
b/frontend/src/app/dashboard/component/user/resource-creator-form/resource-creator-form.component.html
similarity index 79%
copy from 
frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.html
copy to 
frontend/src/app/dashboard/component/user/resource-creator-form/resource-creator-form.component.html
index 485db69108..a52b890603 100644
--- 
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.html
+++ 
b/frontend/src/app/dashboard/component/user/resource-creator-form/resource-creator-form.component.html
@@ -22,29 +22,27 @@
     [nzSpinning]="isCreating"
     nzSize="large"
     nzTip="Creating...">
-    <div
-      class="texera-user-dataset-creator-form"
-      [ngClass]="{'disabled-backdrop': isCreating}">
+    <div class="creator-form">
       <formly-form
         [form]="form"
         [fields]="fields"
         [model]="model"></formly-form>
       <div
-        *ngIf="!isCreatingVersion"
-        class="dataset-toggles">
+        *ngIf="showToggles"
+        class="creator-toggles">
         <div class="toggle-item">
           <label>Visibility:</label>
           <nz-switch
-            [ngModel]="isDatasetPublic"
-            (ngModelChange)="onPublicStatusChange($event)"
+            [ngModel]="isPublic"
+            (ngModelChange)="isPublicChange.emit($event)"
             nzCheckedChildren="public"
             nzUnCheckedChildren="private"></nz-switch>
         </div>
         <div class="toggle-item">
           <label>Downloadable:</label>
           <nz-switch
-            [ngModel]="isDatasetDownloadable"
-            (ngModelChange)="onDownloadableStatusChange($event)"
+            [ngModel]="isDownloadable"
+            (ngModelChange)="isDownloadableChange.emit($event)"
             nzCheckedChildren="enabled"
             nzUnCheckedChildren="disabled"></nz-switch>
         </div>
@@ -54,7 +52,7 @@
     <button
       nz-button
       nzType="primary"
-      (click)="onClickCreate()"
+      (click)="createClick.emit()"
       [disabled]="isCreating"
       class="create-btn">
       Create
@@ -63,7 +61,7 @@
     <button
       nz-button
       nzType="default"
-      (click)="onClickCancel()"
+      (click)="cancelClick.emit()"
       class="cancel-btn"
       [disabled]="isCreating">
       Cancel
diff --git 
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.scss
 
b/frontend/src/app/dashboard/component/user/resource-creator-form/resource-creator-form.component.scss
similarity index 59%
rename from 
frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.scss
rename to 
frontend/src/app/dashboard/component/user/resource-creator-form/resource-creator-form.component.scss
index a597dd6dbc..976318b114 100644
--- 
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.scss
+++ 
b/frontend/src/app/dashboard/component/user/resource-creator-form/resource-creator-form.component.scss
@@ -17,45 +17,11 @@
  * under the License.
  */
 
-.texera-user-dataset-creator-form {
-  width: 80%;
-  margin: auto;
-}
-
-.create-btn {
-  background-color: #ffffff;
-  color: #007bff;
-  border: 1px solid lightgray;
-  padding: 5px 20px;
-  cursor: pointer;
-  margin-left: 15%;
-  margin-right: 5%;
-  width: 30%;
-  text-align: center;
-  &:hover {
-    background-color: darken(#007bff, 10%);
-    color: #ffffff;
-  }
-}
+@use "../resource-form-shared" as resource-form;
 
-.cancel-btn {
-  background-color: #ffffff;
-  color: #ff0000;
-  border: 1px solid lightgray;
-  padding: 5px 20px;
-  cursor: pointer;
-  margin-right: 15%;
-  margin-left: 5%;
-  margin-top: 10%;
-  width: 30%;
-  text-align: center;
-  &:hover {
-    background-color: darken(#ff0000, 10%);
-    color: #ffffff;
-  }
-}
+@include resource-form.editor-layout(".creator-form", ".create-btn", 10%);
 
-.dataset-toggles {
+.creator-toggles {
   margin-top: 16px;
   margin-bottom: 16px;
 }
diff --git 
a/frontend/src/app/dashboard/component/user/resource-creator-form/resource-creator-form.component.ts
 
b/frontend/src/app/dashboard/component/user/resource-creator-form/resource-creator-form.component.ts
new file mode 100644
index 0000000000..fc557c6d59
--- /dev/null
+++ 
b/frontend/src/app/dashboard/component/user/resource-creator-form/resource-creator-form.component.ts
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component, EventEmitter, Input, Output } from "@angular/core";
+import { FormGroup, FormsModule } from "@angular/forms";
+import { FormlyFieldConfig, FormlyModule } from "@ngx-formly/core";
+import { NgIf } from "@angular/common";
+import { NzSpinComponent } from "ng-zorro-antd/spin";
+import { NzSwitchComponent } from "ng-zorro-antd/switch";
+import { NzButtonComponent } from "ng-zorro-antd/button";
+import { NzWaveDirective } from "ng-zorro-antd/core/wave";
+import { ɵNzTransitionPatchDirective } from 
"ng-zorro-antd/core/transition-patch";
+
+/**
+ * The creation form shared by the dataset and model creators: the Formly 
fields, the visibility
+ * and downloadability switches, and the Create and Cancel buttons. The parent 
keeps the state and
+ * handles every event.
+ */
+@Component({
+  selector: "texera-resource-creator-form",
+  templateUrl: "./resource-creator-form.component.html",
+  styleUrls: ["./resource-creator-form.component.scss"],
+  imports: [
+    NzSpinComponent,
+    FormlyModule,
+    NgIf,
+    NzSwitchComponent,
+    FormsModule,
+    NzButtonComponent,
+    NzWaveDirective,
+    ɵNzTransitionPatchDirective,
+  ],
+})
+export class ResourceCreatorFormComponent {
+  @Input({ required: true }) form!: FormGroup;
+  @Input({ required: true }) fields!: FormlyFieldConfig[];
+  @Input({ required: true }) model!: Record<string, unknown>;
+  @Input() isCreating = false;
+  @Input() showToggles = true;
+  @Input() isPublic = false;
+  @Input() isDownloadable = false;
+  @Output() isPublicChange = new EventEmitter<boolean>();
+  @Output() isDownloadableChange = new EventEmitter<boolean>();
+  @Output() createClick = new EventEmitter<void>();
+  @Output() cancelClick = new EventEmitter<void>();
+}
diff --git 
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-contributor-editor/user-dataset-contributor-editor.component.scss
 
b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-contributor-editor/user-dataset-contributor-editor.component.scss
index ef30ab1156..3e265d5faf 100644
--- 
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-contributor-editor/user-dataset-contributor-editor.component.scss
+++ 
b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-contributor-editor/user-dataset-contributor-editor.component.scss
@@ -17,40 +17,6 @@
  * under the License.
  */
 
-.contributor-form {
-  width: 80%;
-  margin: auto;
-}
+@use "../../../resource-form-shared" as resource-form;
 
-.save-btn {
-  background-color: #ffffff;
-  color: #007bff;
-  border: 1px solid lightgray;
-  padding: 5px 20px;
-  cursor: pointer;
-  margin-left: 15%;
-  margin-right: 5%;
-  width: 30%;
-  text-align: center;
-  &:hover {
-    background-color: darken(#007bff, 10%);
-    color: #ffffff;
-  }
-}
-
-.cancel-btn {
-  background-color: #ffffff;
-  color: #ff0000;
-  border: 1px solid lightgray;
-  padding: 5px 20px;
-  cursor: pointer;
-  margin-right: 15%;
-  margin-left: 5%;
-  margin-top: 5%;
-  width: 30%;
-  text-align: center;
-  &:hover {
-    background-color: darken(#ff0000, 10%);
-    color: #ffffff;
-  }
-}
+@include resource-form.editor-layout(".contributor-form", ".save-btn", 5%);
diff --git 
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.html
 
b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.html
index 485db69108..65504590cf 100644
--- 
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.html
+++ 
b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.html
@@ -17,56 +17,15 @@
  under the License.
 -->
 
-<div>
-  <nz-spin
-    [nzSpinning]="isCreating"
-    nzSize="large"
-    nzTip="Creating...">
-    <div
-      class="texera-user-dataset-creator-form"
-      [ngClass]="{'disabled-backdrop': isCreating}">
-      <formly-form
-        [form]="form"
-        [fields]="fields"
-        [model]="model"></formly-form>
-      <div
-        *ngIf="!isCreatingVersion"
-        class="dataset-toggles">
-        <div class="toggle-item">
-          <label>Visibility:</label>
-          <nz-switch
-            [ngModel]="isDatasetPublic"
-            (ngModelChange)="onPublicStatusChange($event)"
-            nzCheckedChildren="public"
-            nzUnCheckedChildren="private"></nz-switch>
-        </div>
-        <div class="toggle-item">
-          <label>Downloadable:</label>
-          <nz-switch
-            [ngModel]="isDatasetDownloadable"
-            (ngModelChange)="onDownloadableStatusChange($event)"
-            nzCheckedChildren="enabled"
-            nzUnCheckedChildren="disabled"></nz-switch>
-        </div>
-      </div>
-    </div>
-
-    <button
-      nz-button
-      nzType="primary"
-      (click)="onClickCreate()"
-      [disabled]="isCreating"
-      class="create-btn">
-      Create
-    </button>
-
-    <button
-      nz-button
-      nzType="default"
-      (click)="onClickCancel()"
-      class="cancel-btn"
-      [disabled]="isCreating">
-      Cancel
-    </button>
-  </nz-spin>
-</div>
+<texera-resource-creator-form
+  [form]="form"
+  [fields]="fields"
+  [model]="model"
+  [isCreating]="isCreating"
+  [showToggles]="!isCreatingVersion"
+  [isPublic]="isDatasetPublic"
+  [isDownloadable]="isDatasetDownloadable"
+  (isPublicChange)="onPublicStatusChange($event)"
+  (isDownloadableChange)="onDownloadableStatusChange($event)"
+  (createClick)="onClickCreate()"
+  (cancelClick)="onClickCancel()"></texera-resource-creator-form>
diff --git 
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.ts
 
b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.ts
index 326185d10f..d5c2bd870d 100644
--- 
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.ts
+++ 
b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.ts
@@ -18,40 +18,22 @@
  */
 
 import { Component, inject, OnInit } from "@angular/core";
-import { FormGroup, FormsModule } from "@angular/forms";
-import { FormlyFieldConfig, FormlyModule } from "@ngx-formly/core";
+import { FormGroup } from "@angular/forms";
+import { FormlyFieldConfig } from "@ngx-formly/core";
 import { DatasetService } from 
"../../../../../service/user/dataset/dataset.service";
 import { Dataset } from "../../../../../../common/type/dataset";
 import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
 import { NotificationService } from 
"../../../../../../common/service/notification/notification.service";
 import { HttpErrorResponse } from "@angular/common/http";
 import { NZ_MODAL_DATA, NzModalRef } from "ng-zorro-antd/modal";
-import { NzSpinComponent } from "ng-zorro-antd/spin";
-import { NgClass, NgIf } from "@angular/common";
-import { NzSwitchComponent } from "ng-zorro-antd/switch";
-import { NzSpaceCompactItemDirective } from "ng-zorro-antd/space";
-import { NzButtonComponent } from "ng-zorro-antd/button";
-import { NzWaveDirective } from "ng-zorro-antd/core/wave";
-import { ɵNzTransitionPatchDirective } from 
"ng-zorro-antd/core/transition-patch";
 import { contributorFieldGroup } from 
"../user-dataset-contributor-editor/contributor-form-fields";
+import { ResourceCreatorFormComponent } from 
"../../../resource-creator-form/resource-creator-form.component";
 
 @UntilDestroy()
 @Component({
   selector: "texera-user-dataset-version-creator",
   templateUrl: "./user-dataset-version-creator.component.html",
-  styleUrls: ["./user-dataset-version-creator.component.scss"],
-  imports: [
-    NzSpinComponent,
-    NgClass,
-    FormlyModule,
-    NgIf,
-    NzSwitchComponent,
-    FormsModule,
-    NzSpaceCompactItemDirective,
-    NzButtonComponent,
-    NzWaveDirective,
-    ɵNzTransitionPatchDirective,
-  ],
+  imports: [ResourceCreatorFormComponent],
 })
 export class UserDatasetVersionCreatorComponent implements OnInit {
   readonly isCreatingVersion: boolean = 
inject(NZ_MODAL_DATA).isCreatingVersion;
diff --git 
a/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.html
 
b/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.html
index 01e9ba5722..51ea1c46c2 100644
--- 
a/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.html
+++ 
b/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.html
@@ -17,54 +17,14 @@
   ~ under the License.
 -->
 
-<div>
-  <nz-spin
-    [nzSpinning]="isCreating"
-    nzSize="large"
-    nzTip="Creating...">
-    <div
-      class="texera-user-model-creator-form"
-      [ngClass]="{'disabled-backdrop': isCreating}">
-      <formly-form
-        [form]="form"
-        [fields]="fields"
-        [model]="formModel"></formly-form>
-      <div class="model-toggles">
-        <div class="toggle-item">
-          <label>Visibility:</label>
-          <nz-switch
-            [ngModel]="isModelPublic"
-            (ngModelChange)="onPublicStatusChange($event)"
-            nzCheckedChildren="public"
-            nzUnCheckedChildren="private"></nz-switch>
-        </div>
-        <div class="toggle-item">
-          <label>Downloadable:</label>
-          <nz-switch
-            [ngModel]="isModelDownloadable"
-            (ngModelChange)="onDownloadableStatusChange($event)"
-            nzCheckedChildren="enabled"
-            nzUnCheckedChildren="disabled"></nz-switch>
-        </div>
-      </div>
-    </div>
-
-    <button
-      nz-button
-      nzType="primary"
-      (click)="onClickCreate()"
-      [disabled]="isCreating"
-      class="create-btn">
-      Create
-    </button>
-
-    <button
-      nz-button
-      nzType="default"
-      (click)="onClickCancel()"
-      class="cancel-btn"
-      [disabled]="isCreating">
-      Cancel
-    </button>
-  </nz-spin>
-</div>
+<texera-resource-creator-form
+  [form]="form"
+  [fields]="fields"
+  [model]="formModel"
+  [isCreating]="isCreating"
+  [isPublic]="isModelPublic"
+  [isDownloadable]="isModelDownloadable"
+  (isPublicChange)="onPublicStatusChange($event)"
+  (isDownloadableChange)="onDownloadableStatusChange($event)"
+  (createClick)="onClickCreate()"
+  (cancelClick)="onClickCancel()"></texera-resource-creator-form>
diff --git 
a/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.scss
 
b/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.scss
deleted file mode 100644
index 50145f3293..0000000000
--- 
a/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.scss
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-// Forked from user-dataset-version-creator.component.scss, dropping the 
uploader selectors.
-// Convergence with the dataset creator is tracked under #6494.
-
-.texera-user-model-creator-form {
-  width: 80%;
-  margin: auto;
-}
-
-.create-btn {
-  background-color: #ffffff;
-  color: #007bff;
-  border: 1px solid lightgray;
-  padding: 5px 20px;
-  cursor: pointer;
-  margin-left: 15%;
-  margin-right: 5%;
-  width: 30%;
-  text-align: center;
-  &:hover {
-    background-color: #0069d9;
-    color: #ffffff;
-  }
-}
-
-.cancel-btn {
-  background-color: #ffffff;
-  color: #ff0000;
-  border: 1px solid lightgray;
-  padding: 5px 20px;
-  cursor: pointer;
-  margin-right: 15%;
-  margin-left: 5%;
-  margin-top: 10%;
-  width: 30%;
-  text-align: center;
-  &:hover {
-    background-color: #cc0000;
-    color: #ffffff;
-  }
-}
-
-.model-toggles {
-  margin-top: 16px;
-  margin-bottom: 16px;
-}
-
-.toggle-item {
-  display: flex;
-  align-items: center;
-  margin-bottom: 12px;
-
-  label {
-    margin-right: 12px;
-    min-width: 80px;
-    font-weight: 500;
-  }
-}
diff --git 
a/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.ts
 
b/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.ts
index 4469623804..06e76c109c 100644
--- 
a/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.ts
+++ 
b/frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.ts
@@ -18,17 +18,11 @@
  */
 
 import { Component, OnInit } from "@angular/core";
-import { FormGroup, FormsModule } from "@angular/forms";
-import { FormlyFieldConfig, FormlyModule } from "@ngx-formly/core";
+import { FormGroup } from "@angular/forms";
+import { FormlyFieldConfig } from "@ngx-formly/core";
 import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
 import { HttpErrorResponse } from "@angular/common/http";
 import { NzModalRef } from "ng-zorro-antd/modal";
-import { NzSpinComponent } from "ng-zorro-antd/spin";
-import { NgClass } from "@angular/common";
-import { NzSwitchComponent } from "ng-zorro-antd/switch";
-import { NzButtonComponent } from "ng-zorro-antd/button";
-import { NzWaveDirective } from "ng-zorro-antd/core/wave";
-import { ɵNzTransitionPatchDirective } from 
"ng-zorro-antd/core/transition-patch";
 
 import {
   MODEL_FORMATS,
@@ -38,6 +32,7 @@ import {
 } from "../../../../service/user/model/model.service";
 import { Model } from "../../../../../common/type/model";
 import { NotificationService } from 
"../../../../../common/service/notification/notification.service";
+import { ResourceCreatorFormComponent } from 
"../../resource-creator-form/resource-creator-form.component";
 
 export function sanitizeModelName(name: string): string {
   return name
@@ -50,17 +45,7 @@ export function sanitizeModelName(name: string): string {
 @Component({
   selector: "texera-user-model-creator",
   templateUrl: "./user-model-creator.component.html",
-  styleUrls: ["./user-model-creator.component.scss"],
-  imports: [
-    NzSpinComponent,
-    NgClass,
-    FormlyModule,
-    NzSwitchComponent,
-    FormsModule,
-    NzButtonComponent,
-    NzWaveDirective,
-    ɵNzTransitionPatchDirective,
-  ],
+  imports: [ResourceCreatorFormComponent],
 })
 export class UserModelCreatorComponent implements OnInit {
   public form: FormGroup = new FormGroup({});

Reply via email to