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
3def569d
Commit
3def569d
authored
Aug 03, 2021
by
Jannik Lehmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove obsolete DOMContentLoadedEventListener
parent
b424f289
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
150 additions
and
154 deletions
+150
-154
app/assets/javascripts/pages/import/fogbugz/new_user_map/index.js
...ts/javascripts/pages/import/fogbugz/new_user_map/index.js
+1
-1
app/assets/javascripts/pages/import/fogbugz/status/index.js
app/assets/javascripts/pages/import/fogbugz/status/index.js
+2
-4
app/assets/javascripts/pages/profiles/accounts/show/index.js
app/assets/javascripts/pages/profiles/accounts/show/index.js
+1
-1
app/assets/javascripts/pages/profiles/keys/index.js
app/assets/javascripts/pages/profiles/keys/index.js
+5
-3
app/assets/javascripts/pages/profiles/two_factor_auths/index.js
...sets/javascripts/pages/profiles/two_factor_auths/index.js
+8
-10
app/assets/javascripts/pages/projects/graphs/charts/index.js
app/assets/javascripts/pages/projects/graphs/charts/index.js
+133
-135
No files found.
app/assets/javascripts/pages/import/fogbugz/new_user_map/index.js
View file @
3def569d
import
UsersSelect
from
'
~/users_select
'
;
import
UsersSelect
from
'
~/users_select
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
new
UsersSelect
());
new
UsersSelect
();
// eslint-disable-line no-new
app/assets/javascripts/pages/import/fogbugz/status/index.js
View file @
3def569d
import
mountImportProjectsTable
from
'
~/import_entities/import_projects
'
;
import
mountImportProjectsTable
from
'
~/import_entities/import_projects
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
mountElement
=
document
.
getElementById
(
'
import-projects-mount-element
'
);
const
mountElement
=
document
.
getElementById
(
'
import-projects-mount-element
'
);
mountImportProjectsTable
(
mountElement
);
mountImportProjectsTable
(
mountElement
);
});
app/assets/javascripts/pages/profiles/accounts/show/index.js
View file @
3def569d
import
{
initClose2faSuccessMessage
}
from
'
~/authentication/two_factor_auth
'
;
import
{
initClose2faSuccessMessage
}
from
'
~/authentication/two_factor_auth
'
;
import
initProfileAccount
from
'
~/profile/account
'
;
import
initProfileAccount
from
'
~/profile/account
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
initProfileAccount
);
initProfileAccount
(
);
initClose2faSuccessMessage
();
initClose2faSuccessMessage
();
app/assets/javascripts/pages/profiles/keys/index.js
View file @
3def569d
import
initConfirmModal
from
'
~/confirm_modal
'
;
import
initConfirmModal
from
'
~/confirm_modal
'
;
import
AddSshKeyValidation
from
'
~/profile/add_ssh_key_validation
'
;
import
AddSshKeyValidation
from
'
~/profile/add_ssh_key_validation
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
initConfirmModal
();
initConfirmModal
();
function
initSshKeyValidation
()
{
const
input
=
document
.
querySelector
(
'
.js-add-ssh-key-validation-input
'
);
const
input
=
document
.
querySelector
(
'
.js-add-ssh-key-validation-input
'
);
if
(
!
input
)
return
;
if
(
!
input
)
return
;
...
@@ -18,4 +18,6 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -18,4 +18,6 @@ document.addEventListener('DOMContentLoaded', () => {
confirmSubmit
,
confirmSubmit
,
);
);
addSshKeyValidation
.
register
();
addSshKeyValidation
.
register
();
});
}
initSshKeyValidation
();
app/assets/javascripts/pages/profiles/two_factor_auths/index.js
View file @
3def569d
...
@@ -2,17 +2,15 @@ import { mount2faRegistration } from '~/authentication/mount_2fa';
...
@@ -2,17 +2,15 @@ import { mount2faRegistration } from '~/authentication/mount_2fa';
import
{
initRecoveryCodes
}
from
'
~/authentication/two_factor_auth
'
;
import
{
initRecoveryCodes
}
from
'
~/authentication/two_factor_auth
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
twoFactorNode
=
document
.
querySelector
(
'
.js-two-factor-auth
'
);
const
twoFactorNode
=
document
.
querySelector
(
'
.js-two-factor-auth
'
);
const
skippable
=
twoFactorNode
?
parseBoolean
(
twoFactorNode
.
dataset
.
twoFactorSkippable
)
:
false
;
const
skippable
=
twoFactorNode
?
parseBoolean
(
twoFactorNode
.
dataset
.
twoFactorSkippable
)
:
false
;
if
(
skippable
)
{
if
(
skippable
)
{
const
button
=
`<a class="btn btn-sm btn-warning float-right" data-qa-selector="configure_it_later_button" data-method="patch" href="
${
twoFactorNode
.
dataset
.
two_factor_skip_url
}
">Configure it later</a>`
;
const
button
=
`<a class="btn btn-sm btn-warning float-right" data-qa-selector="configure_it_later_button" data-method="patch" href="
${
twoFactorNode
.
dataset
.
two_factor_skip_url
}
">Configure it later</a>`
;
const
flashAlert
=
document
.
querySelector
(
'
.flash-alert
'
);
const
flashAlert
=
document
.
querySelector
(
'
.flash-alert
'
);
if
(
flashAlert
)
flashAlert
.
insertAdjacentHTML
(
'
beforeend
'
,
button
);
if
(
flashAlert
)
flashAlert
.
insertAdjacentHTML
(
'
beforeend
'
,
button
);
}
}
mount2faRegistration
();
mount2faRegistration
();
});
initRecoveryCodes
();
initRecoveryCodes
();
app/assets/javascripts/pages/projects/graphs/charts/index.js
View file @
3def569d
...
@@ -7,151 +7,149 @@ import SeriesDataMixin from './series_data_mixin';
...
@@ -7,151 +7,149 @@ import SeriesDataMixin from './series_data_mixin';
const
seriesDataToBarData
=
(
raw
)
=>
Object
.
entries
(
raw
).
map
(([
name
,
data
])
=>
({
name
,
data
}));
const
seriesDataToBarData
=
(
raw
)
=>
Object
.
entries
(
raw
).
map
(([
name
,
data
])
=>
({
name
,
data
}));
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
waitForCSSLoaded
(()
=>
{
waitForCSSLoaded
(()
=>
{
const
languagesContainer
=
document
.
getElementById
(
'
js-languages-chart
'
);
const
languagesContainer
=
document
.
getElementById
(
'
js-languages-chart
'
);
const
codeCoverageContainer
=
document
.
getElementById
(
'
js-code-coverage-chart
'
);
const
codeCoverageContainer
=
document
.
getElementById
(
'
js-code-coverage-chart
'
);
const
monthContainer
=
document
.
getElementById
(
'
js-month-chart
'
);
const
monthContainer
=
document
.
getElementById
(
'
js-month-chart
'
);
const
weekdayContainer
=
document
.
getElementById
(
'
js-weekday-chart
'
);
const
weekdayContainer
=
document
.
getElementById
(
'
js-weekday-chart
'
);
const
hourContainer
=
document
.
getElementById
(
'
js-hour-chart
'
);
const
hourContainer
=
document
.
getElementById
(
'
js-hour-chart
'
);
const
LANGUAGE_CHART_HEIGHT
=
300
;
const
LANGUAGE_CHART_HEIGHT
=
300
;
const
reorderWeekDays
=
(
weekDays
,
firstDayOfWeek
=
0
)
=>
{
const
reorderWeekDays
=
(
weekDays
,
firstDayOfWeek
=
0
)
=>
{
if
(
firstDayOfWeek
===
0
)
{
if
(
firstDayOfWeek
===
0
)
{
return
weekDays
;
return
weekDays
;
}
}
return
Object
.
keys
(
weekDays
).
reduce
((
acc
,
dayName
,
idx
,
arr
)
=>
{
return
Object
.
keys
(
weekDays
).
reduce
((
acc
,
dayName
,
idx
,
arr
)
=>
{
const
reorderedDayName
=
arr
[(
idx
+
firstDayOfWeek
)
%
arr
.
length
];
const
reorderedDayName
=
arr
[(
idx
+
firstDayOfWeek
)
%
arr
.
length
];
return
{
return
{
...
acc
,
...
acc
,
[
reorderedDayName
]:
weekDays
[
reorderedDayName
],
[
reorderedDayName
]:
weekDays
[
reorderedDayName
],
};
};
},
{});
},
{});
};
};
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
new
Vue
({
new
Vue
({
el
:
languagesContainer
,
el
:
languagesContainer
,
components
:
{
components
:
{
GlColumnChart
,
GlColumnChart
,
},
data
()
{
return
{
chartData
:
JSON
.
parse
(
languagesContainer
.
dataset
.
chartData
),
};
},
computed
:
{
seriesData
()
{
return
[{
name
:
'
full
'
,
data
:
this
.
chartData
.
map
((
d
)
=>
[
d
.
label
,
d
.
value
])
}];
},
},
data
()
{
},
return
{
render
(
h
)
{
chartData
:
JSON
.
parse
(
languagesContainer
.
dataset
.
chartData
),
return
h
(
GlColumnChart
,
{
};
props
:
{
}
,
bars
:
this
.
seriesData
,
computed
:
{
xAxisTitle
:
__
(
'
Used programming language
'
),
seriesData
()
{
yAxisTitle
:
__
(
'
Percentage
'
),
return
[{
name
:
'
full
'
,
data
:
this
.
chartData
.
map
((
d
)
=>
[
d
.
label
,
d
.
value
])
}];
xAxisType
:
'
category
'
,
},
},
},
attrs
:
{
render
(
h
)
{
height
:
LANGUAGE_CHART_HEIGHT
,
return
h
(
GlColumnChart
,
{
},
props
:
{
});
bars
:
this
.
seriesData
,
},
xAxisTitle
:
__
(
'
Used programming language
'
),
});
yAxisTitle
:
__
(
'
Percentage
'
),
xAxisType
:
'
category
'
,
},
attrs
:
{
height
:
LANGUAGE_CHART_HEIGHT
,
},
});
},
});
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
new
Vue
({
new
Vue
({
el
:
codeCoverageContainer
,
el
:
codeCoverageContainer
,
render
(
h
)
{
render
(
h
)
{
return
h
(
CodeCoverage
,
{
return
h
(
CodeCoverage
,
{
props
:
{
props
:
{
graphEndpoint
:
codeCoverageContainer
.
dataset
?.
graphEndpoint
,
graphEndpoint
:
codeCoverageContainer
.
dataset
?.
graphEndpoint
,
},
},
});
});
},
},
});
});
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
new
Vue
({
new
Vue
({
el
:
monthContainer
,
el
:
monthContainer
,
components
:
{
components
:
{
GlColumnChart
,
GlColumnChart
,
},
},
mixins
:
[
SeriesDataMixin
],
mixins
:
[
SeriesDataMixin
],
data
()
{
data
()
{
return
{
return
{
chartData
:
JSON
.
parse
(
monthContainer
.
dataset
.
chartData
),
chartData
:
JSON
.
parse
(
monthContainer
.
dataset
.
chartData
),
};
};
},
},
render
(
h
)
{
render
(
h
)
{
return
h
(
GlColumnChart
,
{
return
h
(
GlColumnChart
,
{
props
:
{
props
:
{
bars
:
seriesDataToBarData
(
this
.
seriesData
),
bars
:
seriesDataToBarData
(
this
.
seriesData
),
xAxisTitle
:
__
(
'
Day of month
'
),
xAxisTitle
:
__
(
'
Day of month
'
),
yAxisTitle
:
__
(
'
No. of commits
'
),
yAxisTitle
:
__
(
'
No. of commits
'
),
xAxisType
:
'
category
'
,
xAxisType
:
'
category
'
,
},
},
});
});
},
},
});
});
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
new
Vue
({
new
Vue
({
el
:
weekdayContainer
,
el
:
weekdayContainer
,
components
:
{
components
:
{
GlColumnChart
,
GlColumnChart
,
},
},
data
()
{
data
()
{
return
{
return
{
chartData
:
JSON
.
parse
(
weekdayContainer
.
dataset
.
chartData
),
chartData
:
JSON
.
parse
(
weekdayContainer
.
dataset
.
chartData
),
};
};
},
computed
:
{
seriesData
()
{
const
weekDays
=
reorderWeekDays
(
this
.
chartData
,
gon
.
first_day_of_week
);
const
data
=
Object
.
keys
(
weekDays
).
reduce
((
acc
,
key
)
=>
{
acc
.
push
([
key
,
weekDays
[
key
]]);
return
acc
;
},
[]);
return
[{
name
:
'
full
'
,
data
}];
},
},
computed
:
{
},
seriesData
(
)
{
render
(
h
)
{
const
weekDays
=
reorderWeekDays
(
this
.
chartData
,
gon
.
first_day_of_week
);
return
h
(
GlColumnChart
,
{
const
data
=
Object
.
keys
(
weekDays
).
reduce
((
acc
,
key
)
=>
{
props
:
{
acc
.
push
([
key
,
weekDays
[
key
]]);
bars
:
this
.
seriesData
,
return
acc
;
xAxisTitle
:
__
(
'
Weekday
'
),
},
[]);
yAxisTitle
:
__
(
'
No. of commits
'
),
return
[{
name
:
'
full
'
,
data
}];
xAxisType
:
'
category
'
,
},
},
},
});
render
(
h
)
{
},
return
h
(
GlColumnChart
,
{
});
props
:
{
bars
:
this
.
seriesData
,
xAxisTitle
:
__
(
'
Weekday
'
),
yAxisTitle
:
__
(
'
No. of commits
'
),
xAxisType
:
'
category
'
,
},
});
},
});
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
new
Vue
({
new
Vue
({
el
:
hourContainer
,
el
:
hourContainer
,
components
:
{
components
:
{
GlColumnChart
,
GlColumnChart
,
},
},
mixins
:
[
SeriesDataMixin
],
mixins
:
[
SeriesDataMixin
],
data
()
{
data
()
{
return
{
return
{
chartData
:
JSON
.
parse
(
hourContainer
.
dataset
.
chartData
),
chartData
:
JSON
.
parse
(
hourContainer
.
dataset
.
chartData
),
};
};
},
},
render
(
h
)
{
render
(
h
)
{
return
h
(
GlColumnChart
,
{
return
h
(
GlColumnChart
,
{
props
:
{
props
:
{
bars
:
seriesDataToBarData
(
this
.
seriesData
),
bars
:
seriesDataToBarData
(
this
.
seriesData
),
xAxisTitle
:
__
(
'
Hour (UTC)
'
),
xAxisTitle
:
__
(
'
Hour (UTC)
'
),
yAxisTitle
:
__
(
'
No. of commits
'
),
yAxisTitle
:
__
(
'
No. of commits
'
),
xAxisType
:
'
category
'
,
xAxisType
:
'
category
'
,
},
},
});
});
},
},
});
});
});
});
});
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