From ca4f6d22c8b8fe94a9d052afcbc5829f6551074b Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 1 Mar 2018 13:18:54 -0500 Subject: [PATCH] Fix for basename calculation - this actually works with URLs now. --- client/galaxy/scripts/components/RuleCollectionBuilder.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/galaxy/scripts/components/RuleCollectionBuilder.vue b/client/galaxy/scripts/components/RuleCollectionBuilder.vue index 9b52db40fb07..8256634dff51 100644 --- a/client/galaxy/scripts/components/RuleCollectionBuilder.vue +++ b/client/galaxy/scripts/components/RuleCollectionBuilder.vue @@ -490,8 +490,10 @@ const Rules = { rule.target_column = component.addColumnBasenameTarget; }, apply: (rule, data, sources) => { - // https://github.com/kgryte/regex-basename-posix/blob/master/lib/index.js - const re = /^(?:\/?|)(?:[\s\S]*?)((?:\.{1,2}|[^\/]+?|)(?:\.[^.\/]*|))(?:[\/]*)$/; + // https://github.com/kgryte/regex-basename-posix/blob/master/lib/index.js + //const re = /^(?:\/?|)(?:[\s\S]*?)((?:\.{1,2}|[^\/]+?|)(?:\.[^.\/]*|))(?:[\/]*)$/; + // https://stackoverflow.com/questions/8376525/get-value-of-a-string-after-a-slash-in-javascript + const re = /[^/]*$/; const target = rule.target_column; return applyRegex(re, target, data); }