Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Transit System #551

Open
wants to merge 53 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
fd78969
close #532 transit route setup (#544)
tykealy Sep 6, 2023
c1d952a
close #546 can now create new location (#548)
tykealy Sep 6, 2023
ef5cc45
Merge branch 'develop' into transit-system
tykealy Sep 6, 2023
1a85e43
close #555 add default country to vendor (#556)
tykealy Sep 11, 2023
9d9fdc4
Merge branch 'develop' into transit-system
tykealy Sep 11, 2023
d61562d
Close #547 Transit Branch Setup (#557)
Regene27 Sep 12, 2023
7f1dc74
Merge branch 'transit-system' of https://github.com/channainfo/commis…
tykealy Sep 13, 2023
71b2300
Close #550 Transit Stop setup (#572)
chheng-dev Sep 13, 2023
b4ee78b
Merge branch 'transit-system' of https://github.com/channainfo/commis…
tykealy Sep 14, 2023
4ccfbd7
Merge branch 'develop' into transit-system
tykealy Sep 14, 2023
d739c32
close #576 route setup (#580)
tykealy Sep 14, 2023
345dad5
Close #566 Add Branch Filtering (#573)
Regene27 Sep 16, 2023
3901fa6
Close #549 Add Location Filtering (#586)
Regene27 Sep 16, 2023
ae02c15
close #587 auto add option value once new place is created (#589)
tykealy Sep 16, 2023
1ec22d2
Close #588 Add Route Filtering (#593)
Regene27 Sep 18, 2023
2598e1b
Close #594 Add Stop Filtering (#597)
Regene27 Sep 21, 2023
45a8635
Merge branch 'develop' into transit-system
tykealy Sep 21, 2023
fcffb4a
Close #856 Transit add location to be taxon
chheng-dev Dec 7, 2023
0576bf1
WIP add vehicle type
tykealy Oct 6, 2023
39fd945
change seat number to sequential order
tykealy Dec 6, 2023
ab887cd
added suffix option to label
tykealy Dec 12, 2023
cd4eba3
added amenities
tykealy Dec 13, 2023
a1ae4d1
Close #887 Add Vehicle Table
Regene27 Dec 13, 2023
37bb4e2
Close #916 Add Search and Sort to Vehicle Type
Regene27 Dec 20, 2023
4afce92
Close #725 Transit Add Service Calendar to Vendor
chheng-dev Nov 29, 2023
6d8dcfc
close #911 added transit-service-calender
tykealy Dec 22, 2023
4234195
Close #952 Add origin and destination to route
chheng-dev Jan 3, 2024
9e0405c
Close #969 Make sure origin and destination they aren't the same
chheng-dev Jan 8, 2024
74977ba
close #971 predefine layer name in vehicle_type seat layout
tykealy Jan 8, 2024
17cfbc0
close #973 added status to vehicle_type
tykealy Jan 8, 2024
c687a2d
close #976 change the term bus to automobile
tykealy Jan 8, 2024
78d0103
close #988 validate vehicle_code and vehicle_license_plate
tykealy Jan 8, 2024
2f914ac
Close #979 Add Primary Photo to Vehicle
Regene27 Jan 9, 2024
27a4889
Close #975 Display Vehicle/Vehicle-code in edit page
Regene27 Jan 8, 2024
f0e7bdc
close #998 added filter tab for active, darft, and archived vehicle_type
tykealy Jan 9, 2024
34902d6
close #980 added route_type field to vehicle (#981)
tykealy Jan 15, 2024
cda18b1
Close #912 Transit Add DataType to taxon (#913)
chheng-dev Jan 15, 2024
2dd26cf
Close #997 Add Amenity to vehicle type (#1014)
chheng-dev Jan 15, 2024
370fa90
Close #1016 Transit when edit not validate between origin and destina…
chheng-dev Jan 15, 2024
52f8ba9
close #1082 fixed vehicle_type not loading the correct amenities (#1083)
tykealy Feb 5, 2024
f8abd10
Close #1011 change transit taxonomies url (#1015)
tykealy Feb 12, 2024
73cfe5b
close #1123 fixed changing seat-type leaed to multiple post requests …
tykealy Feb 19, 2024
5614b85
close #1121 fixed ActiveRecord::ReadOnlyError on /transit/route (#1122)
tykealy Feb 23, 2024
eb0b21e
Close #1130 Transit Route Query (#1131)
tykealy Feb 27, 2024
80619f0
Close #1186 Trip Seats Layout Query (#1187)
tykealy Mar 13, 2024
3a9f6d3
close #1208 implemented seat selection availablitity flag to route (#…
tykealy Mar 15, 2024
9bde321
close #1217 flitered seats for order that is completed (#1218)
tykealy Mar 15, 2024
c7d9f12
close #1227 added allow seat selection on vehicle_type (#1228)
tykealy Mar 19, 2024
081a6bb
close #1239 addded trip form (#1240)
tykealy Mar 21, 2024
62789c1
close#1346 search trip from stop (#1349)
tykealy Apr 26, 2024
960d296
close #1256 added transit order validation (#1257)
tykealy Apr 30, 2024
9fa2c09
close #1414 add sequence to trip stop (#1415)
tykealy May 20, 2024
a777433
close #1585 added vendor stop (#1586)
tykealy Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ group :development, :test do
gem 'rubocop', '~> 1.45', require: false
gem 'rubocop-performance', '~> 1.16', require: false
gem 'rubocop-rails', '~> 2.17', require: false
gem 'rubocop-rspec', '~> 1.42', require: false
end

group :test do
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ PATH
activerecord_json_validator (~> 2.1, >= 2.1.3)
aws-sdk-s3
byebug
counter_culture (~> 3.2)
dry-validation (~> 1.10)
elasticsearch (~> 8.5)
exception_notification
Expand Down Expand Up @@ -227,6 +228,9 @@ GEM
console (1.23.2)
fiber-annotation
fiber-local
counter_culture (3.5.2)
activerecord (>= 4.2)
activesupport (>= 4.2)
crack (0.4.5)
rexml
crass (1.0.6)
Expand Down Expand Up @@ -601,6 +605,8 @@ GEM
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-rspec (1.42.0)
rubocop (>= 0.87.0)
ruby-progressbar (1.13.0)
ruby-vips (2.1.4)
ffi (~> 1.12)
Expand Down Expand Up @@ -808,6 +814,7 @@ DEPENDENCIES
rubocop (~> 1.45)
rubocop-performance (~> 1.16)
rubocop-rails (~> 2.17)
rubocop-rspec (~> 1.42)
shoulda-matchers (~> 5.0)
spree_cm_commissioner!
spree_dev_tools!
Expand Down
17 changes: 17 additions & 0 deletions app/assets/images/cm-driver-seat-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/images/cm-normal-seat-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions app/assets/images/cm-vip-seat-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/assets/javascripts/spree_cm_commissioner/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
//= require spree_cm_commissioner/calendar
//= require spree_cm_commissioner/role_form
//= require spree_cm_commissioner/address_hide_form
//= require spree_cm_commissioner/vehicle_seat
//= require spree_cm_commissioner/selected_field_filter_origin_destination
//= require spree_cm_commissioner/location_checkbox_manager
//= require spree_cm_commissioner/trip_stop_selection
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const LocationCheckboxManager = {
initialize: function () {
const locationCheckboxes = document.querySelectorAll(".location");

locationCheckboxes.forEach(function (locationCheckbox) {
locationCheckbox.addEventListener("change", function () {
LocationCheckboxManager.handleCheckboxChange(this);
});

LocationCheckboxManager.handleCheckboxChange(locationCheckbox);
});
},

handleCheckboxChange: function (changedCheckbox) {
const pointCheckbox = document.querySelector(".stop");
const stopCheckbox = document.querySelector(".station");
const branchCheckbox = document.querySelector(".branch");

if (!stopCheckbox || !branchCheckbox || !pointCheckbox) {
alert("Please select at the last one.");
event.preventDefault();
}

const isLocationChecked = changedCheckbox.checked;

if (isLocationChecked) {
stopCheckbox.checked = false;
stopCheckbox.disabled = true;

branchCheckbox.checked = false;
branchCheckbox.disabled = true;

pointCheckbox.checked = false;
pointCheckbox.disabled = true;
} else {
stopCheckbox.disabled = false;
branchCheckbox.disabled = false;
pointCheckbox.disabled = false;
}
},
};

document.addEventListener("spree:load", function () {
LocationCheckboxManager.initialize();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var SelectFieldFilterOriginDestination = {
initialize: function (originSelector, destinationSelector, selectedOriginId, selectedDestinationId) {
function filterOptions(originId, destinationSelector) {
$(destinationSelector + ' option').each(function () {
if ($(this).val() == originId) {
$(this).prop('disabled', true).hide();
}
else {
$(this).prop('disabled', false).show();
}
});
}

$(originSelector).val(selectedOriginId);
$(destinationSelector).val(selectedDestinationId);

filterOptions(selectedOriginId, destinationSelector);
filterOptions(selectedDestinationId, originSelector);


$(document).on('change', originSelector, function () {
var originId = $(this).val();
filterOptions(originId, destinationSelector);
});

$(document).on('change', destinationSelector, function () {
var destinationId = $(this).val();
filterOptions(destinationId, originSelector);
});
}
}

document.addEventListener("spree:load", function () {
var selectedOriginId = $('#product_origin_id').val();
var selectedDestinationId = $('#product_destination_id').val();
SelectFieldFilterOriginDestination.initialize('#product_origin_id', '#product_destination_id', selectedOriginId, selectedDestinationId);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
var boardingAndDropOffSelectionFilter = {
initialize: function (boardingSelector, dropOffSelector) {
var selectedOriginIds = $(boardingSelector).val();
var selectedDestinationIds = $(dropOffSelector).val();

function filterOptions(selectedIds, selector) {
$(selector + " option").each(function () {
var optionValue = $(this).val();
// Check if the optionValue exists in the selectedIds array
if (selectedIds.includes(optionValue)) {
$(this).prop("disabled", true).hide();
} else {
$(this).prop("disabled", false).show();
}
});
}

$(boardingSelector).val(selectedOriginIds);
$(dropOffSelector).val(selectedDestinationIds);

filterOptions(selectedOriginIds, dropOffSelector);
filterOptions(selectedDestinationIds, boardingSelector);

$(document).on("change", boardingSelector, function () {
var originIds = $(this).val();
filterOptions(originIds, dropOffSelector);
});

$(document).on("change", dropOffSelector, function () {
var destinationIds = $(this).val();
filterOptions(destinationIds, boardingSelector);
});
},
};

document.addEventListener("spree:load", function () {
boardingAndDropOffSelectionFilter.initialize(
"#boarding_stops",
"#drop-off_stops"
);
});
Loading