<commit_before>RequestFormBaseView = require './requestFormBase'

class RequestFormEdit extends RequestFormBaseView

    initialize: ->
        super
        app.$page.hide()

    handleScheduleTypeChange: (e) ->
        super
        scheduleType = $(e.currentTarget).val()
        @$("#schedule").val @model.get('request')[scheduleType]

    renderEditForm: ->
        request = @model.toJSON()
        @requestType = request.request.requestType

        @render()
        # expand appropriate form fields
        @changeType()

        # render taggable data
        for tag in @taggables()
            @renderTaggable @[tag.name], request.request[tag.name]
        
        @$('#slavePlacement').val request.request.slavePlacement
        
        if @requestType is 'SERVICE' or 'WORKER'
            @$("#instances-#{@requestType}").val request.instances
            @$("#rack-sensitive-#{@requestType}").prop 'checked', request.request.rackSensitive
            @$("#load-balanced").prop 'checked', request.request.loadBalanced
           
        if @requestType in ['SCHEDULED','ON_DEMAND','RUN_ONCE']
            @$("#killOldNRL-#{@requestType}").val request.request.killOldNonLongRunningTasksAfterMillis

        if @requestType is 'WORKER'
            @$("#waitAtLeast-#{@requestType}").val request.request.waitAtLeastMillisAfterTaskFinishesForReschedule
<commit_msg>fix request instance number rendering<commit_after>RequestFormBaseView = require './requestFormBase'

class RequestFormEdit extends RequestFormBaseView

    initialize: ->
        super
        app.$page.hide()

    handleScheduleTypeChange: (e) ->
        super
        scheduleType = $(e.currentTarget).val()
        @$("#schedule").val @model.get('request')[scheduleType]

    renderEditForm: ->
        request = @model.toJSON()
        @requestType = request.request.requestType

        @render()
        # expand appropriate form fields
        @changeType()

        # render taggable data
        for tag in @taggables()
            @renderTaggable @[tag.name], request.request[tag.name]
        
        @$('#slavePlacement').val request.request.slavePlacement
        
        if @requestType is 'SERVICE' or 'WORKER'
            @$("#instances-#{@requestType}").val request.request.instances
            @$("#rack-sensitive-#{@requestType}").prop 'checked', request.request.rackSensitive
            @$("#load-balanced").prop 'checked', request.request.loadBalanced
           
        if @requestType in ['SCHEDULED','ON_DEMAND','RUN_ONCE']
            @$("#killOldNRL-#{@requestType}").val request.request.killOldNonLongRunningTasksAfterMillis

        if @requestType is 'WORKER'
            @$("#waitAtLeast-#{@requestType}").val request.request.waitAtLeastMillisAfterTaskFinishesForReschedule

{'fraction_non_alphanumeric': 0.1323529411764706, 'fraction_numerical': 0.0, 'mean_word_length': 2.7997275204359675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5316627', 'n_tokens_mistral': 773, 'n_tokens_neox': 780, 'n_words': 136}