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

Upgrade from turbolinks to turbo #1192

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[v#.#.#] ([month] [YYYY])
- [entity]:
- [future tense verb] [feature]
- Upgraded gems: importmap-rails, rails
- Upgraded gems: importmap-rails, rails, turbo-rails
- Bugs fixes:
- [entity]:
- [future tense verb] [bug fix]
Expand Down
19 changes: 9 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ gem 'coffee-rails', '~> 5.0'
# Cache-friendly, client-side local time
gem 'local_time', '>= 2.0.0'

# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
gem 'importmap-rails', '~> 1.2'

gem 'turbo-rails', '~> 1.4'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
Expand Down Expand Up @@ -69,8 +70,6 @@ gem 'time', '>= 0.2.2'

gem 'font-awesome-sass', '~> 6.4.0'

gem 'importmap-rails', '~> 1.2'

gem 'sprockets-rails', '>= 3.0.0'

# ------------------------------------------------------ With native extensions
Expand Down Expand Up @@ -236,17 +235,17 @@ end

# ----------------------------------------------------------------- Calculators

gem 'dradis-calculator_cvss', '~> 4.10.0'
gem 'dradis-calculator_dread', '~> 4.10.0'
gem 'dradis-calculator_cvss', github: 'dradis/dradis-calculator_cvss', branch: 'turbo'
gem 'dradis-calculator_dread', github: 'dradis/dradis-calculator_dread', branch: 'turbo'

# ---------------------------------------------------------------------- Export
# # ---------------------------------------------------------------------- Export
gem 'dradis-csv_export', '~> 4.10.0'
gem 'dradis-html_export', github: 'dradis/dradis-html_export', branch: 'rails-7-upgrade'

# ---------------------------------------------------------------------- Import
gem 'dradis-csv', '~> 4.10.0'
# # ---------------------------------------------------------------------- Import
gem 'dradis-csv', github: 'dradis/dradis-csv', branch: 'turbo'

# ---------------------------------------------------------------------- Upload
# # ---------------------------------------------------------------------- Upload
gem 'dradis-acunetix', '~> 4.10.0'
gem 'dradis-brakeman', '~> 4.10.0'
gem 'dradis-burp', '~> 4.10.0'
Expand Down
45 changes: 32 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
GIT
remote: https://github.com/dradis/dradis-calculator_cvss.git
revision: dacb6ffb0bc24273c4711d87932ff29c4d017e28
branch: turbo
specs:
dradis-calculator_cvss (4.10.0)
dradis-plugins (~> 4.0)

GIT
remote: https://github.com/dradis/dradis-calculator_dread.git
revision: 5fc67c08acc9012a71f297bc0e00356a984ac298
branch: turbo
specs:
dradis-calculator_dread (4.10.0)
dradis-plugins (~> 4.0)

GIT
remote: https://github.com/dradis/dradis-csv.git
revision: 963b74e151527aac0d08fd09b0d0e8cf3e137f88
branch: turbo
specs:
dradis-csv (4.10.0)
dradis-plugins (~> 4.0)

GIT
remote: https://github.com/dradis/dradis-html_export.git
revision: 70ccfe4e99d8cf077afe5aa5a97c73b2dd07049b
Expand Down Expand Up @@ -141,14 +165,8 @@ GEM
dradis-burp (4.10.0)
dradis-plugins (~> 4.0)
nokogiri (~> 1.3)
dradis-calculator_cvss (4.10.0)
dradis-plugins (~> 4.0)
dradis-calculator_dread (4.10.0)
dradis-plugins (~> 4.0)
dradis-coreimpact (4.10.0)
dradis-plugins (~> 4.0)
dradis-csv (4.10.0)
dradis-plugins (~> 4.0)
dradis-csv_export (4.10.0)
dradis-plugins (>= 4.8.0)
dradis-metasploit (4.10.0)
Expand Down Expand Up @@ -486,9 +504,10 @@ GEM
date
timecop (0.9.5)
timeout (0.4.0)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
turbo-rails (1.4.0)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.3.0)
Expand Down Expand Up @@ -539,10 +558,10 @@ DEPENDENCIES
dradis-api!
dradis-brakeman (~> 4.10.0)
dradis-burp (~> 4.10.0)
dradis-calculator_cvss (~> 4.10.0)
dradis-calculator_dread (~> 4.10.0)
dradis-calculator_cvss!
dradis-calculator_dread!
dradis-coreimpact (~> 4.10.0)
dradis-csv (~> 4.10.0)
dradis-csv!
dradis-csv_export (~> 4.10.0)
dradis-html_export!
dradis-metasploit (~> 4.10.0)
Expand Down Expand Up @@ -614,7 +633,7 @@ DEPENDENCIES
thor (~> 1.2.1)
time (>= 0.2.2)
timecop
turbolinks (~> 5)
turbo-rails (~> 1.4)
unicorn (= 6.1.0)
warden (~> 1.2.3)
web-console (>= 4.1.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ App.cable.subscriptions.create 'NotificationsChannel',
connected: ->
console.log('Subscribed to NotificationsChannel.')
@perform('check_unread', {})
$(document).on 'turbolinks:load.notifications', =>
$(document).on 'turbo:load.notifications', =>
@perform('check_unread', {})

rejected: ->
Expand Down
3 changes: 1 addition & 2 deletions app/assets/javascripts/legacy.application.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//= require turbolinks
//= require rails-ujs
//= require jquery3
//= require popper
//= require rails-ujs
//= require bootstrap

//= require shared/notifications
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/shared/behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
});
}

document.addEventListener('turbolinks:load', function () {
document.addEventListener('turbo:load', function () {
initBehaviors(document.querySelector('body'));
});

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/shared/datatable/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class DradisDatatable {
unbindDataTable() {
var that = this;

document.addEventListener('turbolinks:before-cache', function () {
document.addEventListener('turbo:before-cache', function () {
that.dataTable.destroy();
});
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/shared/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function initNotificationsDropdown() {
}
}

document.addEventListener('turbolinks:load', function () {
document.addEventListener('turbo:load', function () {
initNotificationsDropdown();
});

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/shared/revisions.js.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->

if $('.js-diff-body').length
delRegex = /\[31m([\s\S]*?)\[0m/g
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/shared/sessions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function() {
document.addEventListener('turbo:load', function() {
if ($('body.unauthenticated').length) {
var charCount = 0,
strings = setStrings(),
Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/tylium.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//= require jquery3
//= require jquery-ui
//= require rails-ujs
//= require turbolinks
// require activestorage
//= require jquery.form
//= require jquery.textchange.min
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/tylium/behaviors.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The current list of plugins:
# * jQuery.Textile - handles the note editor (/vendor/)

document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->

# --------------------------------------------------- Standard jQuery plugins

Expand Down Expand Up @@ -177,8 +177,8 @@ document.addEventListener "turbolinks:load", ->
# Disable turbolinks for on-page anchor links (prevents page from jumping to top and allows smooth-scrolling)
if $('a[href^="#"]').length
$('a[href^="#"]').each ->
if !$(this).data('turbolinks')
$(this).attr 'data-turbolinks', 'false'
if !$(this).data('turbo')
$(this).attr 'data-turbo', 'false'
return

# Smooth Scrolling - scroll to element on page load if hash present in current browser url
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/engines.js.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function(){
document.addEventListener('turbo:load', function(){
<%
Dradis::Plugins::with_feature(:addon).sort_by(&:plugin_description).each do |plugin|
begin
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/keyboard_shortcuts.js.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->

# Nodes#show shortcuts
if $('body.nodes').length
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->
if $('body.configurations').length

$('tbody tr.gemified td.value').on('blur', 'input', ->
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/modules/export.js.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->
if $('body.export').length

# Detect Export click
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/tylium/modules/fileupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ function fileUploadInit() {
});
}

document.addEventListener("turbolinks:load", function() {
document.addEventListener("turbo:load", function() {
// Bind fileUpload on page load.
fileUploadInit();
});

// Un-bind fileUpload on page unload.
document.addEventListener('turbolinks:before-cache', function() {
document.addEventListener('turbo:before-cache', function() {
$('[data-behavior~=jquery-upload]').each(function() {
$(this).fileupload('destroy');
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->
if $('body.evidence.new').length
$('#evidence-host-list a[data-bs-toggle~=pill]').on 'click', (ev)->
path = $(this).data('path')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
}

document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->
if $('#issues').length
# Detect if we're displaying results of a query and toggle the widget
if $('.results').length
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->
if ($("body.merge.new").length)

# when clicking on the "expand/collapse" arrow icon, turn it upside down
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class @SelectTagDropdown
$span.css("color", @$target.css("color"))
$span.html(@$target.html())

document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->
$('#issues_editor .js-taglink').click (e) ->
$target = $(e.target)
new SelectTagDropdown($target)
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/modules/nodes.js.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->
$(".add_node_radio").click ->
$this = $(this)
$modal = $this.closest(".modal")
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/modules/search.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SearchWordHighlight
element.html src_str


document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->
if $('body.search.index').length
highlighter = new SearchWordHighlight
query = $(".form-search #q").val()
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/modules/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
changeState: function (key, state) {
localStorage.setItem(key, state);
Turbolinks.clearCache();
Turbo.cache.clear();
},
close: function () {
this.$sidebar
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/modules/state_button.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function () {
document.addEventListener('turbo:load', function () {
if ($('[data-behavior~=state-radio]').length) {
function updateBtn($selectedRadio) {
var selectedState = $selectedRadio
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/modules/uploads.js.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->
if $('body.upload').length
# Enable Ajax file uploads via 3rd party plugin
$bar = $('.progress-bar');
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/pages/activities.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function() {
document.addEventListener('turbo:load', function() {
var $infiniteScrollContainer = $('[data-behavior="infinite-scroll-container"]');
var loading = false;

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/pages/boards/index.js.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->

if $('body.boards.index').length

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/pages/boards/show.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SortableBoards
return


document.addEventListener "turbolinks:load", ->
document.addEventListener "turbo:load", ->

if $('body.boards.show').length
# ------------------------------------------------------------- List modals
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/pages/issues.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function () {
document.addEventListener('turbo:load', function () {
if ($('body.issues.index').length) {
$('[data-behavior~=issues-dropdown-toggle]').on('click', function (e) {
e.stopPropagation();
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/pages/nodes/new_form.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function() {
document.addEventListener('turbolinks:load', function() {
document.addEventListener('turbo:load', function() {
var copyOver = function($to, fromVal, $typeTo, typeFromVal) {
if ($to.val() === '' && fromVal !== '') {
$to.val(fromVal.trim().split('\n')[0] + '\n');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function(){
document.addEventListener('turbo:load', function(){
if ($('[data-behavior~=boards-summary]').length) {
var $boardsSummary = $('[data-behavior~=boards-summary]');
var url = $boardsSummary.data('url');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function(){
document.addEventListener('turbo:load', function(){
var $dataElement = $('#issues-summary-data'),
$chartElement = $('#issue-chart');

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/pages/projects/summary.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function () {
document.addEventListener('turbo:load', function () {
if ($('body.projects.show').length) {
$('a[data-bs-toggle="collapse"]').click(function () {
if ($(this).hasClass('collapsed')) {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/pages/qa.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function () {
document.addEventListener('turbo:load', function () {
if ($('[data-behavior~=qa-viewer]').length) {
$('[data-qa-visible]').each(function () {
$(this).toggleClass('d-none', $(this).data('qa-visible') === false);
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/pages/upload.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function () {
document.addEventListener('turbo:load', function () {
if ($('body.upload.index').length) {
$('[data-behavior~=tool-select]').on('change', function () {
let toolsWithInheritedState = [
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/tylium/pages/uploads/validation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
document.addEventListener('turbolinks:load', function() {
document.addEventListener('turbo:load', function() {
var $rtpValidation = $('[data-behavior~=rtp-validation]');

if ($rtpValidation.length) {
Expand Down
Loading