|
10 | 10 | Red Hat, Inc. - initial API and implementation |
11 | 11 |
|
12 | 12 | --> |
13 | | -<div class="factory-information" ng-if="factoryInformationController.copyOriginFactory"> |
| 13 | +<div class="factory-information" |
| 14 | + ng-if="factoryInformationController.copyOriginFactory"> |
14 | 15 | <!-- Name --> |
15 | 16 | <che-label-container che-label-name="Name"> |
16 | 17 | <div layout="column" class="factory-information-input"> |
17 | | - <ng-form name="factoryInformationForm"> |
| 18 | + <ng-form name="factoryInformationController.factoryInformationForm"> |
18 | 19 | <che-input che-form="factoryInformationForm" |
19 | 20 | che-name="name" |
20 | 21 | che-place-holder="Name of the factory" |
21 | 22 | aria-label="Name of the factory" |
22 | 23 | ng-model="factoryInformationController.copyOriginFactory.name" |
23 | | - ng-change="factoryInformationController.updateName($value, factoryInformationForm)" |
| 24 | + ng-change="factoryInformationController.updateFactoryName($value)" |
| 25 | + ng-model-options="{ allowInvalid: true }" |
24 | 26 | ng-trim |
25 | 27 | ng-minlength="3" |
26 | 28 | ng-maxlength="20" |
|
75 | 77 | <md-radio-button value="from-stack">Configure recipe from a stack</md-radio-button> |
76 | 78 | </md-radio-group> |
77 | 79 | <div ng-if="factoryInformationController.stackRecipeMode === 'from-stack'"> |
78 | | - <workspace-select-stack workspace-stack-on-change="factoryInformationController.onWorkspaceStackChanged(config, stackId)" |
79 | | - workspace-name="factoryInformationController.workspaceName" |
80 | | - environment-name="factoryInformationController.environmentName" |
81 | | - workspace-imported-recipe="factoryInformationController.workspaceImportedRecipe"></workspace-select-stack> |
82 | | - <che-button-primary che-button-title="Save" class="save-stack-button" |
83 | | - ng-click="factoryInformationController.saveStack()"></che-button-primary> |
| 80 | + <ng-form name="factoryInformationController.factoryInformationForm"> |
| 81 | + <workspace-select-stack workspace-stack-on-change="factoryInformationController.onWorkspaceStackChanged(config, stackId)" |
| 82 | + workspace-name="factoryInformationController.workspaceName" |
| 83 | + environment-name="factoryInformationController.environmentName" |
| 84 | + workspace-imported-recipe="factoryInformationController.workspaceImportedRecipe"></workspace-select-stack> |
| 85 | + <che-button-primary che-button-title="Save" class="save-stack-button" |
| 86 | + ng-click="factoryInformationController.saveStack()"></che-button-primary> |
| 87 | + </ng-form> |
84 | 88 | </div> |
85 | 89 | </che-label-container> |
86 | 90 |
|
87 | 91 | <che-label-container che-label-name="Workspace" |
88 | 92 | che-label-description="A workspace contains projects and runtime environments."> |
| 93 | + |
89 | 94 | <!--Workspace name--> |
90 | 95 | <che-label-container che-label-name="Name"> |
91 | | - <ng-form name="factoryInformationForm"> |
| 96 | + <ng-form name="factoryInformationController.factoryInformationForm"> |
92 | 97 | <div class="factory-information-input"> |
93 | 98 | <che-input che-form="factoryInformationForm" |
94 | 99 | che-name="name" |
95 | 100 | che-place-holder="Name of the workspace" |
96 | 101 | aria-label="Name of the workspace" |
97 | 102 | ng-model="factoryInformationController.copyOriginFactory.workspace.name" |
98 | | - ng-change="factoryInformationController.updateFactory(factoryInformationForm)" |
| 103 | + ng-change="factoryInformationController.updateWorkspaceName($value)" |
| 104 | + ng-model-options="{ allowInvalid: true }" |
99 | 105 | required |
100 | 106 | ng-minlength="3" |
101 | 107 | ng-maxlength="20" |
|
111 | 117 | </div> |
112 | 118 | </ng-form> |
113 | 119 | </che-label-container> |
| 120 | + |
114 | 121 | <!--Workspace RAM--> |
115 | 122 | <che-label-container che-label-name="RAM"> |
116 | | - <ng-form name="factoryInformationForm"> |
| 123 | + <ng-form name="factoryInformationController.factoryInformationForm"> |
117 | 124 | <div data-ng-repeat="(environmentKey, environmentValue) in factoryInformationController.copyOriginFactory.workspace.environments"> |
118 | 125 | <span ng-if="factoryInformationController.getObjectKeys(factoryInformationController.copyOriginFactory.workspace.environments).length > 1" |
119 | 126 | class="workspace-environment-name">ENVIRONMENT: {{environmentKey}}</span> |
|
124 | 131 | <span ng-if="factoryInformationController.getObjectKeys(environmentValue.machines).length > 1">MACHINE: {{machineKey}}</span> |
125 | 132 | <che-workspace-ram-allocation-slider |
126 | 133 | ng-model="machineValue.attributes.memoryLimitBytes" |
127 | | - che-on-change="factoryInformationController.updateFactory(factoryInformationForm)"></che-workspace-ram-allocation-slider> |
| 134 | + che-on-change="factoryInformationController.updateFactory()"></che-workspace-ram-allocation-slider> |
128 | 135 | </div> |
129 | 136 | </div> |
130 | 137 | </div> |
|
137 | 144 | <che-label-container che-label-name="Configure Commands" |
138 | 145 | che-label-description="Commands are processes that are invoked by users from a dropdown in the IDE."> |
139 | 146 | <cdvy-factory-command cdvy-factory-object="factoryInformationController.copyOriginFactory" |
140 | | - cdvy-on-change="factoryInformationController.updateFactory(factoryInformationForm)"></cdvy-factory-command> |
| 147 | + cdvy-on-change="factoryInformationController.updateFactory()"></cdvy-factory-command> |
141 | 148 | </che-label-container> |
142 | 149 |
|
143 | 150 | <!-- Configure actions --> |
|
152 | 159 | <cdvy-factory-action-box cdvy-lifecycle="onProjectsLoaded" |
153 | 160 | cdvy-callback-controller="factoryInformationController" |
154 | 161 | cdvy-factory-object="factoryInformationController.copyOriginFactory" |
155 | | - cdvy-on-change="factoryInformationController.updateFactory(factoryInformationForm)"></cdvy-factory-action-box> |
| 162 | + cdvy-on-change="factoryInformationController.updateFactory()"></cdvy-factory-action-box> |
156 | 163 | </che-label-container> |
157 | 164 |
|
158 | 165 | <!-- Configuration --> |
|
0 commit comments