-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Missing minRateDescription and maxRateDescription (#7412)
* work for #5409 Missing minRateDescription and maxRateDescription * work for #5409 Missing minRateDescription and maxRateDescription * work for #5409 Missing minRateDescription and maxRateDescription * work for #5409 Missing minRateDescription and maxRateDescription --------- Co-authored-by: LARINA-NB-W10\OlgaLarina <olga.larina.dev@gmail.com>
- Loading branch information
1 parent
5b608d0
commit 4d03ef7
Showing
19 changed files
with
215 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...ey-angular-ui/src/components/renderAs/rating-dropdown/rating-dropdown-item.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<ng-template #template> | ||
<div class="sd-rating-dropdown-item"> | ||
<span class="sd-rating-dropdown-item_text">{{model.title}}</span> | ||
<ng-container *ngIf="!!model.description"> | ||
<div class="sd-rating-dropdown-item_description"> | ||
<sv-ng-string [model]="model.description"></sv-ng-string> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</ng-template> |
20 changes: 20 additions & 0 deletions
20
...rvey-angular-ui/src/components/renderAs/rating-dropdown/rating-dropdown-item.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Component, Input } from "@angular/core"; | ||
import { BaseAngular } from "../../../base-angular"; | ||
import { AngularComponentFactory } from "../../../component-factory"; | ||
|
||
@Component({ | ||
selector: "sv-ng-rating-dropdown-item, '[sv-ng-rating-dropdown-item]'", | ||
templateUrl: "./rating-dropdown-item.component.html", | ||
styleUrls: ["../../../hide-host.scss"], | ||
}) | ||
|
||
export class RatingDropdownItemComponent extends BaseAngular { | ||
@Input() element: any; | ||
@Input() model!: any; | ||
|
||
getModel() { | ||
return this.model; | ||
} | ||
} | ||
|
||
AngularComponentFactory.Instance.registerComponent("sv-rating-dropdown-item", RatingDropdownItemComponent); |
16 changes: 16 additions & 0 deletions
16
packages/survey-vue3-ui/src/components/rating/RatingDropdownItem.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<div class="sd-rating-dropdown-item"> | ||
<span class="sd-rating-dropdown-item_text">{{ item.title }}</span> | ||
<div v-if="!!item.description" class="sd-rating-dropdown-item_description"> | ||
<survey-string :locString="item.description" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { useBase } from "@/base"; | ||
const props = defineProps<{ item: any }>(); | ||
useBase(() => props.item); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/knockout/components/rating-dropdown/rating-dropdown-item.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="sd-rating-dropdown-item"> | ||
<span class="sd-rating-dropdown-item_text" data-bind="text: item.title"></span> | ||
<!-- ko if: !!item.description --> | ||
<div class="sd-rating-dropdown-item_description"> | ||
<!-- ko template: { name: 'survey-string', data: item.description } --> | ||
<!-- /ko --> | ||
</div> | ||
<!-- /ko --> | ||
</div> |
19 changes: 19 additions & 0 deletions
19
src/knockout/components/rating-dropdown/rating-dropdown-item.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as ko from "knockout"; | ||
import { ImplementorBase } from "../../kobase"; | ||
|
||
const template = require("./rating-dropdown-item.html"); | ||
|
||
export var RatingItemViewComponent: any; | ||
|
||
ko.components.register("sv-rating-dropdown-item", { | ||
viewModel: { | ||
createViewModel: (params: any, componentInfo: any) => { | ||
new ImplementorBase(params.item); | ||
return { | ||
item: params.item, | ||
description: params.item.description | ||
}; | ||
}, | ||
}, | ||
template: template, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from "react"; | ||
import { ReactElementFactory } from "../../element-factory"; | ||
import { SurveyElementBase } from "../../reactquestion_element"; | ||
|
||
interface IRatingItemProps { | ||
item: any; | ||
} | ||
|
||
export class RatingDropdownItem extends SurveyElementBase<IRatingItemProps, any> { | ||
get item(): any { | ||
return this.props.item; | ||
} | ||
getStateElement() { | ||
return this.item; | ||
} | ||
render(): JSX.Element | null { | ||
if (!this.item) return null; | ||
const item = this.props.item; | ||
const description = this.renderDescription(item); | ||
|
||
return ( | ||
<div className="sd-rating-dropdown-item"> | ||
<span className="sd-rating-dropdown-item_text">{item.title}</span> | ||
{description} | ||
</div> | ||
); | ||
} | ||
renderDescription(item: any) { | ||
if(!item.description) return null; | ||
|
||
return ( | ||
<div className="sd-rating-dropdown-item_description"> | ||
{this.renderLocString(item.description, undefined, "locString")} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
ReactElementFactory.Instance.registerElement("sv-rating-dropdown-item", (props) => { | ||
return React.createElement(RatingDropdownItem, props); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<template> | ||
<div class="sd-rating-dropdown-item"> | ||
<span class="sd-rating-dropdown-item_text">{{ item.title }}</span> | ||
<div v-if="!!item.description" class="sd-rating-dropdown-item_description"> | ||
<survey-string :locString="item.description" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from "vue"; | ||
import { Component, Prop } from "vue-property-decorator"; | ||
import { BaseVue } from "../../base"; | ||
@Component | ||
export class RatingItem extends BaseVue { | ||
@Prop() item: any; | ||
constructor() { | ||
super(); | ||
} | ||
getModel() { | ||
return this.item; | ||
} | ||
} | ||
Vue.component("sv-rating-dropdown-item", RatingItem); | ||
export default RatingItem; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+3.61 KB
visualRegressionTests/tests/defaultV2/etalons/question-rating-dropdown-popup.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters