Skip to content

Commit

Permalink
Work for #3390: fix dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 committed Aug 30, 2022
1 parent f5063b9 commit 0f48416
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 16 deletions.
1 change: 1 addition & 0 deletions packages/survey-creator-angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"preserveSymlinks": true,
"outputPath": "./dist/angular-ui",
"index": "./example/angular-ui/src/index.html",
"main": "./example/angular-ui/src/main.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@angular/router": "^13.0.0",
"bootstrap": "^3.3.7",
"survey-core": "../../../../../survey-library/build/survey-core",
"survey-creator-angular": "../../build",
"survey-creator-core": "../../../survey-creator-core/build",
"survey-angular-ui": "../../../../../survey-library/build/survey-angular-ui",
"surveyjs-widgets": "^1.9.40",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<svc-creator></svc-creator>
<svc-creator [model]="creator"></svc-creator>
Original file line number Diff line number Diff line change
@@ -1,9 +1,82 @@
import { Component } from "@angular/core";
import { SurveyModel } from "survey-core";
import { CreatorBase } from "survey-creator-core";

@Component({
selector: "app-root",
templateUrl: "./app.component.html"
})
export class AppComponent {
public isTest = !!(<any>window)["%hammerhead%"];
public survey = new SurveyModel({
"logoPosition": "right",
"completedHtml": "<h3>Thank you for your feedback.</h3><h5>Your thoughts and ideas will help us to create a great product!</h5>",
"completedHtmlOnCondition": [
{
"expression": "{nps_score} > 8",
"html": "<h3>Thank you for your feedback.</h3><h5>We glad that you love our product. Your ideas and suggestions will help us to make our product even better!</h5>"
},
{
"expression": "{nps_score} < 7",
"html": "<h3>Thank you for your feedback.</h3><h5> We are glad that you share with us your ideas.We highly value all suggestions from our customers. We do our best to improve the product and reach your expectation.</h5><br />"
}
],
"pages": [
{
"name": "page1",
"elements": [
{
"type": "rating",
"name": "nps_score",
"title": "On a scale of zero to ten, how likely are you to recommend our product to a friend or colleague?",
"isRequired": true,
"rateMin": 0,
"rateMax": 10,
"minRateDescription": "(Most unlikely)",
"maxRateDescription": "(Most likely)"
},
{
"type": "checkbox",
"name": "promoter_features",
"visible": false,
"visibleIf": "{nps_score} >= 9",
"title": "Which features do you value the most?",
"isRequired": true,
"validators": [
{
"type": "answercount",
"text": "Please select two features maximum.",
"maxCount": 2
}
],
"choices": [
"Performance",
"Stability",
"User Interface",
"Complete Functionality"
],
"hasOther": true,
"otherText": "Other feature:",
"colCount": 2
},
{
"type": "comment",
"name": "passive_experience",
"visible": false,
"visibleIf": "{nps_score} > 6 and {nps_score} < 9",
"title": "What do you like about our product?"
},
{
"type": "comment",
"name": "disappointed_experience",
"visible": false,
"visibleIf": "{nps_score} notempty",
"title": "What do you miss or find disappointing in your experience with our products?"
}
]
}
],
"showQuestionNumbers": "off"
});
public creator = new CreatorBase({}, {})
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import { BrowserModule } from "@angular/platform-browser";

import { AppComponent } from "./app.component";
import { SurveyCreatorAngularModule } from "survey-creator-angular";
import { SurveyAngularModule } from "survey-angular-ui";

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule, SurveyCreatorAngularModule, FormsModule
BrowserModule, SurveyCreatorAngularModule, FormsModule, SurveyAngularModule
],
providers: [],
bootstrap: [AppComponent]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/angular-ui",
"baseUrl": ".",
"noImplicitAny": false,
"baseUrl": "./",
"paths": {
"survey-angular-ui": [
"./node_modules/survey-angular-ui/survey-angular-ui",
"./node_modules/survey-angular-ui",
],
"survey-creator-angular": [
"../../build",
"../../build/survey-creator-angular"
],
"survey-creator-core": [
"./node_modules/survey-creator-core"
],
"survey-core": [
"./node_modules/survey-core"
]
}
},
Expand Down
12 changes: 6 additions & 6 deletions packages/survey-creator-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
"typings": "survey-creator-angular.d.ts",
"peerDependencies": {
"rxjs": "~7.4.0",
"zone.js": "~0.11.4",
"survey-core": "../../../survey-library/build/survey-core",
"survey-creator-core": "../survey-creator-core/build",
"survey-angular-ui": "../../../survey-library/build/survey-angular-ui"
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.2.5",
Expand Down Expand Up @@ -52,7 +49,10 @@
"standard-version": "^8.0.1",
"tslib": "^2.3.0",
"typescript": "~4.4.3",
"zone.js": "~0.11.4"
"zone.js": "~0.11.4",
"survey-core": "../../../survey-library/build/survey-core",
"survey-creator-core": "../survey-creator-core/build",
"survey-angular-ui": "../../../survey-library/build/survey-angular-ui"
},
"scripts": {
"build": "ng build",
Expand All @@ -62,4 +62,4 @@
"test:single": "ng test --watch=false --browsers=ChromeHeadless survey-creator-angular",
"release": "standard-version --message \"Release: %s [skip ci]\" "
}
}
}
3 changes: 2 additions & 1 deletion packages/survey-creator-angular/src/angular-ui.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { CommonModule } from "@angular/common";
import { FormsModule } from "@angular/forms";

import { CreatorComponent } from "./creator.component";
import { SurveyAngularModule } from "survey-angular-ui";

@NgModule({
declarations: [CreatorComponent],
imports: [
CommonModule, FormsModule
CommonModule, FormsModule, SurveyAngularModule
],
exports: [
CreatorComponent
Expand Down
1 change: 1 addition & 0 deletions packages/survey-creator-angular/src/creator.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div>
Creator !
<survey [model]="survey"></survey>
</div>
84 changes: 82 additions & 2 deletions packages/survey-creator-angular/src/creator.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,88 @@
import { Component } from "@angular/core";
import { Component, Input } from "@angular/core";
import { SurveyModel } from "survey-core";
import { BaseAngular } from "survey-angular-ui";
import { CreatorBase } from "survey-creator-core";

@Component({
selector: "svc-creator",
templateUrl: "./creator.component.html",
styleUrls: []
})
export class CreatorComponent {
export class CreatorComponent extends BaseAngular<CreatorBase> {
@Input() model!: CreatorBase;

protected getModel(): CreatorBase {
return this.model;
}

public survey = new SurveyModel({
"logoPosition": "right",
"completedHtml": "<h3>Thank you for your feedback.</h3><h5>Your thoughts and ideas will help us to create a great product!</h5>",
"completedHtmlOnCondition": [
{
"expression": "{nps_score} > 8",
"html": "<h3>Thank you for your feedback.</h3><h5>We glad that you love our product. Your ideas and suggestions will help us to make our product even better!</h5>"
},
{
"expression": "{nps_score} < 7",
"html": "<h3>Thank you for your feedback.</h3><h5> We are glad that you share with us your ideas.We highly value all suggestions from our customers. We do our best to improve the product and reach your expectation.</h5><br />"
}
],
"pages": [
{
"name": "page1",
"elements": [
{
"type": "rating",
"name": "nps_score",
"title": "On a scale of zero to ten, how likely are you to recommend our product to a friend or colleague?",
"isRequired": true,
"rateMin": 0,
"rateMax": 10,
"minRateDescription": "(Most unlikely)",
"maxRateDescription": "(Most likely)"
},
{
"type": "checkbox",
"name": "promoter_features",
"visible": false,
"visibleIf": "{nps_score} >= 9",
"title": "Which features do you value the most?",
"isRequired": true,
"validators": [
{
"type": "answercount",
"text": "Please select two features maximum.",
"maxCount": 2
}
],
"choices": [
"Performance",
"Stability",
"User Interface",
"Complete Functionality"
],
"hasOther": true,
"otherText": "Other feature:",
"colCount": 2
},
{
"type": "comment",
"name": "passive_experience",
"visible": false,
"visibleIf": "{nps_score} > 6 and {nps_score} < 9",
"title": "What do you like about our product?"
},
{
"type": "comment",
"name": "disappointed_experience",
"visible": false,
"visibleIf": "{nps_score} notempty",
"title": "What do you miss or find disappointing in your experience with our products?"
}
]
}
],
"showQuestionNumbers": "off"
});
}
7 changes: 5 additions & 2 deletions packages/survey-creator-angular/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/angular-ui",
"baseUrl": ".",
"baseUrl": "./",
"skipLibCheck": true,
"paths": {
"survey-creator-angular": [
"./build",
"./build/survey-creator-angular"
],
"survey-core": [
"./node_modules/survey-core"
]
}
},
Expand Down
21 changes: 20 additions & 1 deletion packages/survey-creator-angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,27 @@
"es2020",
"dom"
],
"types": []
"types": [],
"paths": {
"survey-core": [
"./node_modules/survey-core"
],
"survey-creator-core": [
"./node_modules/survey-creator-core"
]
}
},
"exclude": [
"node_modules",
"build",
"stories",
"examples",
".storybook",
"**/node_modules",
"**/tests",
"**/*.spec.ts",
"**/*.test.ts"
],
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
Expand Down

0 comments on commit 0f48416

Please sign in to comment.