Skip to content

Commit

Permalink
Merge branch '1.5.5' into dev-add-Stromae-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentC35 authored Jan 10, 2024
2 parents c2238bc + 3537517 commit 9f8aa9a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 37 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-rc4",
"version": "1.5.5-rc6",
"description": "Outil de conception et de test de questionnaires.",
"repository": {
"type": "git",
Expand Down
6 changes: 5 additions & 1 deletion src/layout/header/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom';
import logo from 'layout/header/logo-insee.png';
import UserConnectionContainer from 'layout/user/user-connection-container';
import Dictionary from 'utils/dictionary/dictionary';
import { poguesFrontVersion } from 'utils/version';

function Header() {
return (
Expand All @@ -18,7 +19,10 @@ function Header() {
Pogues
</Link>
</h2>
<h6>{Dictionary.headerSubtitle}</h6>
<h6>
{Dictionary.headerSubtitle}
<span className="pogues-version">{poguesFrontVersion}</span>
</h6>
</div>
<div className="header-help">
<a
Expand Down
52 changes: 17 additions & 35 deletions src/model/transformations/collected-variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
} from 'constants/pogues-constants';

const { COLLECTED } = VARIABLES_TYPES;
const { QUESTION, SEQUENCE, SUBSEQUENCE, LOOP } = COMPONENT_TYPE;
const { QUESTION, SEQUENCE, SUBSEQUENCE, LOOP, EXTERNAL_ELEMENT } =
COMPONENT_TYPE;
const { TABLE, MULTIPLE_CHOICE } = QUESTION_TYPE_ENUM;
const { LIST } = DIMENSION_FORMATS;

Expand Down Expand Up @@ -185,37 +186,25 @@ function findQuestionInLoop(componentsStore) {
.forEach(component => {
let LoopQuestions = [];
if (componentsStore[component.initialMember]) {
if (componentsStore[component.initialMember].type === SEQUENCE) {
if (
componentsStore[component.initialMember].weight !==
componentsStore[component.finalMember].weight
if (
componentsStore[component.initialMember].type === SEQUENCE ||
componentsStore[component.initialMember].type === EXTERNAL_ELEMENT
) {
for (
let i = componentsStore[component.initialMember].weight;
i <= componentsStore[component.finalMember].weight;
i++
) {
for (
let i = componentsStore[component.initialMember].weight;
i <= componentsStore[component.finalMember].weight;
i++
) {
const sequence = Object.values(componentsStore).find(
element => element.type === SEQUENCE && element.weight === i,
const sequence = Object.values(componentsStore).find(
element => element.type === SEQUENCE && element.weight === i,
);
if (sequence) {
LoopQuestions = LoopQuestions.concat(
getQuestionFromSequence(componentsStore, sequence.id),
);
if (sequence) {
LoopQuestions = LoopQuestions.concat(
getQuestionFromSequence(componentsStore, sequence.id),
);
}
}
} else {
LoopQuestions = LoopQuestions.concat(
getQuestionFromSequence(
componentsStore,
componentsStore[component.initialMember].id,
),
);
}
} else if (
componentsStore[component.initialMember].weight !==
componentsStore[component.finalMember].weight
) {
} else {
for (
let i = componentsStore[component.initialMember].weight;
i <= componentsStore[component.finalMember].weight;
Expand All @@ -234,13 +223,6 @@ function findQuestionInLoop(componentsStore) {
);
}
}
} else {
LoopQuestions = LoopQuestions.concat(
getQuestionFromSubSequence(
componentsStore,
componentsStore[component.initialMember].id,
),
);
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/scss/inc/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,11 @@
.header-user {
@include make-xs-column(3);
}

.pogues-version {
margin-left: 5px;
color: $color-grey_01;
font-style: italic;
}
}
}
3 changes: 3 additions & 0 deletions src/utils/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import packageVersion from '../../package.json';

export const poguesFrontVersion = packageVersion.version;

0 comments on commit 9f8aa9a

Please sign in to comment.