Commit 8d6fae2c authored by Phil Hughes's avatar Phil Hughes
Browse files

Removed user profile inline JavaScript

parent 48b976e0
......@@ -409,6 +409,9 @@ import PerformanceBar from './performance_bar';
break;
case 'users:show':
new UserCallout();
new gl.User({
action: document.querySelector('.js-user-profile').dataset.action,
});
break;
case 'admin:conversational_development_index:show':
new UserCallout();
......
/* eslint-disable max-len, space-before-function-paren, no-underscore-dangle, consistent-return, comma-dangle, no-unused-vars, dot-notation, no-new, no-return-assign, camelcase, no-param-reassign, class-methods-use-this */
/* global Calendar */
/*
UserTabs
......@@ -147,7 +148,11 @@ export default class UserTabs {
return;
}
const $calendarWrap = this.$parentEl.find('.user-calendar');
$calendarWrap.load($calendarWrap.data('href'));
$calendarWrap.load($calendarWrap.data('href'), () => {
const calendarEl = document.querySelector('.calendar');
return new Calendar(JSON.parse(calendarEl.dataset.dates), calendarEl.dataset.path);
});
new gl.Activities();
return this.loaded['activity'] = true;
}
......
......@@ -19,7 +19,7 @@
%h5.prepend-top-0
Your New Personal Access Token
.form-group
= text_field_tag 'created-personal-access-token', flash[:personal_access_token], readonly: true, class: "form-control", 'aria-describedby' => "created-personal-access-token-help-block"
= text_field_tag 'created-personal-access-token', flash[:personal_access_token], readonly: true, class: "form-control js-select-on-focus", 'aria-describedby' => "created-personal-access-token-help-block"
= clipboard_button(text: flash[:personal_access_token], title: "Copy personal access token to clipboard", placement: "left")
%span#created-personal-access-token-help-block.help-block.text-danger Make sure you save it - you won't be able to access it again.
......@@ -28,8 +28,3 @@
= render "shared/personal_access_tokens_form", path: profile_personal_access_tokens_path, impersonation: false, token: @personal_access_token, scopes: @scopes
= render "shared/personal_access_tokens_table", impersonation: false, active_tokens: @active_personal_access_tokens, inactive_tokens: @inactive_personal_access_tokens
:javascript
$("#created-personal-access-token").click(function() {
this.select();
});
.clearfix.calendar
.clearfix.calendar{ data: { dates: @activity_dates.to_json, path: user_calendar_activities_path } }
.js-contrib-calendar
.calendar-hint
Summary of issues, merge requests, push events, and comments
:javascript
new Calendar(
#{@activity_dates.to_json},
'#{user_calendar_activities_path}'
);
......@@ -9,7 +9,7 @@
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, user_url(@user, format: :atom), title: "#{@user.name} activity")
.user-profile
.user-profile.js-user-profile{ data: { action: controller.action_name } }
.cover-block.user-cover-block.layout-nav
.cover-controls
- if @user == current_user
......@@ -129,10 +129,3 @@
.loading-status
= spinner
:javascript
var userProfile;
userProfile = new gl.User({
action: "#{controller.action_name}"
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment