Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
06ee932e
Commit
06ee932e
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 35 files - 13 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
b3ece842
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
99 additions
and
136 deletions
+99
-136
.prettierignore
.prettierignore
+0
-37
app/assets/javascripts/experimental_flags.js
app/assets/javascripts/experimental_flags.js
+1
-1
app/assets/javascripts/feature_flags/components/edit_feature_flag.vue
...avascripts/feature_flags/components/edit_feature_flag.vue
+1
-1
app/assets/javascripts/feature_flags/components/feature_flags.vue
...ts/javascripts/feature_flags/components/feature_flags.vue
+1
-1
app/assets/javascripts/feature_flags/components/feature_flags_table.vue
...ascripts/feature_flags/components/feature_flags_table.vue
+1
-1
app/assets/javascripts/feature_flags/components/form.vue
app/assets/javascripts/feature_flags/components/form.vue
+12
-12
app/assets/javascripts/feature_flags/components/new_feature_flag.vue
...javascripts/feature_flags/components/new_feature_flag.vue
+1
-1
app/assets/javascripts/feature_flags/store/edit/actions.js
app/assets/javascripts/feature_flags/store/edit/actions.js
+1
-1
app/assets/javascripts/feature_flags/store/edit/index.js
app/assets/javascripts/feature_flags/store/edit/index.js
+1
-1
app/assets/javascripts/feature_flags/store/gitlab_user_list/actions.js
...vascripts/feature_flags/store/gitlab_user_list/actions.js
+2
-2
app/assets/javascripts/feature_flags/store/gitlab_user_list/index.js
...javascripts/feature_flags/store/gitlab_user_list/index.js
+1
-1
app/assets/javascripts/feature_flags/store/helpers.js
app/assets/javascripts/feature_flags/store/helpers.js
+17
-17
app/assets/javascripts/feature_flags/store/index/actions.js
app/assets/javascripts/feature_flags/store/index/actions.js
+3
-3
app/assets/javascripts/feature_flags/store/index/index.js
app/assets/javascripts/feature_flags/store/index/index.js
+1
-1
app/assets/javascripts/feature_flags/store/index/mutations.js
...assets/javascripts/feature_flags/store/index/mutations.js
+2
-2
app/assets/javascripts/feature_flags/store/new/actions.js
app/assets/javascripts/feature_flags/store/new/actions.js
+1
-1
app/assets/javascripts/feature_flags/store/new/index.js
app/assets/javascripts/feature_flags/store/new/index.js
+1
-1
app/assets/javascripts/feature_flags/utils.js
app/assets/javascripts/feature_flags/utils.js
+1
-1
app/assets/javascripts/feature_highlight/feature_highlight.js
...assets/javascripts/feature_highlight/feature_highlight.js
+1
-1
app/assets/javascripts/feature_highlight/feature_highlight_helper.js
...javascripts/feature_highlight/feature_highlight_helper.js
+1
-1
app/assets/javascripts/file_pickers.js
app/assets/javascripts/file_pickers.js
+1
-1
app/assets/javascripts/files_comment_button.js
app/assets/javascripts/files_comment_button.js
+2
-2
app/assets/javascripts/filterable_list.js
app/assets/javascripts/filterable_list.js
+1
-1
app/assets/javascripts/filtered_search/available_dropdown_mappings.js
...avascripts/filtered_search/available_dropdown_mappings.js
+3
-3
app/assets/javascripts/filtered_search/components/recent_searches_dropdown_content.vue
...ed_search/components/recent_searches_dropdown_content.vue
+3
-3
app/assets/javascripts/filtered_search/dropdown_ajax_filter.js
...ssets/javascripts/filtered_search/dropdown_ajax_filter.js
+1
-1
app/assets/javascripts/filtered_search/dropdown_emoji.js
app/assets/javascripts/filtered_search/dropdown_emoji.js
+2
-2
app/assets/javascripts/filtered_search/dropdown_hint.js
app/assets/javascripts/filtered_search/dropdown_hint.js
+1
-1
app/assets/javascripts/filtered_search/dropdown_non_user.js
app/assets/javascripts/filtered_search/dropdown_non_user.js
+1
-1
app/assets/javascripts/filtered_search/dropdown_utils.js
app/assets/javascripts/filtered_search/dropdown_utils.js
+6
-6
app/assets/javascripts/filtered_search/filtered_search_dropdown.js
...s/javascripts/filtered_search/filtered_search_dropdown.js
+3
-3
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
...ripts/filtered_search/filtered_search_dropdown_manager.js
+1
-1
app/assets/javascripts/filtered_search/filtered_search_manager.js
...ts/javascripts/filtered_search/filtered_search_manager.js
+14
-14
app/assets/javascripts/filtered_search/filtered_search_token_keys.js
...javascripts/filtered_search/filtered_search_token_keys.js
+6
-6
app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js
...ascripts/filtered_search/filtered_search_visual_tokens.js
+3
-3
app/assets/javascripts/filtered_search/issuable_filtered_search_token_keys.js
...ts/filtered_search/issuable_filtered_search_token_keys.js
+1
-1
No files found.
.prettierignore
View file @
06ee932e
...
...
@@ -162,43 +162,6 @@ app/assets/javascripts/ci_variable_list/ci_variable_list.js
app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue
app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue
## modest-mayer
app/assets/javascripts/experimental_flags.js
app/assets/javascripts/feature_flags/components/edit_feature_flag.vue
app/assets/javascripts/feature_flags/components/feature_flags.vue
app/assets/javascripts/feature_flags/components/feature_flags_table.vue
app/assets/javascripts/feature_flags/components/form.vue
app/assets/javascripts/feature_flags/components/new_feature_flag.vue
app/assets/javascripts/feature_flags/store/edit/actions.js
app/assets/javascripts/feature_flags/store/edit/index.js
app/assets/javascripts/feature_flags/store/gitlab_user_list/actions.js
app/assets/javascripts/feature_flags/store/gitlab_user_list/index.js
app/assets/javascripts/feature_flags/store/helpers.js
app/assets/javascripts/feature_flags/store/index/actions.js
app/assets/javascripts/feature_flags/store/index/index.js
app/assets/javascripts/feature_flags/store/index/mutations.js
app/assets/javascripts/feature_flags/store/new/actions.js
app/assets/javascripts/feature_flags/store/new/index.js
app/assets/javascripts/feature_flags/utils.js
app/assets/javascripts/feature_highlight/feature_highlight.js
app/assets/javascripts/feature_highlight/feature_highlight_helper.js
app/assets/javascripts/file_pickers.js
app/assets/javascripts/files_comment_button.js
app/assets/javascripts/filterable_list.js
app/assets/javascripts/filtered_search/available_dropdown_mappings.js
app/assets/javascripts/filtered_search/components/recent_searches_dropdown_content.vue
app/assets/javascripts/filtered_search/dropdown_ajax_filter.js
app/assets/javascripts/filtered_search/dropdown_emoji.js
app/assets/javascripts/filtered_search/dropdown_hint.js
app/assets/javascripts/filtered_search/dropdown_non_user.js
app/assets/javascripts/filtered_search/dropdown_utils.js
app/assets/javascripts/filtered_search/filtered_search_dropdown.js
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
app/assets/javascripts/filtered_search/filtered_search_manager.js
app/assets/javascripts/filtered_search/filtered_search_token_keys.js
app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js
app/assets/javascripts/filtered_search/issuable_filtered_search_token_keys.js
## stoic-merkle
app/assets/javascripts/filtered_search/stores/recent_searches_store.js
app/assets/javascripts/filtered_search/visual_token_value.js
...
...
app/assets/javascripts/experimental_flags.js
View file @
06ee932e
...
...
@@ -2,7 +2,7 @@ import $ from 'jquery';
import
Cookies
from
'
js-cookie
'
;
export
default
()
=>
{
$
(
'
.js-experiment-feature-toggle
'
).
on
(
'
change
'
,
e
=>
{
$
(
'
.js-experiment-feature-toggle
'
).
on
(
'
change
'
,
(
e
)
=>
{
const
el
=
e
.
target
;
Cookies
.
set
(
el
.
name
,
el
.
value
,
{
...
...
app/assets/javascripts/feature_flags/components/edit_feature_flag.vue
View file @
06ee932e
...
...
@@ -122,7 +122,7 @@ export default {
:submit-text=
"__('Save changes')"
:active=
"active"
:version=
"version"
@
handleSubmit=
"
data
=> updateFeatureFlag(data)"
@
handleSubmit=
"
(data)
=> updateFeatureFlag(data)"
/>
</
template
>
</div>
...
...
app/assets/javascripts/feature_flags/components/feature_flags.vue
View file @
06ee932e
...
...
@@ -133,7 +133,7 @@ export default {
},
updateFeatureFlagOptions
(
parameters
)
{
const
queryString
=
Object
.
keys
(
parameters
)
.
map
(
parameter
=>
{
.
map
(
(
parameter
)
=>
{
const
value
=
parameters
[
parameter
];
return
`
${
parameter
}
=
${
encodeURIComponent
(
value
)}
`
;
})
...
...
app/assets/javascripts/feature_flags/components/feature_flags_table.vue
View file @
06ee932e
...
...
@@ -100,7 +100,7 @@ export default {
return
featureFlag
.
iid
?
`^
${
featureFlag
.
iid
}
`
:
''
;
},
canDeleteFlag
(
flag
)
{
return
!
this
.
permissions
||
(
flag
.
scopes
||
[]).
every
(
scope
=>
scope
.
can_update
);
return
!
this
.
permissions
||
(
flag
.
scopes
||
[]).
every
(
(
scope
)
=>
scope
.
can_update
);
},
setDeleteModalData
(
featureFlag
)
{
this
.
deleteFeatureFlagUrl
=
featureFlag
.
destroy_path
;
...
...
app/assets/javascripts/feature_flags/components/form.vue
View file @
06ee932e
...
...
@@ -117,7 +117,7 @@ export default {
formDescription
:
this
.
description
,
// operate on a clone to avoid mutating props
formScopes
:
this
.
scopes
.
map
(
s
=>
({
...
s
})),
formScopes
:
this
.
scopes
.
map
(
(
s
)
=>
({
...
s
})),
formStrategies
:
cloneDeep
(
this
.
strategies
),
newScope
:
''
,
...
...
@@ -125,13 +125,13 @@ export default {
},
computed
:
{
filteredScopes
()
{
return
this
.
formScopes
.
filter
(
scope
=>
!
scope
.
shouldBeDestroyed
);
return
this
.
formScopes
.
filter
(
(
scope
)
=>
!
scope
.
shouldBeDestroyed
);
},
filteredStrategies
()
{
return
this
.
formStrategies
.
filter
(
s
=>
!
s
.
shouldBeDestroyed
);
return
this
.
formStrategies
.
filter
(
(
s
)
=>
!
s
.
shouldBeDestroyed
);
},
canUpdateFlag
()
{
return
!
this
.
permissionsFlag
||
(
this
.
formScopes
||
[]).
every
(
scope
=>
scope
.
canUpdate
);
return
!
this
.
permissionsFlag
||
(
this
.
formScopes
||
[]).
every
(
(
scope
)
=>
scope
.
canUpdate
);
},
permissionsFlag
()
{
return
this
.
glFeatures
.
featureFlagPermissions
;
...
...
@@ -167,7 +167,7 @@ export default {
if
(
isNumber
(
s
.
id
))
{
Vue
.
set
(
s
,
'
shouldBeDestroyed
'
,
true
);
}
else
{
this
.
formStrategies
=
this
.
formStrategies
.
filter
(
strategy
=>
strategy
!==
s
);
this
.
formStrategies
=
this
.
formStrategies
.
filter
(
(
strategy
)
=>
strategy
!==
s
);
}
},
...
...
@@ -188,7 +188,7 @@ export default {
*/
removeScope
(
scope
)
{
if
(
isString
(
scope
.
id
)
&&
scope
.
id
.
startsWith
(
INTERNAL_ID_PREFIX
))
{
this
.
formScopes
=
this
.
formScopes
.
filter
(
s
=>
s
!==
scope
);
this
.
formScopes
=
this
.
formScopes
.
filter
(
(
s
)
=>
s
!==
scope
);
}
else
{
Vue
.
set
(
scope
,
'
shouldBeDestroyed
'
,
true
);
}
...
...
@@ -387,9 +387,9 @@ export default {
class=
"col-12"
:value=
"scope.environmentScope"
:disabled=
"!canUpdateScope(scope) || scope.environmentScope !== ''"
@
selectEnvironment=
"
env
=> (scope.environmentScope = env)"
@
createClicked=
"
env
=> (scope.environmentScope = env)"
@
clearInput=
"
env
=> (scope.environmentScope = '')"
@
selectEnvironment=
"
(env)
=> (scope.environmentScope = env)"
@
createClicked=
"
(env)
=> (scope.environmentScope = env)"
@
clearInput=
"
(env)
=> (scope.environmentScope = '')"
/>
<gl-badge
v-if=
"permissionsFlag && scope.protected"
variant=
"success"
>
...
...
@@ -406,7 +406,7 @@ export default {
<toggle-button
:value=
"scope.active"
:disabled-input=
"!active || !canUpdateScope(scope)"
@
change=
"
status
=> (scope.active = status)"
@
change=
"
(status)
=> (scope.active = status)"
/>
</div>
</div>
...
...
@@ -524,8 +524,8 @@ export default {
<environments-dropdown
class=
"js-new-scope-name col-12"
:value=
"newScope"
@
selectEnvironment=
"
env
=> createNewScope({ environmentScope: env })"
@
createClicked=
"
env
=> createNewScope({ environmentScope: env })"
@
selectEnvironment=
"
(env)
=> createNewScope({ environmentScope: env })"
@
createClicked=
"
(env)
=> createNewScope({ environmentScope: env })"
/>
</div>
</div>
...
...
app/assets/javascripts/feature_flags/components/new_feature_flag.vue
View file @
06ee932e
...
...
@@ -71,7 +71,7 @@ export default {
:scopes=
"scopes"
:strategies=
"strategies"
:version=
"version"
@
handleSubmit=
"
data
=> createFeatureFlag(data)"
@
handleSubmit=
"
(data)
=> createFeatureFlag(data)"
/>
</div>
</
template
>
app/assets/javascripts/feature_flags/store/edit/actions.js
View file @
06ee932e
...
...
@@ -29,7 +29,7 @@ export const updateFeatureFlag = ({ state, dispatch }, params) => {
dispatch
(
'
receiveUpdateFeatureFlagSuccess
'
);
visitUrl
(
state
.
path
);
})
.
catch
(
error
=>
dispatch
(
'
receiveUpdateFeatureFlagError
'
,
error
.
response
.
data
));
.
catch
(
(
error
)
=>
dispatch
(
'
receiveUpdateFeatureFlagError
'
,
error
.
response
.
data
));
};
export
const
requestUpdateFeatureFlag
=
({
commit
})
=>
commit
(
types
.
REQUEST_UPDATE_FEATURE_FLAG
);
...
...
app/assets/javascripts/feature_flags/store/edit/index.js
View file @
06ee932e
...
...
@@ -4,7 +4,7 @@ import state from './state';
import
*
as
actions
from
'
./actions
'
;
import
mutations
from
'
./mutations
'
;
export
default
data
=>
export
default
(
data
)
=>
new
Vuex
.
Store
({
actions
,
mutations
,
...
...
app/assets/javascripts/feature_flags/store/gitlab_user_list/actions.js
View file @
06ee932e
import
Api
from
'
~/api
'
;
import
*
as
types
from
'
./mutation_types
'
;
const
getErrorMessages
=
error
=>
[].
concat
(
error
?.
response
?.
data
?.
message
??
error
.
message
);
const
getErrorMessages
=
(
error
)
=>
[].
concat
(
error
?.
response
?.
data
?.
message
??
error
.
message
);
export
const
fetchUserLists
=
({
commit
,
state
:
{
filter
,
projectId
}
})
=>
{
commit
(
types
.
FETCH_USER_LISTS
);
return
Api
.
searchFeatureFlagUserLists
(
projectId
,
filter
)
.
then
(({
data
})
=>
commit
(
types
.
RECEIVE_USER_LISTS_SUCCESS
,
data
))
.
catch
(
error
=>
commit
(
types
.
RECEIVE_USER_LISTS_ERROR
,
getErrorMessages
(
error
)));
.
catch
(
(
error
)
=>
commit
(
types
.
RECEIVE_USER_LISTS_ERROR
,
getErrorMessages
(
error
)));
};
export
const
setFilter
=
({
commit
,
dispatch
},
filter
)
=>
{
...
...
app/assets/javascripts/feature_flags/store/gitlab_user_list/index.js
View file @
06ee932e
...
...
@@ -3,7 +3,7 @@ import mutations from './mutations';
import
*
as
actions
from
'
./actions
'
;
import
*
as
getters
from
'
./getters
'
;
export
default
data
=>
({
export
default
(
data
)
=>
({
state
:
state
(
data
),
actions
,
getters
,
...
...
app/assets/javascripts/feature_flags/store/helpers.js
View file @
06ee932e
...
...
@@ -17,16 +17,16 @@ import {
* objects that is easier/nicer to bind to in Vue.
* @param {Array} scopesFromRails An array of scope objects fetched from the API
*/
export
const
mapToScopesViewModel
=
scopesFromRails
=>
(
scopesFromRails
||
[]).
map
(
s
=>
{
export
const
mapToScopesViewModel
=
(
scopesFromRails
)
=>
(
scopesFromRails
||
[]).
map
(
(
s
)
=>
{
const
percentStrategy
=
(
s
.
strategies
||
[]).
find
(
strat
=>
strat
.
name
===
ROLLOUT_STRATEGY_PERCENT_ROLLOUT
,
(
strat
)
=>
strat
.
name
===
ROLLOUT_STRATEGY_PERCENT_ROLLOUT
,
);
const
rolloutPercentage
=
fetchPercentageParams
(
percentStrategy
)
||
DEFAULT_PERCENT_ROLLOUT
;
const
userStrategy
=
(
s
.
strategies
||
[]).
find
(
strat
=>
strat
.
name
===
ROLLOUT_STRATEGY_USER_ID
,
(
strat
)
=>
strat
.
name
===
ROLLOUT_STRATEGY_USER_ID
,
);
const
rolloutStrategy
=
...
...
@@ -36,7 +36,7 @@ export const mapToScopesViewModel = scopesFromRails =>
const
rolloutUserIds
=
(
fetchUserIdParams
(
userStrategy
)
||
''
)
.
split
(
'
,
'
)
.
filter
(
id
=>
id
)
.
filter
(
(
id
)
=>
id
)
.
join
(
'
,
'
);
return
{
...
...
@@ -59,8 +59,8 @@ export const mapToScopesViewModel = scopesFromRails =>
* the shape that the Rails API expects.
* @param {Array} scopesFromVue An array of scope objects from the Vue component
*/
export
const
mapFromScopesViewModel
=
params
=>
{
const
scopes
=
(
params
.
scopes
||
[]).
map
(
s
=>
{
export
const
mapFromScopesViewModel
=
(
params
)
=>
{
const
scopes
=
(
params
.
scopes
||
[]).
map
(
(
s
)
=>
{
const
parameters
=
{};
if
(
s
.
rolloutStrategy
===
ROLLOUT_STRATEGY_PERCENT_ROLLOUT
)
{
parameters
.
groupId
=
PERCENT_ROLLOUT_GROUP_ID
;
...
...
@@ -145,32 +145,32 @@ export const createNewEnvironmentScope = (overrides = {}, featureFlagPermissions
return
newScope
;
};
const
mapStrategyScopesToRails
=
scopes
=>
const
mapStrategyScopesToRails
=
(
scopes
)
=>
scopes
.
length
===
0
?
[{
environment_scope
:
'
*
'
}]
:
scopes
.
map
(
s
=>
({
:
scopes
.
map
(
(
s
)
=>
({
id
:
s
.
id
,
_destroy
:
s
.
shouldBeDestroyed
,
environment_scope
:
s
.
environmentScope
,
}));
const
mapStrategyScopesToView
=
scopes
=>
scopes
.
map
(
s
=>
({
const
mapStrategyScopesToView
=
(
scopes
)
=>
scopes
.
map
(
(
s
)
=>
({
id
:
s
.
id
,
// eslint-disable-next-line no-underscore-dangle
shouldBeDestroyed
:
Boolean
(
s
.
_destroy
),
environmentScope
:
s
.
environment_scope
,
}));
const
mapStrategiesParametersToViewModel
=
params
=>
{
const
mapStrategiesParametersToViewModel
=
(
params
)
=>
{
if
(
params
.
userIds
)
{
return
{
...
params
,
userIds
:
params
.
userIds
.
split
(
'
,
'
).
join
(
'
,
'
)
};
}
return
params
;
};
export
const
mapStrategiesToViewModel
=
strategiesFromRails
=>
(
strategiesFromRails
||
[]).
map
(
s
=>
({
export
const
mapStrategiesToViewModel
=
(
strategiesFromRails
)
=>
(
strategiesFromRails
||
[]).
map
(
(
s
)
=>
({
id
:
s
.
id
,
name
:
s
.
name
,
parameters
:
mapStrategiesParametersToViewModel
(
s
.
parameters
),
...
...
@@ -180,14 +180,14 @@ export const mapStrategiesToViewModel = strategiesFromRails =>
scopes
:
mapStrategyScopesToView
(
s
.
scopes
),
}));
const
mapStrategiesParametersToRails
=
params
=>
{
const
mapStrategiesParametersToRails
=
(
params
)
=>
{
if
(
params
.
userIds
)
{
return
{
...
params
,
userIds
:
params
.
userIds
.
replace
(
/
\s
*,
\s
*/g
,
'
,
'
)
};
}
return
params
;
};
const
mapStrategyToRails
=
strategy
=>
{
const
mapStrategyToRails
=
(
strategy
)
=>
{
const
mappedStrategy
=
{
id
:
strategy
.
id
,
name
:
strategy
.
name
,
...
...
@@ -202,7 +202,7 @@ const mapStrategyToRails = strategy => {
return
mappedStrategy
;
};
export
const
mapStrategiesToRails
=
params
=>
({
export
const
mapStrategiesToRails
=
(
params
)
=>
({
operations_feature_flag
:
{
name
:
params
.
name
,
description
:
params
.
description
,
...
...
app/assets/javascripts/feature_flags/store/index/actions.js
View file @
06ee932e
...
...
@@ -12,7 +12,7 @@ export const fetchFeatureFlags = ({ state, dispatch }) => {
.
get
(
state
.
endpoint
,
{
params
:
state
.
options
,
})
.
then
(
response
=>
.
then
(
(
response
)
=>
dispatch
(
'
receiveFeatureFlagsSuccess
'
,
{
data
:
response
.
data
||
{},
headers
:
response
.
headers
,
...
...
@@ -46,7 +46,7 @@ export const toggleFeatureFlag = ({ dispatch }, flag) => {
.
put
(
flag
.
update_path
,
{
operations_feature_flag
:
flag
,
})
.
then
(
response
=>
dispatch
(
'
receiveUpdateFeatureFlagSuccess
'
,
response
.
data
))
.
then
(
(
response
)
=>
dispatch
(
'
receiveUpdateFeatureFlagSuccess
'
,
response
.
data
))
.
catch
(()
=>
dispatch
(
'
receiveUpdateFeatureFlagError
'
,
flag
.
id
));
};
...
...
@@ -62,7 +62,7 @@ export const deleteUserList = ({ state, dispatch }, list) => {
return
Api
.
deleteFeatureFlagUserList
(
state
.
projectId
,
list
.
iid
)
.
then
(()
=>
dispatch
(
'
fetchUserLists
'
))
.
catch
(
error
=>
.
catch
(
(
error
)
=>
dispatch
(
'
receiveDeleteUserListError
'
,
{
list
,
error
:
error
?.
response
?.
data
??
error
,
...
...
app/assets/javascripts/feature_flags/store/index/index.js
View file @
06ee932e
...
...
@@ -3,7 +3,7 @@ import state from './state';
import
*
as
actions
from
'
./actions
'
;
import
mutations
from
'
./mutations
'
;
export
default
data
=>
export
default
(
data
)
=>
new
Vuex
.
Store
({
actions
,
mutations
,
...
...
app/assets/javascripts/feature_flags/store/index/mutations.js
View file @
06ee932e
...
...
@@ -4,7 +4,7 @@ import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';
import
{
FEATURE_FLAG_SCOPE
,
USER_LIST_SCOPE
}
from
'
../../constants
'
;
import
{
mapToScopesViewModel
}
from
'
../helpers
'
;
const
mapFlag
=
flag
=>
({
...
flag
,
scopes
:
mapToScopesViewModel
(
flag
.
scopes
||
[])
});
const
mapFlag
=
(
flag
)
=>
({
...
flag
,
scopes
:
mapToScopesViewModel
(
flag
.
scopes
||
[])
});
const
updateFlag
=
(
state
,
flag
)
=>
{
const
index
=
state
[
FEATURE_FLAG_SCOPE
].
findIndex
(({
id
})
=>
id
===
flag
.
id
);
...
...
@@ -94,7 +94,7 @@ export default {
updateFlag
(
state
,
{
...
flag
,
active
:
!
flag
.
active
});
},
[
types
.
REQUEST_DELETE_USER_LIST
](
state
,
list
)
{
state
.
userLists
=
state
.
userLists
.
filter
(
l
=>
l
!==
list
);
state
.
userLists
=
state
.
userLists
.
filter
(
(
l
)
=>
l
!==
list
);
},
[
types
.
RECEIVE_DELETE_USER_LIST_ERROR
](
state
,
{
error
,
list
})
{
state
.
isLoading
=
false
;
...
...
app/assets/javascripts/feature_flags/store/new/actions.js
View file @
06ee932e
...
...
@@ -27,7 +27,7 @@ export const createFeatureFlag = ({ state, dispatch }, params) => {
dispatch
(
'
receiveCreateFeatureFlagSuccess
'
);
visitUrl
(
state
.
path
);
})
.
catch
(
error
=>
dispatch
(
'
receiveCreateFeatureFlagError
'
,
error
.
response
.
data
));
.
catch
(
(
error
)
=>
dispatch
(
'
receiveCreateFeatureFlagError
'
,
error
.
response
.
data
));
};
export
const
requestCreateFeatureFlag
=
({
commit
})
=>
commit
(
types
.
REQUEST_CREATE_FEATURE_FLAG
);
...
...
app/assets/javascripts/feature_flags/store/new/index.js
View file @
06ee932e
...
...
@@ -4,7 +4,7 @@ import state from './state';
import
*
as
actions
from
'
./actions
'
;
import
mutations
from
'
./mutations
'
;
export
default
data
=>
export
default
(
data
)
=>
new
Vuex
.
Store
({
actions
,
mutations
,
...
...
app/assets/javascripts/feature_flags/utils.js
View file @
06ee932e
...
...
@@ -48,7 +48,7 @@ const badgeTextByType = {
const
scopeName
=
({
environment_scope
:
scope
})
=>
scope
===
ALL_ENVIRONMENTS_NAME
?
s__
(
'
FeatureFlags|All Environments
'
)
:
scope
;
export
const
labelForStrategy
=
strategy
=>
{
export
const
labelForStrategy
=
(
strategy
)
=>
{
const
{
name
,
parameters
}
=
badgeTextByType
[
strategy
.
name
];
if
(
parameters
)
{
...
...
app/assets/javascripts/feature_highlight/feature_highlight.js
View file @
06ee932e
...
...
@@ -31,7 +31,7 @@ export function setupFeatureHighlightPopover(id, debounceTimeout = 300) {
.
removeAttr
(
'
disabled
'
);
}
const
getPriority
=
e
=>
parseInt
(
e
.
dataset
.
highlightPriority
,
10
)
||
0
;
const
getPriority
=
(
e
)
=>
parseInt
(
e
.
dataset
.
highlightPriority
,
10
)
||
0
;
export
function
findHighestPriorityFeature
()
{
let
priorityFeature
;
...
...
app/assets/javascripts/feature_highlight/feature_highlight_helper.js
View file @
06ee932e
...
...
@@ -5,7 +5,7 @@ import { deprecatedCreateFlash as Flash } from '../flash';
import
LazyLoader
from
'
../lazy_loader
'
;
import
{
togglePopover
}
from
'
../shared/popover
'
;
export
const
getSelector
=
highlightId
=>
`.js-feature-highlight[data-highlight=
${
highlightId
}
]`
;
export
const
getSelector
=
(
highlightId
)
=>
`.js-feature-highlight[data-highlight=
${
highlightId
}
]`
;
export
function
dismiss
(
highlightId
)
{
axios
...
...
app/assets/javascripts/file_pickers.js
View file @
06ee932e
export
default
function
initFilePickers
()
{
const
filePickers
=
document
.
querySelectorAll
(
'
.js-filepicker
'
);
filePickers
.
forEach
(
filePicker
=>
{
filePickers
.
forEach
(
(
filePicker
)
=>
{
const
button
=
filePicker
.
querySelector
(
'
.js-filepicker-button
'
);
button
.
addEventListener
(
'
click
'
,
()
=>
{
...
...
app/assets/javascripts/files_comment_button.js
View file @
06ee932e
...
...
@@ -33,8 +33,8 @@ export default {
if
(
this
.
userCanCreateNote
)
{
$diffFile
.
on
(
'
mouseover
'
,
LINE_COLUMN_CLASSES
,
e
=>
this
.
showButton
(
this
.
isParallelView
,
e
))
.
on
(
'
mouseleave
'
,
LINE_COLUMN_CLASSES
,
e
=>
this
.
hideButton
(
this
.
isParallelView
,
e
));
.
on
(
'
mouseover
'
,
LINE_COLUMN_CLASSES
,
(
e
)
=>
this
.
showButton
(
this
.
isParallelView
,
e
))
.
on
(
'
mouseleave
'
,
LINE_COLUMN_CLASSES
,
(
e
)
=>
this
.
hideButton
(
this
.
isParallelView
,
e
));
}
},
...
...
app/assets/javascripts/filterable_list.js
View file @
06ee932e
...
...
@@ -72,7 +72,7 @@ export default class FilterableList {
.
get
(
this
.
getFilterEndpoint
(),
{
params
,
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
this
.
onFilterSuccess
(
res
,
params
);
this
.
onFilterComplete
();
})
...
...
app/assets/javascripts/filtered_search/available_dropdown_mappings.js
View file @
06ee932e
...
...
@@ -50,7 +50,7 @@ export default class AvailableDropdownMappings {
},
};
supportedTokens
.
forEach
(
type
=>
{
supportedTokens
.
forEach
(
(
type
)
=>
{
if
(
availableMappings
[
type
])
{
allowedMappings
[
type
]
=
availableMappings
[
type
];
}
...
...
@@ -99,7 +99,7 @@ export default class AvailableDropdownMappings {
// The DropdownNonUser class is hardcoded to look for and display a
// "title" property, so we need to add this property to each release object
preprocessing
:
releases
=>
releases
.
map
(
r
=>
({
...
r
,
title
:
r
.
tag
})),
preprocessing
:
(
releases
)
=>
releases
.
map
((
r
)
=>
({
...
r
,
title
:
r
.
tag
})),
},
element
:
this
.
container
.
querySelector
(
'
#js-dropdown-release
'
),
},
...
...
@@ -162,7 +162,7 @@ export default class AvailableDropdownMappings {
extraArguments
:
{
endpoint
:
this
.
getEnvironmentsEndpoint
(),
symbol
:
''
,
preprocessing
:
data
=>
data
.
map
(
env
=>
({
title
:
env
})),
preprocessing
:
(
data
)
=>
data
.
map
((
env
)
=>
({
title
:
env
})),
},
element
:
this
.
container
.
querySelector
(
'
#js-dropdown-environment
'
),
},
...
...
app/assets/javascripts/filtered_search/components/recent_searches_dropdown_content.vue
View file @
06ee932e
...
...
@@ -28,16 +28,16 @@ export default {
* fix by ignoring non-string recents while in Epic page.
*/
compatibleItems
()
{
return
this
.
items
.
filter
(
item
=>
typeof
item
===
'
string
'
);
return
this
.
items
.
filter
(
(
item
)
=>
typeof
item
===
'
string
'
);
},
processedItems
()
{
return
this
.
compatibleItems
.
map
(
item
=>
{
return
this
.
compatibleItems
.
map
(
(
item
)
=>
{
const
{
tokens
,
searchToken
}
=
FilteredSearchTokenizer
.
processTokens
(
item
,
this
.
allowedKeys
,
);
const
resultantTokens
=
tokens
.
map
(
token
=>
({
const
resultantTokens
=
tokens
.
map
(
(
token
)
=>
({
prefix
:
`
${
token
.
key
}
:`
,
operator
:
token
.
operator
,
suffix
:
`
${
token
.
symbol
}${
token
.
value
}
`
,
...
...
app/assets/javascripts/filtered_search/dropdown_ajax_filter.js
View file @
06ee932e
...
...
@@ -33,7 +33,7 @@ export default class DropdownAjaxFilter extends FilteredSearchDropdown {
}
itemClicked
(
e
)
{
super
.
itemClicked
(
e
,
selected
=>
{
super
.
itemClicked
(
e
,
(
selected
)
=>
{
const
title
=
selected
.
querySelector
(
'
.dropdown-light-content
'
).
innerText
.
trim
();
return
DropdownUtils
.
getEscapedText
(
title
);
...
...
app/assets/javascripts/filtered_search/dropdown_emoji.js
View file @
06ee932e
...
...
@@ -53,7 +53,7 @@ export default class DropdownEmoji extends FilteredSearchDropdown {
}
itemClicked
(
e
)
{
super
.
itemClicked
(
e
,
selected
=>
{
super
.
itemClicked
(
e
,
(
selected
)
=>
{
const
name
=
selected
.
querySelector
(
'
.js-data-value
'
).
innerText
.
trim
();
return
DropdownUtils
.
getEscapedText
(
name
);
});
...
...
@@ -69,7 +69,7 @@ export default class DropdownEmoji extends FilteredSearchDropdown {
// Replace empty gl-emoji tag to real content
const
dropdownItems
=
[...
this
.
dropdown
.
querySelectorAll
(
'
.filter-dropdown-item
'
)];
dropdownItems
.
forEach
(
dropdownItem
=>
{
dropdownItems
.
forEach
(
(
dropdownItem
)
=>
{
const
valueElement
=
dropdownItem
.
querySelector
(
'
.js-data-value
'
);
if
(
valueElement
!==
null
)
{
const
name
=
valueElement
.
innerText
;
...
...
app/assets/javascripts/filtered_search/dropdown_hint.js
View file @
06ee932e
...
...
@@ -83,7 +83,7 @@ export default class DropdownHint extends FilteredSearchDropdown {
const
dropdownData
=
this
.
tokenKeys
.
get
()
.
map
(
tokenKey
=>
({
.
map
(
(
tokenKey
)
=>
({
icon
:
`
${
gon
.
sprite_icons
}
#
${
tokenKey
.
icon
}
`
,
hint
:
tokenKey
.
key
,
tag
:
`:
${
tokenKey
.
tag
}
`
,
...
...
app/assets/javascripts/filtered_search/dropdown_non_user.js
View file @
06ee932e
...
...
@@ -30,7 +30,7 @@ export default class DropdownNonUser extends FilteredSearchDropdown {
}
itemClicked
(
e
)
{
super
.
itemClicked
(
e
,
selected
=>
{
super
.
itemClicked
(
e
,
(
selected
)
=>
{
const
title
=
selected
.
querySelector
(
'
.js-data-value
'
).
innerText
.
trim
();
return
`
${
this
.
symbol
}${
DropdownUtils
.
getEscapedText
(
title
)}
`
;
});
...
...
app/assets/javascripts/filtered_search/dropdown_utils.js
View file @
06ee932e
...
...
@@ -61,7 +61,7 @@ export default class DropdownUtils {
const
{
lastToken
,
tokens
}
=
FilteredSearchTokenizer
.
processTokens
(
searchInput
,
allowedKeys
);
const
lastKey
=
lastToken
.
key
||
lastToken
||
''
;
const
allowMultiple
=
item
.
type
===
'
array
'
;
const
itemInExistingTokens
=
tokens
.
some
(
t
=>
t
.
key
===
item
.
hint
);
const
itemInExistingTokens
=
tokens
.
some
(
(
t
)
=>
t
.
key
===
item
.
hint
);
const
isSearchItem
=
updatedItem
.
hint
===
'
search
'
;
if
(
isSearchItem
)
{
...
...
@@ -77,7 +77,7 @@ export default class DropdownUtils {
const
tokenName
=
last
(
split
[
0
].
split
(
'
'
));
const
match
=
isSearchItem
?
allowedKeys
.
some
(
key
=>
key
.
startsWith
(
tokenName
.
toLowerCase
()))
?
allowedKeys
.
some
(
(
key
)
=>
key
.
startsWith
(
tokenName
.
toLowerCase
()))
:
updatedItem
.
hint
.
indexOf
(
tokenName
.
toLowerCase
())
===
-
1
;
updatedItem
.
droplab_hidden
=
tokenName
?
match
:
false
;
...
...
@@ -129,12 +129,12 @@ export default class DropdownUtils {
const
values
=
[];
if
(
untilInput
)
{
const
inputIndex
=
tokens
.
findIndex
(
t
=>
t
.
classList
.
contains
(
'
input-token
'
));
const
inputIndex
=
tokens
.
findIndex
(
(
t
)
=>
t
.
classList
.
contains
(
'
input-token
'
));
// Add one to include input-token to the tokens array
tokens
.
splice
(
inputIndex
+
1
);
}
tokens
.
forEach
(
token
=>
{
tokens
.
forEach
(
(
token
)
=>
{
if
(
token
.
classList
.
contains
(
'
js-visual-token
'
))
{
const
name
=
token
.
querySelector
(
'
.name
'
);
const
operatorContainer
=
token
.
querySelector
(
'
.operator
'
);
...
...
@@ -176,7 +176,7 @@ export default class DropdownUtils {
}
});
return
values
.
map
(
value
=>
value
.
trim
()).
join
(
'
'
);
return
values
.
map
(
(
value
)
=>
value
.
trim
()).
join
(
'
'
);
}
static
getSearchInput
(
filteredSearchInput
)
{
...
...
@@ -192,7 +192,7 @@ export default class DropdownUtils {
// Replace all spaces inside quote marks with underscores
// (will continue to match entire string until an end quote is found if any)
// This helps with matching the beginning & end of a token:key
inputValue
=
inputValue
.
replace
(
/
((
'
[^
'
]
*'
{0,1})
|
(
"
[^
"
]
*"
{0,1})
|:
\s
+
)
/g
,
str
=>
inputValue
=
inputValue
.
replace
(
/
((
'
[^
'
]
*'
{0,1})
|
(
"
[^
"
]
*"
{0,1})
|:
\s
+
)
/g
,
(
str
)
=>
str
.
replace
(
/
\s
/g
,
'
_
'
),
);
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown.js
View file @
06ee932e
...
...
@@ -28,7 +28,7 @@ export default class FilteredSearchDropdown {
}
getCurrentHook
()
{
return
this
.
droplab
.
hooks
.
filter
(
h
=>
h
.
id
===
this
.
hookId
)[
0
]
||
null
;
return
this
.
droplab
.
hooks
.
filter
(
(
h
)
=>
h
.
id
===
this
.
hookId
)[
0
]
||
null
;
}
itemClicked
(
e
,
getValueFunction
)
{
...
...
@@ -134,7 +134,7 @@ export default class FilteredSearchDropdown {
if
(
!
data
)
return
;
const
results
=
data
.
map
(
o
=>
{
const
results
=
data
.
map
(
(
o
)
=>
{
const
updated
=
o
;
updated
.
droplab_hidden
=
false
;
return
updated
;
...
...
@@ -157,7 +157,7 @@ export default class FilteredSearchDropdown {
// Iterate over all the static dropdown values,
// then hide `None` and `Any` items.
Array
.
from
(
dropdownEl
.
querySelectorAll
(
'
li[data-value]
'
)).
forEach
(
itemEl
=>
{
Array
.
from
(
dropdownEl
.
querySelectorAll
(
'
li[data-value]
'
)).
forEach
(
(
itemEl
)
=>
{
const
{
dataset
:
{
value
},
}
=
itemEl
;
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
View file @
06ee932e
...
...
@@ -23,7 +23,7 @@ export default class FilteredSearchDropdownManager {
isGroupDecendent
,
filteredSearchTokenKeys
,
})
{
const
removeTrailingSlash
=
url
=>
url
.
replace
(
/
\/
$/
,
''
);
const
removeTrailingSlash
=
(
url
)
=>
url
.
replace
(
/
\/
$/
,
''
);
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
runnerTagsEndpoint
=
removeTrailingSlash
(
runnerTagsEndpoint
);
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js
View file @
06ee932e
...
...
@@ -90,14 +90,14 @@ export default class FilteredSearchManager {
// Fetch recent searches from localStorage
this
.
fetchingRecentSearchesPromise
=
this
.
recentSearchesService
.
fetch
()
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
if
(
error
.
name
===
'
RecentSearchesServiceError
'
)
return
undefined
;
// eslint-disable-next-line no-new
new
Flash
(
__
(
'
An error occurred while parsing recent searches
'
));
// Gracefully fail to empty array
return
[];
})
.
then
(
searches
=>
{
.
then
(
(
searches
)
=>
{
if
(
!
searches
)
{
return
;
}
...
...
@@ -169,7 +169,7 @@ export default class FilteredSearchManager {
if
(
this
.
stateFilters
)
{
this
.
searchStateWrapper
=
this
.
searchState
.
bind
(
this
);
this
.
applyToStateFilters
(
filterEl
=>
{
this
.
applyToStateFilters
(
(
filterEl
)
=>
{
filterEl
.
addEventListener
(
'
click
'
,
this
.
searchStateWrapper
);
});
}
...
...
@@ -177,14 +177,14 @@ export default class FilteredSearchManager {
unbindStateEvents
()
{
if
(
this
.
stateFilters
)
{
this
.
applyToStateFilters
(
filterEl
=>
{
this
.
applyToStateFilters
(
(
filterEl
)
=>
{
filterEl
.
removeEventListener
(
'
click
'
,
this
.
searchStateWrapper
);
});
}
}
applyToStateFilters
(
callback
)
{
this
.
stateFilters
.
querySelectorAll
(
'
a[data-state]
'
).
forEach
(
filterEl
=>
{
this
.
stateFilters
.
querySelectorAll
(
'
a[data-state]
'
).
forEach
(
(
filterEl
)
=>
{
if
(
this
.
states
.
indexOf
(
filterEl
.
dataset
.
state
)
>
-
1
)
{
callback
(
filterEl
);
}
...
...
@@ -263,7 +263,7 @@ export default class FilteredSearchManager {
let
backspaceCount
=
0
;
// closure for keeping track of the number of backspace keystrokes
return
e
=>
{
return
(
e
)
=>
{
// 8 = Backspace Key
// 46 = Delete Key
// Handled by respective backspace-combination check functions
...
...
@@ -447,7 +447,7 @@ export default class FilteredSearchManager {
const
removeElements
=
[];
[].
forEach
.
call
(
this
.
tokensContainer
.
children
,
t
=>
{
[].
forEach
.
call
(
this
.
tokensContainer
.
children
,
(
t
)
=>
{
let
canClearToken
=
t
.
classList
.
contains
(
'
js-visual-token
'
);
if
(
canClearToken
)
{
...
...
@@ -460,7 +460,7 @@ export default class FilteredSearchManager {
}
});
removeElements
.
forEach
(
el
=>
{
removeElements
.
forEach
(
(
el
)
=>
{
el
.
parentElement
.
removeChild
(
el
);
});
...
...
@@ -488,7 +488,7 @@ export default class FilteredSearchManager {
const
{
isLastVisualTokenValid
}
=
FilteredSearchVisualTokens
.
getLastVisualTokenBeforeInput
();
if
(
isLastVisualTokenValid
)
{
tokens
.
forEach
(
t
=>
{
tokens
.
forEach
(
(
t
)
=>
{
input
.
value
=
input
.
value
.
replace
(
`
${
t
.
key
}
:
${
t
.
operator
}${
t
.
symbol
}${
t
.
value
}
`
,
''
);
FilteredSearchVisualTokens
.
addFilterVisualToken
(
...
...
@@ -585,7 +585,7 @@ export default class FilteredSearchManager {
*/
const
notKeyValueRegex
=
new
RegExp
(
/not
\[(\w
+
)\]\[?\]?
=
(
.*
)
/
);
return
params
.
map
(
query
=>
{
return
params
.
map
(
(
query
)
=>
{
// Check if there are matches for `not` operator
const
matches
=
query
.
match
(
notKeyValueRegex
);
if
(
matches
&&
matches
.
length
===
3
)
{
...
...
@@ -624,7 +624,7 @@ export default class FilteredSearchManager {
const
usernameParams
=
this
.
getUsernameParams
();
let
hasFilteredSearch
=
false
;
params
.
forEach
(
p
=>
{
params
.
forEach
(
(
p
)
=>
{
const
split
=
p
.
split
(
'
=
'
);
const
keyParam
=
decodeURIComponent
(
split
[
0
]);
const
value
=
split
[
1
];
...
...
@@ -746,7 +746,7 @@ export default class FilteredSearchManager {
paths
.
push
(
`state=
${
currentState
}
`
);
}
tokens
.
forEach
(
token
=>
{
tokens
.
forEach
(
(
token
)
=>
{
const
condition
=
this
.
filteredSearchTokenKeys
.
searchByConditionKeyValue
(
token
.
key
,
token
.
operator
,
...
...
@@ -795,7 +795,7 @@ export default class FilteredSearchManager {
if
(
searchToken
)
{
const
sanitized
=
searchToken
.
split
(
'
'
)
.
map
(
t
=>
encodeURIComponent
(
t
))
.
map
(
(
t
)
=>
encodeURIComponent
(
t
))
.
join
(
'
+
'
);
paths
.
push
(
`search=
${
sanitized
}
`
);
}
...
...
@@ -817,7 +817,7 @@ export default class FilteredSearchManager {
const
usernamesById
=
{};
try
{
const
attribute
=
this
.
filteredSearchInput
.
getAttribute
(
'
data-username-params
'
);
JSON
.
parse
(
attribute
).
forEach
(
user
=>
{
JSON
.
parse
(
attribute
).
forEach
(
(
user
)
=>
{
usernamesById
[
user
.
id
]
=
user
.
username
;
});
}
catch
(
e
)
{
...
...
app/assets/javascripts/filtered_search/filtered_search_token_keys.js
View file @
06ee932e
...
...
@@ -14,7 +14,7 @@ export default class FilteredSearchTokenKeys {
}
getKeys
()
{
return
this
.
tokenKeys
.
map
(
i
=>
i
.
key
);
return
this
.
tokenKeys
.
map
(
(
i
)
=>
i
.
key
);
}
getAlternatives
()
{
...
...
@@ -36,16 +36,16 @@ export default class FilteredSearchTokenKeys {
}
searchByKey
(
key
)
{
return
this
.
tokenKeys
.
find
(
tokenKey
=>
tokenKey
.
key
===
key
)
||
null
;
return
this
.
tokenKeys
.
find
(
(
tokenKey
)
=>
tokenKey
.
key
===
key
)
||
null
;
}
searchBySymbol
(
symbol
)
{
return
this
.
tokenKeys
.
find
(
tokenKey
=>
tokenKey
.
symbol
===
symbol
)
||
null
;
return
this
.
tokenKeys
.
find
(
(
tokenKey
)
=>
tokenKey
.
symbol
===
symbol
)
||
null
;
}
searchByKeyParam
(
keyParam
)
{
return
(
this
.
tokenKeysWithAlternative
.
find
(
tokenKey
=>
{
this
.
tokenKeysWithAlternative
.
find
(
(
tokenKey
)
=>
{
let
tokenKeyParam
=
tokenKey
.
key
;
// Replace hyphen with underscore to compare keyParam with tokenKeyParam
...
...
@@ -62,13 +62,13 @@ export default class FilteredSearchTokenKeys {
}
searchByConditionUrl
(
url
)
{
return
this
.
conditions
.
find
(
condition
=>
condition
.
url
===
url
)
||
null
;
return
this
.
conditions
.
find
(
(
condition
)
=>
condition
.
url
===
url
)
||
null
;
}
searchByConditionKeyValue
(
key
,
operator
,
value
)
{
return
(
this
.
conditions
.
find
(
condition
=>
(
condition
)
=>
condition
.
tokenKey
===
key
&&
condition
.
operator
===
operator
&&
condition
.
value
.
toLowerCase
()
===
value
.
toLowerCase
(),
...
...
app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js
View file @
06ee932e
...
...
@@ -8,7 +8,7 @@ export default class FilteredSearchVisualTokens {
static
getOperatorToken
(
value
)
{
let
token
=
null
;
FilteredSearchVisualTokens
.
permissibleOperatorValues
.
forEach
(
operatorToken
=>
{
FilteredSearchVisualTokens
.
permissibleOperatorValues
.
forEach
(
(
operatorToken
)
=>
{
if
(
value
.
startsWith
(
operatorToken
))
{
token
=
operatorToken
;
}
...
...
@@ -20,7 +20,7 @@ export default class FilteredSearchVisualTokens {
static
getValueToken
(
value
)
{
let
newValue
=
value
;
FilteredSearchVisualTokens
.
permissibleOperatorValues
.
forEach
(
operatorToken
=>
{
FilteredSearchVisualTokens
.
permissibleOperatorValues
.
forEach
(
(
operatorToken
)
=>
{
if
(
value
.
startsWith
(
operatorToken
))
{
newValue
=
value
.
slice
(
operatorToken
.
length
);
}
...
...
@@ -48,7 +48,7 @@ export default class FilteredSearchVisualTokens {
const
otherTokens
=
FilteredSearchContainer
.
container
.
querySelectorAll
(
'
.js-visual-token .selectable.selected
'
,
);
[].
forEach
.
call
(
otherTokens
,
t
=>
t
.
classList
.
remove
(
'
selected
'
));
[].
forEach
.
call
(
otherTokens
,
(
t
)
=>
t
.
classList
.
remove
(
'
selected
'
));
}
static
selectToken
(
tokenButton
,
forceSelection
=
false
)
{
...
...
app/assets/javascripts/filtered_search/issuable_filtered_search_token_keys.js
View file @
06ee932e
...
...
@@ -150,7 +150,7 @@ export const conditions = flattenDeep(
tokenKey
:
'
my-reaction
'
,
value
:
__
(
'
Any
'
),
},
].
map
(
condition
=>
{
].
map
(
(
condition
)
=>
{
const
[
keyPart
,
valuePart
]
=
condition
.
url
.
split
(
'
=
'
);
const
hasBrackets
=
keyPart
.
includes
(
'
[]
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment