Skip to content

Commit

Permalink
Merge branch 'master' into feature/7827-interchange-switch-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
tsv2013 committed Feb 9, 2024
2 parents 6656061 + 69b2346 commit 4ad2ada
Show file tree
Hide file tree
Showing 16 changed files with 167 additions and 55 deletions.
10 changes: 5 additions & 5 deletions src/localization/english.ts
Expand Up @@ -57,7 +57,7 @@ export var englishStrings = {
chooseFile: "Choose file(s)...",
noFileChosen: "No file chosen",
filePlaceholder: "Drag and drop a file here or click the button below to select a file to upload.",
confirmDelete: "Do you want to delete the record?",
confirmDelete: "Are you sure you want to delete this record?",
keyDuplicationError: "This value should be unique.",
addColumn: "Add Column",
addRow: "Add Row",
Expand Down Expand Up @@ -101,12 +101,12 @@ export var englishStrings = {
modalApplyButtonText: "Apply",
filterStringPlaceholder: "Type to search...",
emptyMessage: "No data to display",
noEntriesText: "There are no entries yet.\nClick the button below to add a new entry.",
noEntriesReadonlyText: "There are no entries.",
noEntriesText: "No entries yet.\nClick the button below to add a new entry.",
noEntriesReadonlyText: "No entries.",
more: "More",
tagboxDoneButtonCaption: "OK",
selectToRankEmptyRankedAreaText: "All choices are ranked",
selectToRankEmptyUnrankedAreaText: "Drag and drop choices here to rank them",
selectToRankEmptyRankedAreaText: "All choices are selected for ranking",
selectToRankEmptyUnrankedAreaText: "Drag choices here to rank them",
ok: "OK",
cancel: "Cancel",
};
Expand Down
2 changes: 1 addition & 1 deletion src/panel.ts
Expand Up @@ -2039,7 +2039,7 @@ Serializer.addClass(
{ name: "minWidth", defaultFunc: () => "auto" },
{ name: "maxWidth", defaultFunc: () => settings.maxWidth },
{ name: "innerIndent:number", default: 0, choices: [0, 1, 2, 3] },
{ name: "indent:number", default: 0, choices: [0, 1, 2, 3] },
{ name: "indent:number", default: 0, choices: [0, 1, 2, 3], visible: false },
{
name: "page",
isSerializable: false,
Expand Down
9 changes: 4 additions & 5 deletions src/question_file.ts
Expand Up @@ -921,9 +921,8 @@ export class QuestionFileModel extends QuestionFileModelBase {
super.updateElementCss(reNew);
this.updateCurrentMode();
}

endLoadingFromJson(): void {
super.endLoadingFromJson();
public onSurveyLoad(): void {
super.onSurveyLoad();
this.updateCurrentMode();
this.updateActionsVisibility();
this.loadPreview(this.value);
Expand Down Expand Up @@ -1018,8 +1017,8 @@ export class QuestionFileModel extends QuestionFileModelBase {
}
}
doChange = (event: any) => {
// var src = event.target || event.srcElement;
// this.onChange(src);
var src = event.target || event.srcElement;
this.onChange(src);
}
doClean = () => {
if (this.needConfirmRemoveFile) {
Expand Down
37 changes: 30 additions & 7 deletions src/question_paneldynamic.ts
Expand Up @@ -2130,7 +2130,7 @@ export class QuestionPanelDynamicModel extends Question
.toString();
}
/**
* A text displayed when Dynamic Panel contains no entries. Applies only in the Default V2 theme.
* A text displayed when Dynamic Panel contains no entries.
*/
public get noEntriesText(): string {
return this.getLocalizableStringText("noEntriesText");
Expand Down Expand Up @@ -2372,6 +2372,7 @@ Serializer.addClass(
name: "panelsState",
default: "default",
choices: ["default", "collapsed", "expanded", "firstExpanded"],
visibleIf: (obj: any) => { return obj.renderMode === "list"; }
},
{ name: "keyName" },
{
Expand All @@ -2382,24 +2383,45 @@ Serializer.addClass(
{
name: "confirmDeleteText",
serializationProperty: "locConfirmDeleteText",
visibleIf: (obj: any) => { return obj.confirmDelete; }
},
{
name: "panelAddText",
serializationProperty: "locPanelAddText",
visibleIf: (obj: any) => { return obj.allowAddPanel; }
},
{
name: "panelRemoveText",
serializationProperty: "locPanelRemoveText",
visibleIf: (obj: any) => { return obj.allowRemovePanel; }
},
{
name: "panelPrevText",
serializationProperty: "locPanelPrevText",
visibleIf: (obj: any) => { return obj.renderMode !== "list"; }
},
{
name: "panelNextText",
serializationProperty: "locPanelNextText",
visibleIf: (obj: any) => { return obj.renderMode !== "list"; }
},
{ name: "panelAddText", serializationProperty: "locPanelAddText" },
{ name: "panelRemoveText", serializationProperty: "locPanelRemoveText" },
{ name: "panelPrevText", serializationProperty: "locPanelPrevText" },
{ name: "panelNextText", serializationProperty: "locPanelNextText" },
{
name: "showQuestionNumbers",
default: "off",
choices: ["off", "onPanel", "onSurvey"],
},
{ name: "showRangeInProgress:boolean", default: true },
{
name: "showRangeInProgress:boolean",
default: true,
visibleIf: (obj: any) => { return obj.renderMode !== "list"; }
},
{
name: "renderMode",
default: "list",
choices: ["list", "progressTop", "progressBottom", "progressTopBottom", "tab"],
},
{
name: "tabAlign", default: "center", choices: ["center", "left", "right"],
name: "tabAlign", default: "center", choices: ["left", "center", "right"],
visibleIf: (obj: any) => { return obj.renderMode === "tab"; }
},
{
Expand All @@ -2416,6 +2438,7 @@ Serializer.addClass(
name: "panelRemoveButtonLocation",
default: "bottom",
choices: ["bottom", "right"],
visibleIf: (obj: any) => { return obj.allowRemovePanel; }
},
],
function () {
Expand Down
28 changes: 14 additions & 14 deletions src/question_rating.ts
Expand Up @@ -886,7 +886,7 @@ Serializer.addClass(
default: "labels",
category: "rateValues",
choices: ["labels", "stars", "smileys"],
visibleIndex: 0
visibleIndex: 1
},
{
name: "scaleColorMode",
Expand All @@ -896,7 +896,7 @@ Serializer.addClass(
visibleIf: function (obj: any) {
return obj.rateDisplayMode == "smileys";
},
visibleIndex: 1
visibleIndex: 2
},
{
name: "rateColorMode",
Expand All @@ -906,20 +906,20 @@ Serializer.addClass(
visibleIf: function (obj: any) {
return obj.rateDisplayMode == "smileys" && obj.scaleColorMode == "monochrome";
},
visibleIndex: 2
visibleIndex: 3
},
{
name: "autoGenerate",
category: "rateValues",
default: true,
choices: [true, false],
visibleIndex: 4
visibleIndex: 5
},
{
name: "rateCount:number",
default: 5,
category: "rateValues",
visibleIndex: 3,
visibleIndex: 4,
onSettingValue: (obj: any, val: any): any => {
if (val < 2) return 2;
if (val > settings.ratingMaximumRateValueCount && val > obj.rateValues.length) return settings.ratingMaximumRateValueCount;
Expand All @@ -936,7 +936,7 @@ Serializer.addClass(
visibleIf: function (obj: any) {
return !obj.autoGenerate;
},
visibleIndex: 5
visibleIndex: 6
},
{
name: "rateMin:number", default: 1,
Expand All @@ -946,7 +946,7 @@ Serializer.addClass(
visibleIf: function (obj: any) {
return !!obj.autoGenerate;
},
visibleIndex: 6
visibleIndex: 7
},
{
name: "rateMax:number", default: 5,
Expand All @@ -956,7 +956,7 @@ Serializer.addClass(
visibleIf: function (obj: any) {
return !!obj.autoGenerate;
},
visibleIndex: 7
visibleIndex: 8
},
{
name: "rateStep:number", default: 1, minValue: 0.1,
Expand All @@ -969,39 +969,39 @@ Serializer.addClass(
visibleIf: function (obj: any) {
return !!obj.autoGenerate;
},
visibleIndex: 8
visibleIndex: 9
},
{
name: "minRateDescription",
alternativeName: "mininumRateDescription",
serializationProperty: "locMinRateDescription",
visibleIndex: 17
visibleIndex: 18
},
{
name: "maxRateDescription",
alternativeName: "maximumRateDescription",
serializationProperty: "locMaxRateDescription",
visibleIndex: 18
visibleIndex: 19
},
{
name: "displayRateDescriptionsAsExtremeItems:boolean",
default: false,
visibleIndex: 19,
visibleIndex: 21,
visibleIf: function (obj: any) {
return obj.rateType == "labels";
}
},
{
name: "rateDescriptionLocation",
default: "leftRight",
category: "layout",
choices: ["leftRight", "top", "bottom", "topBottom"],
visibleIndex: 20
},
{
name: "displayMode",
default: "auto",
choices: ["auto", "buttons", "dropdown"],
visibleIndex: 20
visibleIndex: 0
},
{ name: "itemComponent", visible: false,
defaultFunc: (obj: any): any => {
Expand Down
60 changes: 49 additions & 11 deletions src/survey.ts
Expand Up @@ -7757,7 +7757,11 @@ Serializer.addClass("survey", [
default: "bottom",
choices: ["none", "top", "bottom", "both"],
},
{ name: "showPrevButton:boolean", default: true },
{
name: "showPrevButton:boolean",
default: true,
visibleIf: (obj: any) => { return obj.showNavigationButtons !== "none"; }
},
{ name: "showTitle:boolean", default: true },
{ name: "showPageTitles:boolean", default: true },
{ name: "showCompletedPage:boolean", default: true },
Expand Down Expand Up @@ -7808,9 +7812,19 @@ Serializer.addClass("survey", [
"requiredQuestions",
"correctQuestions",
],
visibleIf: (obj: any) => { return obj.showProgressBar !== "off"; }
},
{
name: "progressBarShowPageTitles:switch",
category: "navigation",
visibleIf: (obj: any) => { return obj.showProgressBar !== "off" && obj.progressBarType === "pages"; }
},
{
name: "progressBarShowPageNumbers:switch",
default: false,
category: "navigation",
visibleIf: (obj: any) => { return obj.showProgressBar !== "off" && obj.progressBarType === "pages"; }
},
{ name: "progressBarShowPageTitles:switch", category: "navigation" },
{ name: "progressBarShowPageNumbers:switch", default: false, category: "navigation" },
{
name: "showTOC:switch",
default: false
Expand Down Expand Up @@ -7850,12 +7864,36 @@ Serializer.addClass("survey", [
},
{ name: "autoGrowComment:boolean", default: false },
{ name: "allowResizeComment:boolean", default: true },
{ name: "startSurveyText", serializationProperty: "locStartSurveyText" },
{ name: "pagePrevText", serializationProperty: "locPagePrevText" },
{ name: "pageNextText", serializationProperty: "locPageNextText" },
{ name: "completeText", serializationProperty: "locCompleteText" },
{ name: "previewText", serializationProperty: "locPreviewText" },
{ name: "editText", serializationProperty: "locEditText" },
{
name: "startSurveyText",
serializationProperty: "locStartSurveyText",
visibleIf: (obj: any) => { return obj.firstPageIsStarted; }
},
{
name: "pagePrevText",
serializationProperty: "locPagePrevText",
visibleIf: (obj: any) => { return obj.showNavigationButtons !== "none" && obj.showPrevButton; }
},
{
name: "pageNextText",
serializationProperty: "locPageNextText",
visibleIf: (obj: any) => { return obj.showNavigationButtons !== "none"; }
},
{
name: "completeText",
serializationProperty: "locCompleteText",
visibleIf: (obj: any) => { return obj.showNavigationButtons !== "none"; }
},
{
name: "previewText",
serializationProperty: "locPreviewText",
visibleIf: (obj: any) => { return obj.showPreviewBeforeComplete !== "noPreview"; }
},
{
name: "editText",
serializationProperty: "locEditText",
visibleIf: (obj: any) => { return obj.showPreviewBeforeComplete !== "noPreview"; }
},
{ name: "requiredText", default: "*" },
{
name: "questionStartIndex",
Expand Down Expand Up @@ -7887,7 +7925,7 @@ Serializer.addClass("survey", [
{
name: "questionsOnPageMode",
default: "standard",
choices: ["singlePage", "standard", "questionPerPage"],
choices: ["standard", "singlePage", "questionPerPage"],
},
{
name: "showPreviewBeforeComplete",
Expand All @@ -7904,7 +7942,7 @@ Serializer.addClass("survey", [
{
name: "showTimerPanelMode",
default: "all",
choices: ["all", "page", "survey"],
choices: ["page", "survey", "all"],
},
{
name: "widthMode",
Expand Down
Expand Up @@ -86,7 +86,7 @@
</div>
<div class="sv-ranking__container sv-ranking__container--empty sv-ranking__container--to" data-ranking="to-container">
<div class="sv-ranking__container-placeholder">
<span class="sv-string-viewer">Drag and drop choices here to rank them</span>
<span class="sv-string-viewer">Drag choices here to rank them</span>
</div>
</div>
</div>
Expand Up @@ -86,7 +86,7 @@
</div>
<div class="sv-ranking__container sv-ranking__container--empty sv-ranking__container--to" data-ranking="to-container">
<div class="sv-ranking__container-placeholder">
<span class="sv-string-viewer">Drag and drop choices here to rank them</span>
<span class="sv-string-viewer">Drag choices here to rank them</span>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions tests/questionFileTests.ts
Expand Up @@ -1129,7 +1129,7 @@ QUnit.test("QuestionFile remove file by preview value", function (assert) {
});
});

QUnit.test("QuestionFile download file content on preview", function (assert) {
QUnit.test("QuestionFile download file content on preview, #1", function (assert) {
var json = {
showPreviewBeforeComplete: "showAnsweredQuestions",
elements: [
Expand Down Expand Up @@ -1386,7 +1386,7 @@ QUnit.test("Check file question processResponsiveness method", (assert) => {
assert.equal(question.pageSize, 4);
});

QUnit.test("QuestionFile download file content on preview", function (assert) {
QUnit.test("QuestionFile download file content on preview, #2", function (assert) {
const survey = new SurveyModel({
elements: [
{ type: "file", name: "q1" },
Expand Down

0 comments on commit 4ad2ada

Please sign in to comment.