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
81b9b785
Commit
81b9b785
authored
Jun 28, 2021
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created a isLoggedIn utils method
Converted similar uses to use the utils isLoggedIn method
parent
61b90085
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
7 deletions
+13
-7
app/assets/javascripts/diffs/components/diff_row.vue
app/assets/javascripts/diffs/components/diff_row.vue
+1
-2
app/assets/javascripts/frequent_items/store/actions.js
app/assets/javascripts/frequent_items/store/actions.js
+2
-1
app/assets/javascripts/lib/utils/common_utils.js
app/assets/javascripts/lib/utils/common_utils.js
+2
-0
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+2
-1
app/assets/javascripts/repository/components/blob_content_viewer.vue
...javascripts/repository/components/blob_content_viewer.vue
+2
-1
app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue
...components/subscriptions/sidebar_subscriptions_widget.vue
+2
-1
app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue
...vue_shared/components/markdown/suggestion_diff_header.vue
+2
-1
No files found.
app/assets/javascripts/diffs/components/diff_row.vue
View file @
81b9b785
<
script
>
/* eslint-disable vue/no-v-html */
import
{
memoize
}
from
'
lodash
'
;
import
{
isLoggedIn
}
from
'
~/lib/utils/common_utils
'
;
import
{
PARALLEL_DIFF_VIEW_TYPE
,
CONFLICT_MARKER_THEIR
,
...
...
@@ -16,8 +17,6 @@ import {
import
DiffGutterAvatars
from
'
./diff_gutter_avatars.vue
'
;
import
*
as
utils
from
'
./diff_row_utils
'
;
const
isLoggedIn
=
()
=>
Boolean
(
window
.
gon
?.
current_user_id
);
export
default
{
DiffGutterAvatars
,
CodeQualityGutterIcon
:
()
=>
import
(
'
ee_component/diffs/components/code_quality_gutter_icon.vue
'
),
...
...
app/assets/javascripts/frequent_items/store/actions.js
View file @
81b9b785
import
AccessorUtilities
from
'
~/lib/utils/accessor
'
;
import
{
isLoggedIn
}
from
'
~/lib/utils/common_utils
'
;
import
{
getGroups
,
getProjects
}
from
'
~/rest_api
'
;
import
{
getTopFrequentItems
}
from
'
../utils
'
;
import
*
as
types
from
'
./mutation_types
'
;
...
...
@@ -51,7 +52,7 @@ export const fetchSearchedItems = ({ state, dispatch }, searchQuery) => {
const
params
=
{
simple
:
true
,
per_page
:
20
,
membership
:
Boolean
(
gon
.
current_user_id
),
membership
:
isLoggedIn
(
),
};
let
searchFunction
;
...
...
app/assets/javascripts/lib/utils/common_utils.js
View file @
81b9b785
...
...
@@ -763,3 +763,5 @@ export const isFeatureFlagEnabled = (flag) => window.gon.features?.[flag];
* @returns {Array[String]} Converted array
*/
export
const
convertArrayToCamelCase
=
(
array
)
=>
array
.
map
((
i
)
=>
convertToCamelCase
(
i
));
export
const
isLoggedIn
=
()
=>
Boolean
(
window
.
gon
?.
current_user_id
);
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
81b9b785
...
...
@@ -4,6 +4,7 @@ import { mapActions, mapGetters } from 'vuex';
import
DraftNote
from
'
~/batch_comments/components/draft_note.vue
'
;
import
createFlash
from
'
~/flash
'
;
import
{
clearDraft
,
getDiscussionReplyKey
}
from
'
~/lib/utils/autosave
'
;
import
{
isLoggedIn
}
from
'
~/lib/utils/common_utils
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
diffLineNoteFormMixin
from
'
~/notes/mixins/diff_line_note_form
'
;
import
TimelineEntryItem
from
'
~/vue_shared/components/notes/timeline_entry_item.vue
'
;
...
...
@@ -85,7 +86,7 @@ export default {
return
this
.
getUserData
;
},
isLoggedIn
()
{
return
Boolean
(
gon
.
current_user_id
);
return
isLoggedIn
(
);
},
autosaveKey
()
{
return
getDiscussionReplyKey
(
this
.
firstNote
.
noteable_type
,
this
.
discussion
.
id
);
...
...
app/assets/javascripts/repository/components/blob_content_viewer.vue
View file @
81b9b785
...
...
@@ -5,6 +5,7 @@ import BlobContent from '~/blob/components/blob_content.vue';
import
BlobHeader
from
'
~/blob/components/blob_header.vue
'
;
import
{
SIMPLE_BLOB_VIEWER
,
RICH_BLOB_VIEWER
}
from
'
~/blob/components/constants
'
;
import
createFlash
from
'
~/flash
'
;
import
{
isLoggedIn
}
from
'
~/lib/utils/common_utils
'
;
import
{
__
}
from
'
~/locale
'
;
import
blobInfoQuery
from
'
../queries/blob_info.query.graphql
'
;
import
BlobEdit
from
'
./blob_edit.vue
'
;
...
...
@@ -90,7 +91,7 @@ export default {
},
computed
:
{
isLoggedIn
()
{
return
Boolean
(
gon
.
current_user_id
);
return
isLoggedIn
(
);
},
isLoading
()
{
return
this
.
$apollo
.
queries
.
project
.
loading
;
...
...
app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue
View file @
81b9b785
...
...
@@ -2,6 +2,7 @@
import
{
GlIcon
,
GlLoadingIcon
,
GlToggle
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
createFlash
from
'
~/flash
'
;
import
{
IssuableType
}
from
'
~/issue_show/constants
'
;
import
{
isLoggedIn
}
from
'
~/lib/utils/common_utils
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
SidebarEditableItem
from
'
~/sidebar/components/sidebar_editable_item.vue
'
;
import
{
subscribedQueries
}
from
'
~/sidebar/constants
'
;
...
...
@@ -102,7 +103,7 @@ export default {
});
},
isLoggedIn
()
{
return
Boolean
(
gon
.
current_user_id
);
return
isLoggedIn
(
);
},
canSubscribe
()
{
return
this
.
emailsDisabled
||
!
this
.
isLoggedIn
;
...
...
app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue
View file @
81b9b785
<
script
>
import
{
GlButton
,
GlLoadingIcon
,
GlTooltipDirective
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
isLoggedIn
}
from
'
~/lib/utils/common_utils
'
;
import
{
__
}
from
'
~/locale
'
;
import
ApplySuggestion
from
'
./apply_suggestion.vue
'
;
...
...
@@ -73,7 +74,7 @@ export default {
return
__
(
'
Applying suggestions...
'
);
},
isLoggedIn
()
{
return
Boolean
(
gon
.
current_user_id
);
return
isLoggedIn
(
);
},
},
methods
:
{
...
...
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