diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/javascript/journey_patterns/actions/index.js | 3 | ||||
| -rw-r--r-- | app/javascript/journey_patterns/components/EditModal.js | 13 | ||||
| -rw-r--r-- | app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js | 63 | ||||
| -rw-r--r-- | app/models/chouette/journey_pattern.rb | 3 | ||||
| -rw-r--r-- | app/models/chouette/vehicle_journey.rb | 3 | ||||
| -rw-r--r-- | app/views/api/v1/journey_patterns/show.rabl | 2 | ||||
| -rw-r--r-- | app/views/line_footnotes/show.html.slim | 4 | ||||
| -rw-r--r-- | app/views/purchase_windows/show.html.slim | 3 | ||||
| -rw-r--r-- | app/views/routes/show.html.slim | 3 | ||||
| -rw-r--r-- | app/views/routing_constraint_zones/show.html.slim | 3 | ||||
| -rw-r--r-- | app/views/time_tables/show.html.slim | 3 | ||||
| -rw-r--r-- | app/views/vehicle_journeys/show.rabl | 2 |
12 files changed, 68 insertions, 37 deletions
diff --git a/app/javascript/journey_patterns/actions/index.js b/app/javascript/journey_patterns/actions/index.js index 4ff3f77ea..1c2eb68b2 100644 --- a/app/javascript/journey_patterns/actions/index.js +++ b/app/javascript/journey_patterns/actions/index.js @@ -198,6 +198,7 @@ const actions = { name: val.name, object_id: val.object_id, short_id: val.short_id, + checksum: val.checksum, published_name: val.published_name, registration_number: val.registration_number, stop_points: val.route_short_description.stop_points, @@ -217,4 +218,4 @@ const actions = { } } -export default actions
\ No newline at end of file +export default actions diff --git a/app/javascript/journey_patterns/components/EditModal.js b/app/javascript/journey_patterns/components/EditModal.js index e7ce24aa1..7a5d24fba 100644 --- a/app/javascript/journey_patterns/components/EditModal.js +++ b/app/javascript/journey_patterns/components/EditModal.js @@ -36,7 +36,6 @@ export default class EditModal extends Component { {this.renderModalTitle()} <span type="button" className="close modal-close" data-dismiss="modal">×</span> </div> - {(this.props.modal.type == 'edit') && ( <form> <div className='modal-body'> @@ -85,6 +84,16 @@ export default class EditModal extends Component { </div> </div> </div> + <div> + <label className='control-label'>Signature métier</label> + <input + type='text' + ref='checksum' + className='form-control' + disabled='disabled' + defaultValue={this.props.modal.modalProps.journeyPattern.checksum} + /> + </div> </div> { this.props.editMode && @@ -121,4 +130,4 @@ EditModal.propTypes = { modal: PropTypes.object, onModalClose: PropTypes.func.isRequired, saveModal: PropTypes.func.isRequired -}
\ No newline at end of file +} diff --git a/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js index f8d6add03..cad04ed0e 100644 --- a/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js +++ b/app/javascript/vehicle_journeys/components/tools/EditVehicleJourney.js @@ -52,32 +52,32 @@ export default class EditVehicleJourney extends Component { {(this.props.modal.type == 'edit') && ( <form> <div className='modal-body'> - <div className='row'> - <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'> - <div className='form-group'> - <label className='control-label'>Nom de la course</label> - <input - type='text' - ref='published_journey_name' - className='form-control' - disabled={!this.props.editMode} - defaultValue={this.props.modal.modalProps.vehicleJourney.published_journey_name} - onKeyDown={(e) => actions.resetValidation(e.currentTarget)} - /> + <div className='row'> + <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'> + <div className='form-group'> + <label className='control-label'>Nom de la course</label> + <input + type='text' + ref='published_journey_name' + className='form-control' + disabled={!this.props.editMode} + defaultValue={this.props.modal.modalProps.vehicleJourney.published_journey_name} + onKeyDown={(e) => actions.resetValidation(e.currentTarget)} + /> + </div> </div> - </div> - <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'> - <div className='form-group'> - <label className='control-label'>Mission</label> - <input - type='text' - className='form-control' - value={this.props.modal.modalProps.vehicleJourney.journey_pattern.short_id + ' - ' + (this.props.modal.modalProps.vehicleJourney.journey_pattern.name)} - disabled={true} - /> + <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'> + <div className='form-group'> + <label className='control-label'>Mission</label> + <input + type='text' + className='form-control' + value={this.props.modal.modalProps.vehicleJourney.journey_pattern.short_id + ' - ' + (this.props.modal.modalProps.vehicleJourney.journey_pattern.name)} + disabled={true} + /> + </div> </div> </div> - </div> <div className='row'> <div className='col-lg-6 col-md-6 col-sm-6 col-xs-12'> @@ -131,9 +131,20 @@ export default class EditVehicleJourney extends Component { </div> </div> </div> + <div className='form-group'> + <label className='control-label'>Signature métier</label> + <input + type='text' + ref='checksum' + className='form-control' + disabled='disabled' + defaultValue={this.props.modal.modalProps.vehicleJourney.checksum} + /> + </div> + </div> { - this.props.editMode && + this.props.editMode && <div className='modal-footer'> <button className='btn btn-link' @@ -151,7 +162,7 @@ export default class EditVehicleJourney extends Component { Valider </button> </div> - } + } </form> )} @@ -171,4 +182,4 @@ EditVehicleJourney.propTypes = { onOpenEditModal: PropTypes.func.isRequired, onModalClose: PropTypes.func.isRequired, disabled: PropTypes.bool.isRequired -}
\ No newline at end of file +} diff --git a/app/models/chouette/journey_pattern.rb b/app/models/chouette/journey_pattern.rb index 03967abfa..366fde188 100644 --- a/app/models/chouette/journey_pattern.rb +++ b/app/models/chouette/journey_pattern.rb @@ -40,7 +40,8 @@ module Chouette # Update attributes and stop_points associations jp.update_attributes(state_permited_attributes(item)) unless item['new_record'] jp.state_stop_points_update(item) if !jp.errors.any? && jp.persisted? - item['errors'] = jp.errors if jp.errors.any? + item['errors'] = jp.errors if jp.errors.any? + item['checksum'] = jp.checksum end if state.any? {|item| item['errors']} diff --git a/app/models/chouette/vehicle_journey.rb b/app/models/chouette/vehicle_journey.rb index 332ddb7b8..d4dc82a56 100644 --- a/app/models/chouette/vehicle_journey.rb +++ b/app/models/chouette/vehicle_journey.rb @@ -170,7 +170,8 @@ module Chouette vj.update_attributes(state_permited_attributes(item)) vj.update_has_and_belongs_to_many_from_state(item) - item['errors'] = vj.errors.full_messages.uniq if vj.errors.any? + item['errors'] = vj.errors.full_messages.uniq if vj.errors.any? + item['checksum'] = vj.checksum end # Delete ids of new object from state if we had to rollback diff --git a/app/views/api/v1/journey_patterns/show.rabl b/app/views/api/v1/journey_patterns/show.rabl index 3ea1bb6ff..86876f3fb 100644 --- a/app/views/api/v1/journey_patterns/show.rabl +++ b/app/views/api/v1/journey_patterns/show.rabl @@ -1,7 +1,7 @@ object @journey_pattern extends "api/v1/trident_objects/show" -[:id, :name, :published_name, :registration_number, :comment].each do |attr| +[:id, :name, :published_name, :registration_number, :comment, :checksum].each do |attr| attributes attr, :unless => lambda { |m| m.send( attr).nil?} end diff --git a/app/views/line_footnotes/show.html.slim b/app/views/line_footnotes/show.html.slim index e4f2a1d42..29e1f5708 100644 --- a/app/views/line_footnotes/show.html.slim +++ b/app/views/line_footnotes/show.html.slim @@ -16,7 +16,11 @@ .panel-heading = footnote.code .panel-body p = footnote.label + .panel-footer.text-right + div + p.text-muted.small = Chouette::Footnote.human_attribute_name(:checksum) + p.text-muted.small = footnote.checksum p.text-muted em.small = "Dernière mise à jour le #{l(footnote.updated_at, format: :short)}" diff --git a/app/views/purchase_windows/show.html.slim b/app/views/purchase_windows/show.html.slim index 9f3abb267..4ddde1706 100644 --- a/app/views/purchase_windows/show.html.slim +++ b/app/views/purchase_windows/show.html.slim @@ -17,4 +17,5 @@ = definition_list t('metadatas'), { Chouette::PurchaseWindow.human_attribute_name(:name) => @purchase_window.try(:name), 'Organisation' => @purchase_window.referential.organisation.name, - Chouette::PurchaseWindow.human_attribute_name(:date_ranges) => @purchase_window.periods.map{|d| t('validity_range', debut: l(d.begin, format: :short), end: l(d.end, format: :short))}.join('<br>').html_safe } + Chouette::PurchaseWindow.human_attribute_name(:date_ranges) => @purchase_window.periods.map{|d| t('validity_range', debut: l(d.begin, format: :short), end: l(d.end, format: :short))}.join('<br>').html_safe, + Chouette::PurchaseWindow.human_attribute_name(:checksum) => @purchase_window.checksum } diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim index 2b4ebf159..644f79022 100644 --- a/app/views/routes/show.html.slim +++ b/app/views/routes/show.html.slim @@ -22,7 +22,8 @@ { t('objectid') => @route.get_objectid.short_id, t('activerecord.attributes.route.published_name') => (@route.published_name ? @route.published_name : '-'), @route.human_attribute_name(:wayback) => (@route.wayback ? @route.wayback_text : '-' ), - @route.human_attribute_name(:opposite_route) => (@route.opposite_route ? @route.opposite_route.name : '-') } + @route.human_attribute_name(:opposite_route) => (@route.opposite_route ? @route.opposite_route.name : '-'), + @route.human_attribute_name(:checksum) => @route.checksum } - if @route_sp.any? .col-lg-6.col-md-6.col-sm-12.col-xs-12 diff --git a/app/views/routing_constraint_zones/show.html.slim b/app/views/routing_constraint_zones/show.html.slim index 6235ade68..3d1988545 100644 --- a/app/views/routing_constraint_zones/show.html.slim +++ b/app/views/routing_constraint_zones/show.html.slim @@ -17,7 +17,8 @@ = definition_list t('metadatas'), { @routing_constraint_zone.human_attribute_name(:name) => @routing_constraint_zone.try(:name), @routing_constraint_zone.human_attribute_name(:route) => link_to(@routing_constraint_zone.try(:route_name), [@referential, @line, @routing_constraint_zone.route]), - @routing_constraint_zone.human_attribute_name(:line) => link_to(@line.name, [@referential, @line])} + @routing_constraint_zone.human_attribute_name(:line) => link_to(@line.name, [@referential, @line]), + @routing_constraint_zone.human_attribute_name(:checksum) => @routing_constraint_zone.checksum} .row .col-lg-12 diff --git a/app/views/time_tables/show.html.slim b/app/views/time_tables/show.html.slim index 036581268..df9789055 100644 --- a/app/views/time_tables/show.html.slim +++ b/app/views/time_tables/show.html.slim @@ -28,7 +28,8 @@ 'Couleur associée' => (@time_table.color.nil? ? '-' : content_tag(:span, '', class: 'fa fa-circle', style: "color:#{@time_table.try(:color)}")), 'Etiquettes' => @time_table.tag_list, 'Modèle de calendrier' => (@time_table.calendar ? link_to(@time_table.calendar.name, @time_table.calendar) : '-'), - "Journées d'application pour les périodes ci-dessous" => %w(monday tuesday wednesday thursday friday saturday sunday).collect{ |d| content_tag(:span, t("calendars.days.#{d}"), class: "label label-default #{@time_table.send(d) ? '' : 'disabled'}") }.join.html_safe } + "Journées d'application pour les périodes ci-dessous" => %w(monday tuesday wednesday thursday friday saturday sunday).collect{ |d| content_tag(:span, t("calendars.days.#{d}"), class: "label label-default #{@time_table.send(d) ? '' : 'disabled'}") }.join.html_safe, + Chouette::TimeTable.human_attribute_name(:checksum) => @time_table.checksum} .row .col-lg-12.mb-sm diff --git a/app/views/vehicle_journeys/show.rabl b/app/views/vehicle_journeys/show.rabl index 01175a85d..eeed79b34 100644 --- a/app/views/vehicle_journeys/show.rabl +++ b/app/views/vehicle_journeys/show.rabl @@ -1,6 +1,6 @@ object @vehicle_journey -[:objectid, :published_journey_name, :published_journey_identifier, :company_id, :comment].each do |attr| +[:objectid, :published_journey_name, :published_journey_identifier, :company_id, :comment, :checksum].each do |attr| attributes attr, :unless => lambda { |m| m.send( attr).nil?} end |
