forked from MapComplete/MapComplete
		
	Disable editing when userbadge is disabled
This commit is contained in:
		
							parent
							
								
									97c3b52236
								
							
						
					
					
						commit
						52f53eb6b6
					
				
					 3 changed files with 8 additions and 2 deletions
				
			
		
							
								
								
									
										2
									
								
								State.ts
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								State.ts
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -22,7 +22,7 @@ export default class State {
 | 
			
		|||
    // The singleton of the global state
 | 
			
		||||
    public static state: State;
 | 
			
		||||
    
 | 
			
		||||
    public static vNumber = "0.1.2e";
 | 
			
		||||
    public static vNumber = "0.1.2f";
 | 
			
		||||
    
 | 
			
		||||
    // The user journey states thresholds when a new feature gets unlocked
 | 
			
		||||
    public static userJourney = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,11 +35,14 @@ export default class EditableTagRendering extends UIElement {
 | 
			
		|||
 | 
			
		||||
        if (this._configuration.question !== undefined) {
 | 
			
		||||
            // 2.3em total width
 | 
			
		||||
            if(State.state.featureSwitchUserbadge.data){
 | 
			
		||||
                
 | 
			
		||||
            this._editButton = 
 | 
			
		||||
                Svg.pencil_ui().SetClass("edit-button")
 | 
			
		||||
                .onClick(() => {
 | 
			
		||||
                    self._editMode.setData(true);
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            // And at last, set up the skip button
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,6 +5,7 @@ import EditableTagRendering from "./EditableTagRendering";
 | 
			
		|||
import QuestionBox from "./QuestionBox";
 | 
			
		||||
import Combine from "../Base/Combine";
 | 
			
		||||
import TagRenderingAnswer from "./TagRenderingAnswer";
 | 
			
		||||
import State from "../../State";
 | 
			
		||||
 | 
			
		||||
export class FeatureInfoBox extends UIElement {
 | 
			
		||||
    private _tags: UIEventSource<any>;
 | 
			
		||||
| 
						 | 
				
			
			@ -33,7 +34,9 @@ export class FeatureInfoBox extends UIElement {
 | 
			
		|||
            layerConfig.titleIcons.map(icon => new TagRenderingAnswer(tags, icon)))
 | 
			
		||||
            .SetClass("featureinfobox-icons");
 | 
			
		||||
        this._renderings = layerConfig.tagRenderings.map(tr => new EditableTagRendering(tags, tr));
 | 
			
		||||
        if (State.state.featureSwitchUserbadge.data) {
 | 
			
		||||
            this._questionBox = new QuestionBox(tags, layerConfig.tagRenderings);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue