Skip to content

Commit

Permalink
Dev add stromae v3 (#714)
Browse files Browse the repository at this point in the history
* add link to Stromae V3

* Update visualize-dropdown.spec.js.snap

* update version

---------

Co-authored-by: Laurent Caouissin <[email protected]>
  • Loading branch information
BulotF and laurentC35 authored Jan 10, 2024
1 parent 3537517 commit a78a494
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pogues",
"version": "1.5.5-rc5",
"version": "1.5.5-rc6",
"description": "Outil de conception et de test de questionnaires.",
"repository": {
"type": "git",
Expand Down
3 changes: 3 additions & 0 deletions src/actions/app-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
visualizeQueenCapi,
visualizeQueenCati,
visualizeWebStromaeV2,
visualizeWebStromaeV3,
} from 'utils/remote-api';
import { addVisualizationError } from './errors';
import { TCM } from 'constants/pogues-constants';
Expand Down Expand Up @@ -399,6 +400,8 @@ export const visualizeActiveQuestionnaire = (type, componentId, token) => {
return visualizeHtml;
} else if (type === 'stromae-v2') {
return visualizeWebStromaeV2;
} else if (type === 'stromae-v3') {
return visualizeWebStromaeV3;
} else if (type === 'queen-capi') {
return visualizeQueenCapi;
} else if (type === 'queen-cati') {
Expand Down
4 changes: 4 additions & 0 deletions src/constants/dictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,10 @@ const dictionary = {
fr: 'Web V2',
en: 'Web V2',
},
VISUALIZE_WEB_STROMAE_V3: {
fr: 'Web V3',
en: 'Web V3',
},
VISUALIZE_QUEEN_CAPI: {
fr: 'Enquêteur face à face',
en: 'Interviewer face to face',
Expand Down
14 changes: 11 additions & 3 deletions src/scss/inc/_generic-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,20 @@
justify-content: space-around;
}

.flex-column{
.flex-column {
display: flex;
flex-direction: column;
}

.flex-column-reverse{
.flex-column-reverse {
display: flex;
flex-direction: column-reverse;
}
}

.link-tag {
color: green;
border: solid green 0.5px;
border-radius: 10%;
padding: 1px;
margin-left: 5px;
}
14 changes: 14 additions & 0 deletions src/utils/remote-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@ export const visualizeWebStromaeV2 = async (qr, ref, token) => {
);
};

/**
* This method will send a request in order to get the URL
* of the generated Stromae v2 page for the active questionnaire.
* @param {*} qr The active questionnaire
*/
export const visualizeWebStromaeV3 = async (qr, ref, token) => {
await getVizualisationUrl(
`${pathVisualisation}-stromae-v3/${qr.Name}`,
qr,
ref,
token,
);
};

/**
* This method will call the back in order to get a documpent for
* the visualization of the questionnaire in DDI, PDF and ODT (Spec)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ exports[`Visualize Dropdown Component: Should disable the button 1`] = `
Web V2
</a>
</li>
<li>
<a
href="#"
onClick={[Function]}
>
Web V3
<span
className="link-tag"
>
<i>
beta
</i>
</span>
</a>
</li>
<li>
<a
href="#"
Expand Down Expand Up @@ -118,6 +133,21 @@ exports[`Visualize Dropdown Component: Should display the dropdown on top 1`] =
Web V2
</a>
</li>
<li>
<a
href="#"
onClick={[Function]}
>
Web V3
<span
className="link-tag"
>
<i>
beta
</i>
</span>
</a>
</li>
<li>
<a
href="#"
Expand Down Expand Up @@ -199,6 +229,21 @@ exports[`Visualize Dropdown Component: Should return the right HTML 1`] = `
Web V2
</a>
</li>
<li>
<a
href="#"
onClick={[Function]}
>
Web V3
<span
className="link-tag"
>
<i>
beta
</i>
</span>
</a>
</li>
<li>
<a
href="#"
Expand Down
10 changes: 10 additions & 0 deletions src/widgets/visualize-dropdown/components/visualize-dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ function VisualizeDropdown({
actionType: 'stromae-v2',
actionLabel: Dictionary.VISUALIZE_WEB_STROMAE_V2,
},
{
actionType: 'stromae-v3',
actionLabel: Dictionary.VISUALIZE_WEB_STROMAE_V3,
tag: 'beta',
},
{ actionType: 'queen-capi', actionLabel: Dictionary.VISUALIZE_QUEEN_CAPI },
{ actionType: 'queen-cati', actionLabel: Dictionary.VISUALIZE_QUEEN_CATI },
{ actionType: 'pdf', actionLabel: Dictionary.VISUALIZE_PDF },
Expand Down Expand Up @@ -127,6 +132,11 @@ function VisualizeDropdown({
<li key={link.actionLabel}>
<a href="#" onClick={e => visualize(e, link.actionType)}>
{link.actionLabel}
{link.tag && (
<span className="link-tag">
<i>{link.tag}</i>
</span>
)}
</a>
</li>
);
Expand Down

0 comments on commit a78a494

Please sign in to comment.