Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
simcaq-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
simcaq-node
Commits
a9ba081e
There was a problem fetching the pipeline summary.
Commit
a9ba081e
authored
7 years ago
by
Fernando Erd
Browse files
Options
Downloads
Patches
Plain Diff
Fix Filter IDHM level
parent
ffe07fd0
No related branches found
No related tags found
2 merge requests
!116
Release v1.0.0
,
!66
Fix Filter IDHM level
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/libs/convert/idhmLevel.js
+16
-0
16 additions, 0 deletions
src/libs/convert/idhmLevel.js
src/libs/middlewares/id2str.js
+3
-1
3 additions, 1 deletion
src/libs/middlewares/id2str.js
src/libs/routes/idhm.js
+3
-3
3 additions, 3 deletions
src/libs/routes/idhm.js
with
22 additions
and
4 deletions
src/libs/convert/idhmLevel.js
0 → 100644
+
16
−
0
View file @
a9ba081e
module
.
exports
=
function
idhmLevel
(
id
)
{
switch
(
id
)
{
case
1
:
return
'
Muito Baixa
'
;
case
2
:
return
'
Baixo
'
;
case
3
:
return
'
Médio
'
;
case
4
:
return
'
Alto
'
;
case
5
:
return
'
Muito Alto
'
;
default
:
return
'
Não classificado
'
;
}
};
This diff is collapsed.
Click to expand it.
src/libs/middlewares/id2str.js
+
3
−
1
View file @
a9ba081e
...
@@ -14,6 +14,7 @@ const educationLevelShort = require(`${libs}/convert/educationLevelShort`);
...
@@ -14,6 +14,7 @@ const educationLevelShort = require(`${libs}/convert/educationLevelShort`);
const
educationType
=
require
(
`
${
libs
}
/convert/educationType`
);
const
educationType
=
require
(
`
${
libs
}
/convert/educationType`
);
const
citySize
=
require
(
`
${
libs
}
/convert/citySize`
);
const
citySize
=
require
(
`
${
libs
}
/convert/citySize`
);
const
incomeLevel
=
require
(
`
${
libs
}
/convert/incomeLevel`
);
const
incomeLevel
=
require
(
`
${
libs
}
/convert/incomeLevel`
);
const
idhmLevel
=
require
(
`
${
libs
}
/convert/idhmLevel`
);
const
ids
=
{
const
ids
=
{
gender_id
:
gender
,
gender_id
:
gender
,
...
@@ -60,7 +61,8 @@ const ids = {
...
@@ -60,7 +61,8 @@ const ids = {
water_id
:
booleanVariable
,
water_id
:
booleanVariable
,
education_type_id
:
educationType
,
education_type_id
:
educationType
,
income_level_id
:
incomeLevel
,
income_level_id
:
incomeLevel
,
city_size_id
:
citySize
city_size_id
:
citySize
,
idhm_level_id
:
idhmLevel
};
};
function
transform
(
removeId
=
false
)
{
function
transform
(
removeId
=
false
)
{
...
...
This diff is collapsed.
Click to expand it.
src/libs/routes/idhm.js
+
3
−
3
View file @
a9ba081e
...
@@ -116,10 +116,10 @@ rqf.addField({
...
@@ -116,10 +116,10 @@ rqf.addField({
field
:
'
ano_censo
'
field
:
'
ano_censo
'
}
}
}).
addValue
({
}).
addValue
({
name
:
'
IDHM
_level
'
,
name
:
'
idhm
_level
'
,
table
:
'
@
'
,
table
:
'
@
'
,
tableField
:
'
idhm_nivel
'
,
tableField
:
'
idhm_nivel
'
,
resultField
:
'
idhm_
ni
vel_id
'
,
resultField
:
'
idhm_
le
vel_id
'
,
where
:
{
where
:
{
relation
:
'
=
'
,
relation
:
'
=
'
,
type
:
'
integer
'
,
type
:
'
integer
'
,
...
@@ -163,6 +163,6 @@ idhmApp.get('/', rqf.parse(), (req, res, next) => {
...
@@ -163,6 +163,6 @@ idhmApp.get('/', rqf.parse(), (req, res, next) => {
});
});
}
}
next
();
next
();
},
rqf
.
build
(),
query
,
response
(
'
idhm
'
));
},
rqf
.
build
(),
query
,
id2str
.
transform
(),
response
(
'
idhm
'
));
module
.
exports
=
idhmApp
;
module
.
exports
=
idhmApp
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment