Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce survey-js-ui package #8573

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -953,18 +953,18 @@ jobs:

- script: |
cd $(Build.SourcesDirectory)/survey-library
npm run build_ui
displayName: "Build survey-ui"
npm run build_js_ui
displayName: "Build survey-js-ui"

- script: |
cd $(Build.SourcesDirectory)/survey-library
npm run testcafe:survey-ui:ci
npm run testcafe:survey-js-ui:ci
displayName: "run functional tests"

- task: CopyFiles@2
inputs:
SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-ui"
TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-ui"
SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-js-ui"
TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-js-ui"

- task: PublishBuildArtifacts@1
inputs:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "survey-ui",
"version": "1.8.33",
"name": "survey-js-ui",
"version": "1.11.7",
"description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
"keywords": [
"Survey",
Expand All @@ -15,14 +15,13 @@
"files": [
"**/*"
],
"main": "survey-ui.js",
"main": "survey-js-ui.js",
"repository": {
"type": "git",
"url": "https://github.com/surveyjs/surveyjs.git"
},
"typings": "survey-ui.d.ts",
"dependencies": {
},
"typings": "survey-js-ui.d.ts",
"dependencies": {},
"peerDependencies": {
"survey-core": "*"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"skipLibCheck": true
},
"include": [
"../../src/entries/ui.ts",
"../../src/entries/js-ui.ts",
"../../src/entries/react-ui-model.ts"
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ const config = {
},
plugins: [
new DtsGeneratorPlugin({
tsConfigPath: "./build-scripts/survey-ui/tsconfig.typing.ui.json",
filePath: "build/survey-ui/survey-ui.d.ts",
moduleName: "survey-ui",
importName: "entries/ui"
tsConfigPath: "./build-scripts/survey-js-ui/tsconfig.typing.ui.json",
filePath: "build/survey-js-ui/survey-js-ui.d.ts",
moduleName: "survey-js-ui",
importName: "entries/js-ui"
}),
],
};

module.exports = function (options) {
options.platform = "ui";
options.platform = "js-ui";
options.libraryName = "SurveyUI";
return merge(webpackCommonConfigCreator(options, packageJson, "survey-ui"), config);
return merge(webpackCommonConfigCreator(options, packageJson, "survey-js-ui"), config);
}
6 changes: 3 additions & 3 deletions devops-pull-requests-parallel-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,9 @@ jobs:
displayName: "Build Core"

- script: |
npm run build_ui_prod
displayName: "Build survey-ui"
npm run build_js_ui_prod
displayName: "Build survey-js-ui"

- script: |
npm run testcafe:survey-ui:ci
npm run testcafe:survey-js-ui:ci
displayName: "run functional tests"
6 changes: 3 additions & 3 deletions devops-visual-regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,11 @@ jobs:
displayName: "Build Core"

- script: |
npm run build_ui_prod
displayName: "Build survey-ui"
npm run build_js_ui_prod
displayName: "Build survey-js-ui"

- script: |
npm run vrt:survey-ui:ci
npm run vrt:survey-js-ui:ci
displayName: "Visual Regression Tests"

- task: CopyFiles@2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- <link rel="stylesheet" href="../../build/survey-core/modern.css" /> -->
<link rel="stylesheet" href="../../build/survey-core/defaultV2.css" />
<script src="../../build/survey-core/survey.core.js"></script>
<script src="../../build/survey-ui/survey-ui.js"></script>
<script src="../../build/survey-js-ui/survey-js-ui.js"></script>
</head>

<body>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script src="../../build/survey-core/survey.core.min.js"></script>
<script src="../../build/survey-core/i18n/index.min.js"></script>
<script src="../../build/survey-core/plugins/bootstrap-integration.min.js"></script>
<script src="../../build/survey-ui/survey-ui.min.js"></script>
<script src="../../build/survey-js-ui/survey-js-ui.min.js"></script>
</head>
<body>
<div id="surveyElement"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<script src="../../build/survey-core/survey.core.min.js"></script>
<script src="../../build/survey-core/i18n/index.min.js"></script>
<script src="../../build/survey-ui/survey-ui.min.js"></script>
<script src="../../build/survey-js-ui/survey-js-ui.min.js"></script>

<!-- <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css"> -->
<!-- custom widgets -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script src="../../build/survey-core/survey.core.min.js"></script>
<script src="../../build/survey-core/i18n/index.min.js"></script>
<script src="../../build/survey-core/plugins/bootstrap-integration.js"></script>
<script src="../../build/survey-ui/survey-ui.min.js"></script>
<script src="../../build/survey-js-ui/survey-js-ui.min.js"></script>
<script src="./index.js"></script>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<script src="../../build/survey-core/survey.core.min.js"></script>
<script src="../../build/survey-core/i18n/index.min.js"></script>
<script src="../../build/survey-ui/survey-ui.min.js"></script>
<script src="../../build/survey-js-ui/survey-js-ui.min.js"></script>
</head>
<body>
<div id="surveyElement"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<script src="../../build/survey-core/survey.core.min.js"></script>
<script src="../../build/survey-core/i18n/index.min.js"></script>
<script src="../../build/survey-ui/survey-ui.min.js"></script>
<script src="../../build/survey-js-ui/survey-js-ui.min.js"></script>
</head>
<body>
<div id="surveyElement"></div>
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"testcafe:ko": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=knockout",
"testcafe:jquery-ui": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome testCafe/ --app \"http-server --silent\" --env=jquery-ui",
"testcafe:jquery-ui:ci": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=jquery-ui",
"testcafe:survey-ui": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome testCafe/ --app \"http-server --silent\" --env=survey-ui",
"testcafe:survey-ui:ci": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=survey-ui",
"testcafe:survey-js-ui": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome testCafe/ --app \"http-server --silent\" --env=survey-js-ui",
"testcafe:survey-js-ui:ci": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=survey-js-ui",
"vrt:jquery-ui:ci": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=jquery-ui",
"vrt:survey-ui:ci": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=survey-ui",
"vrt:survey-js-ui:ci": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=survey-js-ui",
"testcafe:react": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=react",
"testcafe:vue": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=vue",
"release": "commit-and-tag-version --message \"Release: %s [azurepipelines skip]\" ",
Expand All @@ -30,8 +30,8 @@
"build_jquery_prod": "webpack --config ./build-scripts/survey-jquery/webpack.config.js --env.buildType prod && webpack --config ./build-scripts/survey-jquery/webpack.themes.config.js --env.buildType prod",
"build_jquery_ui_dev": "webpack --config ./build-scripts/survey-jquery-ui/webpack.config.js --env.buildType dev",
"build_jquery_ui_prod": "webpack --config ./build-scripts/survey-jquery-ui/webpack.config.js --env.buildType prod",
"build_ui_dev": "webpack --config ./build-scripts/survey-ui/webpack.config.js --env.buildType dev",
"build_ui_prod": "webpack --config ./build-scripts/survey-ui/webpack.config.js --env.buildType prod",
"build_js_ui_dev": "webpack --config ./build-scripts/survey-js-ui/webpack.config.js --env.buildType dev",
"build_js_ui_prod": "webpack --config ./build-scripts/survey-js-ui/webpack.config.js --env.buildType prod",
"build_angular_dev": "webpack --config ./build-scripts/survey-angular/webpack.config.js --env.buildType dev",
"build_angular_prod": "webpack --config ./build-scripts/survey-angular/webpack.config.js --env.buildType prod",
"build_i18n_dev": "webpack --config ./build-scripts/survey-core/webpack.i18n.js --env.buildType dev",
Expand Down Expand Up @@ -64,7 +64,7 @@
"build_i18n": "npm run build_i18n_dev && npm run build_i18n_prod",
"build_jquery": "npm run build_jquery_dev && npm run build_jquery_prod",
"build_jquery_ui": "npm run build_jquery_ui_dev && npm run build_jquery_ui_prod",
"build_ui": "npm run build_ui_dev && npm run build_ui_prod",
"build_js_ui": "npm run build_js_ui_dev && npm run build_js_ui_prod",
"build_angular": "npm run build_angular_dev && npm run build_angular_prod && rimraf build/survey-angular/ts3.4 && downlevel-dts build/survey-angular build/survey-angular/ts3.4",
"watch:core:dev": "webpack --config ./build-scripts/survey-core/webpack.config.js --env.buildType dev --watch",
"watch:core:prod": "webpack --config ./build-scripts/survey-core/webpack.config.js --env.buildType prod --watch",
Expand Down Expand Up @@ -228,4 +228,4 @@
"signature_pad": "^4.1.5",
"vite": "^3.1.8"
}
}
}
4 changes: 2 additions & 2 deletions src/entries/ui.ts → src/entries/js-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (!!jQuery) {
});
}

SurveyModel.platform = "ui";
SurveyModel.platform = "js-ui";
SurveyModel.prototype["render"] = function (element: any = null) {
if (this.renderCallback) {
this.renderCallback();
Expand All @@ -53,4 +53,4 @@ export { SurveyModel as Model } from "survey-core";

import { checkLibraryVersion } from "survey-core";

checkLibraryVersion(`${process.env.VERSION}`, "survey-ui");
checkLibraryVersion(`${process.env.VERSION}`, "survey-js-ui");
10 changes: 5 additions & 5 deletions testCafe/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const initSurvey = ClientFunction(
window["$"]("#surveyElement").Survey({
model: model
});
} else if (framework === "survey-ui") {
} else if (framework === "survey-js-ui") {
document.getElementById("surveyElement").innerHTML = "";
SurveyUI.renderSurvey(model, document.getElementById("surveyElement"));
} else if (framework === "react") {
Expand Down Expand Up @@ -120,7 +120,7 @@ export const initSurveyPopup = ClientFunction(
allowClose: true,
allowFullScreen: true
});
} else if (framework === "survey-ui") {
} else if (framework === "survey-js-ui") {
document.getElementById("surveyElement").innerHTML = "";
SurveyUI.renderPopupSurvey(model, document.getElementById("surveyElement"), {
isExpanded: true,
Expand Down Expand Up @@ -190,7 +190,7 @@ export const registerCustomToolboxComponent = ClientFunction(
return window["React"].createElement(CustomActionButton, props);
}
);
} else if (framework === "jquery-ui" || framework === "survey-ui") {
} else if (framework === "jquery-ui" || framework === "survey-js-ui") {
const preact = (window["SurveyJquery"] || window["SurveyUI"])["preact"];
window.React = { createElement: preact.createElement };

Expand Down Expand Up @@ -277,7 +277,7 @@ export const registerCustomItemComponent = ClientFunction(
return window["React"].createElement(ItemTemplateComponent, props);
}
);
} else if (framework === "jquery-ui" || framework === "survey-ui") {
} else if (framework === "jquery-ui" || framework === "survey-js-ui") {
const preact = (window["SurveyJquery"] || window["SurveyUI"])["preact"];
window.React = { createElement: preact.createElement };
class ItemTemplateComponent extends preact.Component {
Expand Down Expand Up @@ -397,7 +397,7 @@ export const registerCustomItemContentComponent = ClientFunction(
return preact.createElement(ItemContentTemplateComponent, props);
}
);
} else if (framework === "survey-ui") {
} else if (framework === "survey-js-ui") {
const preact = window["SurveyUI"]["preact"];
window.React = { createElement: preact.createElement };
class ItemContentTemplateComponent extends preact.Component {
Expand Down
2 changes: 1 addition & 1 deletion testCafe/survey/customCss.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const initSurvey = ClientFunction((framework, json) => {
window["$"]("#surveyElement").Survey({
model: model
});
} else if (framework === "survey-ui") {
} else if (framework === "survey-js-ui") {
model.css = myCss;
document.getElementById("surveyElement").innerHTML = "";
window["SurveyUI"].renderSurvey(model, document.getElementById("surveyElement"));
Expand Down
2 changes: 1 addition & 1 deletion testCafe/survey/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const initPopupSurvey = ClientFunction(
window["$"]("#surveyElement").PopupSurvey({
model: model
});
} else if (framework === "survey-ui") {
} else if (framework === "survey-js-ui") {
document.getElementById("surveyElement").innerHTML = "";
window["SurveyUI"].renderPopupSurvey(model, document.getElementById("surveyElement"));
}
Expand Down
6 changes: 3 additions & 3 deletions visual-regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,11 @@ jobs:
displayName: "Build Core"

- script: |
npm run build_ui_prod
displayName: "Build survey-ui"
npm run build_js_ui_prod
displayName: "Build survey-js-ui"

- script: |
npm run vrt:survey-ui:ci
npm run vrt:survey-js-ui:ci
displayName: "Visual Regression Tests"

- task: CopyFiles@2
Expand Down
2 changes: 1 addition & 1 deletion visualRegressionTests/tests/defaultV2/buttongroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const registerButtongroup = ClientFunction((framework) => {
return preact.createElement(SurveyJquery.SurveyQuestionButtonGroup, props);
});
}
if (framework === "survey-ui") {
if (framework === "survey-js-ui") {
const SurveyUI = (<any>window).SurveyUI;
const preact = SurveyUI["preact"];
SurveyUI.ReactQuestionFactory.Instance.registerQuestion("buttongroup", props => {
Expand Down