summaryrefslogtreecommitdiffstats
path: root/catalog-ui/app/scripts/view-models/wizard/ReadMe.txt
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-06-09 03:19:04 +0300
committerMichael Lando <ml636r@att.com>2017-06-09 03:19:04 +0300
commited64b5edff15e702493df21aa3230b81593e6133 (patch)
treea4cb01fdaccc34930a8db403a3097c0d1e40914b /catalog-ui/app/scripts/view-models/wizard/ReadMe.txt
parent280f8015d06af1f41a3ef12e8300801c7a5e0d54 (diff)
[SDC-29] catalog 1707 rebase commit.
Change-Id: I43c3dc5cf44abf5da817649bc738938a3e8388c1 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/app/scripts/view-models/wizard/ReadMe.txt')
-rw-r--r--catalog-ui/app/scripts/view-models/wizard/ReadMe.txt54
1 files changed, 0 insertions, 54 deletions
diff --git a/catalog-ui/app/scripts/view-models/wizard/ReadMe.txt b/catalog-ui/app/scripts/view-models/wizard/ReadMe.txt
deleted file mode 100644
index ca5cfb988a..0000000000
--- a/catalog-ui/app/scripts/view-models/wizard/ReadMe.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-import-asset wizard
-========================================================
-
-What should be done in each wizard step:
-----------------------------------------
-
-1. Each step scope should extend IAssetCreationStepScope (this way you can call methods on the wizard scope).
- Example:
- export interface IGeneralStepScope extends IAssetCreationStepScope {
-
- }
-
-2. Each step class should implements IAssetCreationStep
- Example: export class GeneralStepViewModel implements IAssetCreationStep {
-
- }
-
-3. Add the method: public save = (callback:Function):void => {}
- The method should perform the save and call: callback(true); in case of success, or callback(false); in case of error.
- Example:
- var onSuccess:Function = (resourceProperties:Services.IResourceResource) => {
- this.$scope.setAngularResourceOfResource(resourceProperties);
- var resourceObj = new Sdc.Models.Resource(resourceProperties);
- this.$scope.setEntity(resourceObj);
- this.$scope.latestEntityName = (resourceProperties.resourceName);
- callback(true);
- };
-
-4. Add the first line after the constructor: this.$scope.registerChild(this);
- This will register the current step reference in the wizard.
-
-5. Each step can get and set angular $resource of resource from the wizard.
- // Will be called from each step to get current entity.
- this.$scope.getAngularResourceOfResource = ():Services.IResourceResource => {
- return this.resourceProperties;
- };
-
- // Will be called from each step after save to update the resource.
- this.$scope.setAngularResourceOfResource = (resourceProperties:Services.IResourceResource):void => {
- this.resourceProperties = resourceProperties;
- this.fillAssetNameAndType();
- };
-
- Note: after success save, set setAngularResourceOfResource in the wizard (see example in step 3).
-
-6. The wizard needs to know if the step is valid (to know if to show next button), I used the following to update the wizard:
- this.$scope.$watch("editForm.$valid", function(newVal, oldVal){
- this.$scope.setValidState(newVal);
- });
-
- Note: in case there is no save for the step, and the step is always valid, call: this.$scope.setValidState(true);
-
-
-