Skip to content

Commit

Permalink
Merge pull request #2305 from finnishtransportagency/DROTH-3196_to_Ne…
Browse files Browse the repository at this point in the history
…xtRelease

Droth 3196 to next release
  • Loading branch information
SWJPTulijoki authored Nov 15, 2022
2 parents 1574ff9 + 4ebd83c commit a28eab7
Show file tree
Hide file tree
Showing 30 changed files with 225 additions and 63 deletions.
4 changes: 2 additions & 2 deletions UI/src/less/core/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
//** Construction type colors
@construction-type-1: #cc99ff; //lilac
@construction-type-2: #ff9900; //orange
@construction-type-4: #a2a8e4; //light blue
@construction-type-4: #fcb0b1; //light red

@construction-type-node-1: #b366ff; //lilac
@construction-type-node-2: #ffc266; //orange
@construction-type-node-4: #01b; //blue
@construction-type-node-4: #ee0000; //red

//** Speed limit colors
@speed-limit-1: @linear-asset-1; //cyan
Expand Down
7 changes: 7 additions & 0 deletions UI/src/model/selectedPointAsset.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
exists: exists,
isSelected: isSelected,
getAdministrativeClass: getAdministrativeClass,
getConstructionType: getConstructionType,
checkSelectedSign: checkSelectedSign,
setPropertyByPublicId: setPropertyByPublicId,
setPropertyByGroupedIdAndPublicId: setPropertyByGroupedIdAndPublicId,
Expand Down Expand Up @@ -164,6 +165,12 @@

}

function getConstructionType(linkId){
var road = roadCollection.getRoadLinkByLinkId(linkId);
var constructionType = road ? road.getData().constructionType : null;
return _.isNull(constructionType) || _.isUndefined(constructionType) ? undefined : constructionType;
}

function getMunicipalityCodeByLinkId(linkId){
if(current && current.municipalityCode && !linkId)
return current.municipalityCode;
Expand Down
6 changes: 6 additions & 0 deletions UI/src/view/linear_asset/careClassStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
new StyleRule().where('type').is('overlay').and('linkType').isIn([8, 9, 12, 21]).and('zoomLevel').is(11).use({ stroke: {color: '#fff', lineCap: 'square', width: 2, lineDash: [1, 8] } })
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];

this.getNewFeatureProperties = function(linearAssets){
var linearAssetsWithType = _.map(linearAssets, function(linearAsset) {
var hasAsset = me.hasValue(linearAsset);
Expand Down Expand Up @@ -132,12 +136,14 @@
me.browsingStyleProvider.addRules(overlayStyleRules);
me.browsingStyleProvider.addRules(featureTypeRules);
me.browsingStyleProvider.addRules(linkTypeSizeRules);
me.browsingStyleProvider.addRules(linkStatusRules);

me.greenCareStyle = new StyleRuleProvider({ stroke : { opacity: 0.7 }});
me.greenCareStyle.addRules(greenCareClassRules);
me.greenCareStyle.addRules(careClassSizeRules);
me.greenCareStyle.addRules(greenCareClassImageSizeRules);
me.greenCareStyle.addRules(featureTypeRules);
me.greenCareStyle.addRules(linkTypeSizeRules);
me.greenCareStyle.addRules(linkStatusRules);
};
})(this);
6 changes: 6 additions & 0 deletions UI/src/view/linear_asset/carryingCapacityStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,23 @@
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('zoomLevel').is(11).use({ stroke: { width: 4 } })
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];

me.frostHeavingFactorStyle = new StyleRuleProvider({ stroke : { opacity: 0.7 }});
me.frostHeavingFactorStyle.addRules(frostHeavingFactorRules);
me.frostHeavingFactorStyle.addRules(carryingCapacityFeatureSizeRules);
me.frostHeavingFactorStyle.addRules(featureTypeRules);
me.frostHeavingFactorStyle.addRules(linkTypeSizeRules);
me.frostHeavingFactorStyle.addRules(linkStatusRules);

me.springCarryingCapacityStyle = new StyleRuleProvider({ stroke : { opacity: 0.7 }});
me.springCarryingCapacityStyle.addRules(springCarryingCapacityRules);
me.springCarryingCapacityStyle.addRules(carryingCapacityFeatureSizeRules);
me.springCarryingCapacityStyle.addRules(featureTypeRules);
me.springCarryingCapacityStyle.addRules(linkTypeSizeRules);
me.springCarryingCapacityStyle.addRules(linkStatusRules);

};
})(this);
3 changes: 2 additions & 1 deletion UI/src/view/linear_asset/cyclingAndWalkingStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@

var linkStatusRules = [
new StyleRule().where('constructionType').is(2).use({ stroke: { color: '#ff9900'} }),
new StyleRule().where('constructionType').is(1).use({ stroke: { color: '#cc99ff'} })
new StyleRule().where('constructionType').is(1).use({ stroke: { color: '#cc99ff'} }),
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];


Expand Down
28 changes: 22 additions & 6 deletions UI/src/view/linear_asset/laneModellingStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
roadPartNumber: link.roadPartNumber,
startAddrMValue: link.startAddrMValue,
endAddrMValue: link.endAddrMValue,
isSelected: true
isSelected: true,
constructionType: link.constructionType
};
return _.merge({}, linearAsset, notSelectable, hasAssetAndType, options);
} else
Expand All @@ -57,6 +58,7 @@
roadLinkWithAsset.roadPartNumber = roadLink.roadPartNumber;
roadLinkWithAsset.startAddrMValue = roadLink.startAddrMValue;
roadLinkWithAsset.endAddrMValue = roadLink.endAddrMValue;
roadLinkWithAsset.constructionType = roadLink.constructionType;
return _.merge({}, roadLinkWithAsset, {isSelected: true}, hasAssetAndType);
});
}
Expand Down Expand Up @@ -113,11 +115,19 @@
];

var laneModellingStyleRules = [
new StyleRule().where('hasAsset').is(false).use({ stroke : { opacity: 0.7, color: '#7f7f7c'}}),
new StyleRule().where('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(true).use({ stroke : { opacity: 0.7, color: '#ff0000' }}),
new StyleRule().where('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(false).use({ stroke : { opacity: 0.7, color: '#11bb00' }}),
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(true).use({ stroke : { opacity: 0.7, color: '#ff0000', width: 3 }}),
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(false).use({ stroke : { opacity: 0.7, color: '#11bb00', width: 3 }})
new StyleRule().where('hasAsset').is(false).and('constructionType').isNot(4).use({ stroke : { opacity: 0.7, color: '#7f7f7c'}}),
new StyleRule().where('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(true).and('constructionType').isNot(4).use({ stroke : { opacity: 0.7, color: '#ff0000' }}),
new StyleRule().where('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(false).and('constructionType').isNot(4).use({ stroke : { opacity: 0.7, color: '#11bb00' }}),
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(true).and('constructionType').isNot(4).use({ stroke : { opacity: 0.7, color: '#ff0000', width: 3 }}),
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(false).and('constructionType').isNot(4).use({ stroke : { opacity: 0.7, color: '#11bb00', width: 3 }})
];

var laneModellingStyleRulesForLinksOutOfUse = [
new StyleRule().where('hasAsset').is(false).and('constructionType').is(4).use({ stroke : { opacity: 0.3, color: '#7f7f7c'}}),
new StyleRule().where('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(true).and('constructionType').is(4).use({ stroke : { opacity: 0.3, color: '#ff0000' }}),
new StyleRule().where('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(false).and('constructionType').is(4).use({ stroke : { opacity: 0.3, color: '#11bb00' }}),
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(true).and('constructionType').is(4).use({ stroke : { opacity: 0.3, color: '#ff0000', width: 3 }}),
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('hasAsset').is(true).and('isSelected').is(true).and(function (asset){return isMainLane(asset);}).is(false).and('constructionType').is(4).use({ stroke : { opacity: 0.3, color: '#11bb00', width: 3 }})
];

var laneModellingSizeRules = [
Expand Down Expand Up @@ -153,11 +163,16 @@
new StyleRule().where('type').is('overlay').and('linkType').isIn([8, 9, 12, 21]).and('zoomLevel').is(11).use({ stroke: {color: '#fff', lineCap: 'square', width: 2, lineDash: [1, 8] } })
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];

me.browsingStyleProvider = new StyleRuleProvider({ stroke : { opacity: 0.01, color: '#7f7f7c' }});
me.browsingStyleProvider.addRules(laneModellingSizeRules);
me.browsingStyleProvider.addRules(featureTypeRules);
me.browsingStyleProvider.addRules(overlayStyleRules);
me.browsingStyleProvider.addRules(laneModellingStyleRules);
me.browsingStyleProvider.addRules(laneModellingStyleRulesForLinksOutOfUse);
me.browsingStyleProvider.addRules(trafficDirectionRulesForUnselectedLanes);
me.browsingStyleProvider.addRules(trafficDirectionRulesForSelectedLane);
me.browsingStyleProvider.addRules(linkTypeSizeRules);
Expand All @@ -167,5 +182,6 @@
me.browsingStyleProviderViewOnly.addRules(laneModellingSizeRules);
me.browsingStyleProviderViewOnly.addRules(featureTypeRules);
me.browsingStyleProviderViewOnly.addRules(linkTypeSizeRules);
me.browsingStyleProviderViewOnly.addRules(linkStatusRules);
};
})(this);
6 changes: 6 additions & 0 deletions UI/src/view/linear_asset/manoeuvreStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
new StyleRule().where('zoomLevel', roadLayer.uiState).is(15).use({ pointRadius: 16 })
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3}})
];

var defaultStyleProvider = new StyleRuleProvider({stroke: {opacity: 0.65, rotation : '${rotation}'}});

defaultStyleProvider.addRules([
Expand All @@ -65,13 +69,15 @@
new StyleRule().where('zoomLevel').is(14).use({ pointRadius: 16 }),
new StyleRule().where('zoomLevel').is(15).use({ pointRadius: 16 })
]);
defaultStyleProvider.addRules(linkStatusRules);

var selectionProvider = new StyleRuleProvider({stroke: {opacity: 0.9, rotation : '${rotation}', color: '#00f'},
icon: {src: 'images/link-properties/arrow-drop-blue.svg'}});

selectionProvider.addRules(zoomLevelRules);
selectionProvider.addRules(featureTypeRules);
selectionProvider.addRules(signSizeRules);
selectionProvider.addRules(linkStatusRules);

var getDefaultStyle = function () {
return defaultStyleProvider;
Expand Down
5 changes: 5 additions & 0 deletions UI/src/view/linear_asset/parkingProhibitionStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,16 @@
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('zoomLevel').is(11).use({ stroke: { width: 4 } })
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];

me.browsingStyleProvider = new StyleRuleProvider({ stroke : { opacity: 0.7 }});
me.browsingStyleProvider.addRules(parkingProhibitionStyleRules);
me.browsingStyleProvider.addRules(parkingProhibitionSizeRules);
me.browsingStyleProvider.addRules(featureTypeRules);
me.browsingStyleProvider.addRules(linkTypeSizeRules);
me.browsingStyleProvider.addRules(linkStatusRules);

};
})(this);
5 changes: 5 additions & 0 deletions UI/src/view/linear_asset/pavedRoadStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,15 @@
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('zoomLevel').is(11).use({ stroke: { width: 4 } })
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];

me.browsingStyleProvider = new StyleRuleProvider({ stroke : { opacity: 0.7 }});
me.browsingStyleProvider.addRules(pavedRoadStyleRules);
me.browsingStyleProvider.addRules(pavedRoadFeatureSizeRules);
me.browsingStyleProvider.addRules(featureTypeRules);
me.browsingStyleProvider.addRules(linkTypeSizeRules);
me.browsingStyleProvider.addRules(linkStatusRules);
};
})(this);
9 changes: 7 additions & 2 deletions UI/src/view/linear_asset/piecewiseLinearAssetStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('zoomLevel').isIn([10, 9, 8]).use({ stroke: { width: 2 } }),
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('zoomLevel').is(11).use({ stroke: { width: 4 } })
];


var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];

me.browsingStyleProvider = new StyleRuleProvider({ stroke : { opacity: 0.7 }});
me.browsingStyleProvider.addRules(expirationRules);
Expand All @@ -50,12 +53,14 @@
me.browsingStyleProvider.addRules(featureTypeRules);
me.browsingStyleProvider.addRules(questionMarkerStyleRules);
me.browsingStyleProvider.addRules(linkTypeSizeRules);
me.browsingStyleProvider.addRules(linkStatusRules);

me.browsingStyleProviderReadOnly = new StyleRuleProvider({ stroke : { opacity: 0.7 , color: '#439232'}});
me.browsingStyleProviderReadOnly = new StyleRuleProvider({ stroke : { opacity: 0.3 , color: '#439232'}});
me.browsingStyleProviderReadOnly.addRules(zoomLevelRules);
me.browsingStyleProviderReadOnly.addRules(oneWayRules);
me.browsingStyleProviderReadOnly.addRules(questionMarkerStyleRules);
me.browsingStyleProviderReadOnly.addRules(linkTypeSizeRules);
me.browsingStyleProviderReadOnly.addRules(linkStatusRules);
};
})(this);

5 changes: 5 additions & 0 deletions UI/src/view/linear_asset/roadDamagedByThawStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('zoomLevel').is(11).use({ stroke: { width: 4 } })
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];

me.browsingStyleProvider = new StyleRuleProvider({ stroke : { opacity: 0.7 }});
me.browsingStyleProvider.addRules(roadDamagedByThawStyleRules);
me.browsingStyleProvider.addRules(roadDamagedByThawSizeRules);
me.browsingStyleProvider.addRules(featureTypeRules);
me.browsingStyleProvider.addRules(linkTypeSizeRules);
me.browsingStyleProvider.addRules(linkStatusRules);
};
})(this);
5 changes: 5 additions & 0 deletions UI/src/view/linear_asset/roadWorkStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,16 @@
new StyleRule().where('linkType').isIn([8, 9, 12, 21]).and('zoomLevel').is(11).use({ stroke: { width: 4 } })
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];


me.browsingStyleProvider = new StyleRuleProvider({ stroke : { opacity: 0.7 }});
me.browsingStyleProvider.addRules(roadWorkStyleRules);
me.browsingStyleProvider.addRules(roadWorkSizeRules);
me.browsingStyleProvider.addRules(featureTypeRules);
me.browsingStyleProvider.addRules(linkTypeSizeRules);
me.browsingStyleProvider.addRules(linkStatusRules);
};
})(this);
6 changes: 6 additions & 0 deletions UI/src/view/linear_asset/serviceRoadStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,22 @@
new StyleRule().where('type').is('cutter').use({ icon: { src: 'images/cursor-crosshair.svg'}})
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];

me.rightOfUseStyle = new StyleRuleProvider({ stroke : { opacity: 0.7 }});
me.rightOfUseStyle.addRules(rightOfUseStyleRules);
me.rightOfUseStyle.addRules(serviceRoadFeatureSizeRules);
me.rightOfUseStyle.addRules(overlayStyleRules);
me.rightOfUseStyle.addRules(featureTypeRules);
me.rightOfUseStyle.addRules(linkStatusRules);

me.browsingStyleProvider = new StyleRuleProvider({ stroke : { opacity: 0.7 }});
me.browsingStyleProvider.addRules(serviceRoadStyleRules);
me.browsingStyleProvider.addRules(serviceRoadFeatureSizeRules);
me.browsingStyleProvider.addRules(featureTypeRules);
me.browsingStyleProvider.addRules(linkStatusRules);

};
})(this);
6 changes: 6 additions & 0 deletions UI/src/view/linear_asset/speedLimitStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
var questionMarkerStyleRules = [
new StyleRule().where(isSuggested).is(true).use({icon: {src: 'images/icons/questionMarker.png', scale: 0.7, anchor: [0.45, 1]}})
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3}, icon: { opacity: 0.3} })
];

var browseStyle = new StyleRuleProvider({});
browseStyle.addRules(speedLimitStyleRules);
Expand All @@ -105,6 +109,7 @@
browseStyle.addRules(validityDirectionStyleRules);
browseStyle.addRules(oneWayOverlayStyleRules);
browseStyle.addRules(questionMarkerStyleRules);
browseStyle.addRules(linkStatusRules);

var selectionStyle = new StyleRuleProvider({ stroke: {opacity: 0.15}, graphic: {opacity: 0.3}});
selectionStyle.addRules(speedLimitStyleRules);
Expand All @@ -115,6 +120,7 @@
selectionStyle.addRules(oneWayOverlayStyleRules);
selectionStyle.addRules([unknownLimitStyleRule]);
selectionStyle.addRules(questionMarkerStyleRules);
selectionStyle.addRules(linkStatusRules);

//History rules
var typeSpecificStyleRulesHistory = [
Expand Down
5 changes: 5 additions & 0 deletions UI/src/view/linear_asset/winterSpeedLimitStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
new StyleRule().where('type').is('overlay').and('linkType').isIn([8, 9, 12, 21]).and('zoomLevel').is(11).use({ stroke: {color: '#fff', lineCap: 'square', width: 2, lineDash: [1, 8] } })
];

var linkStatusRules = [
new StyleRule().where('constructionType').is(4).use({ stroke: { opacity: 0.3} })
];

me.browsingStyleProvider = new StyleRuleProvider({});
me.browsingStyleProvider.addRules(speedLimitStyleRules);
me.browsingStyleProvider.addRules(speedLimitFeatureSizeRules);
Expand All @@ -87,6 +91,7 @@
me.browsingStyleProvider.addRules(validityDirectionStyleRules);
me.browsingStyleProvider.addRules(oneWayOverlayStyleRules);
me.browsingStyleProvider.addRules(linkTypeSizeRules);
me.browsingStyleProvider.addRules(linkStatusRules);

this.renderOverlays = function(linearAssets){
var speedLimitsWithType = _.map(linearAssets, function(linearAsset) { return _.merge({}, linearAsset, { type: 'other' }); });
Expand Down
13 changes: 13 additions & 0 deletions UI/src/view/navigationpanel/actionPanelBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@
this.legendName = function () {};
this.municipalityVerified = function () {};

this.constructionTypeLabeling = function() {

return [
' <div class="panel-section panel-legend linear-asset-legend construction-type-legend">',
' <div class="legend-entry">',
' <div class="label">Väliaikaisesti poissa käytöstä (haalennettu linkki)</div>',
' <div class="symbol linear construction-type-4"/>',
' </div>',
' </div>'
].join('');
};

this.predicate = function () {
return authorizationPolicy.editModeAccess();
};
Expand All @@ -102,6 +114,7 @@
me.panel(),
me.radioButton(),
me.labeling(),
me.constructionTypeLabeling(),
me.checkboxPanel(),
me.walkingCyclingPanel(),
me.bindExternalEventHandlers(),
Expand Down
Loading

0 comments on commit a28eab7

Please sign in to comment.