@girder/core 3.2.8 → 5.0.0-a7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/package.json +79 -31
- package/assets/Girder_Mark.png +0 -0
- package/auth.js +0 -152
- package/collections/ApiKeyCollection.js +0 -9
- package/collections/AssetstoreCollection.js +0 -9
- package/collections/Collection.js +0 -295
- package/collections/CollectionCollection.js +0 -9
- package/collections/FileCollection.js +0 -11
- package/collections/FolderCollection.js +0 -11
- package/collections/GroupCollection.js +0 -9
- package/collections/ItemCollection.js +0 -11
- package/collections/UserCollection.js +0 -24
- package/collections/index.js +0 -21
- package/constants.js +0 -33
- package/dialog.js +0 -128
- package/events.js +0 -6
- package/index.js +0 -31
- package/main.js +0 -21
- package/misc.js +0 -260
- package/models/AccessControlledModel.js +0 -76
- package/models/ApiKeyModel.js +0 -31
- package/models/AssetstoreModel.js +0 -43
- package/models/CollectionCreationPolicyModel.js +0 -20
- package/models/CollectionModel.js +0 -12
- package/models/FileModel.js +0 -310
- package/models/FolderModel.js +0 -33
- package/models/GroupModel.js +0 -197
- package/models/ItemModel.js +0 -72
- package/models/MetadataMixin.js +0 -88
- package/models/Model.js +0 -187
- package/models/UserModel.js +0 -189
- package/models/index.js +0 -25
- package/pluginUtils.js +0 -11
- package/rest.js +0 -216
- package/router.js +0 -58
- package/routes.js +0 -231
- package/stylesheets/apidocs/apidocs.styl +0 -50
- package/stylesheets/body/adminConsole.styl +0 -21
- package/stylesheets/body/assetstores.styl +0 -46
- package/stylesheets/body/collectionList.styl +0 -39
- package/stylesheets/body/collectionPage.styl +0 -6
- package/stylesheets/body/frontPage.styl +0 -48
- package/stylesheets/body/groupList.styl +0 -43
- package/stylesheets/body/groupPage.styl +0 -116
- package/stylesheets/body/itemPage.styl +0 -81
- package/stylesheets/body/plugins.styl +0 -61
- package/stylesheets/body/searchResultsList.styl +0 -51
- package/stylesheets/body/systemConfig.styl +0 -56
- package/stylesheets/body/userAccount.styl +0 -57
- package/stylesheets/body/userList.styl +0 -79
- package/stylesheets/body/userPage.styl +0 -6
- package/stylesheets/layout/footer.styl +0 -19
- package/stylesheets/layout/global.styl +0 -154
- package/stylesheets/layout/globalNav.styl +0 -89
- package/stylesheets/layout/header.styl +0 -29
- package/stylesheets/layout/headerUser.styl +0 -33
- package/stylesheets/layout/layout.styl +0 -75
- package/stylesheets/layout/layoutVars.styl +0 -9
- package/stylesheets/layout/loading.styl +0 -37
- package/stylesheets/layout/progressArea.styl +0 -17
- package/stylesheets/widgets/accessWidget.styl +0 -106
- package/stylesheets/widgets/browserWidget.styl +0 -9
- package/stylesheets/widgets/hierarchyWidget.styl +0 -188
- package/stylesheets/widgets/markdownWidget.styl +0 -92
- package/stylesheets/widgets/metadataWidget.styl +0 -92
- package/stylesheets/widgets/searchFieldWidget.styl +0 -70
- package/stylesheets/widgets/taskProgress.styl +0 -41
- package/stylesheets/widgets/timelineWidget.styl +0 -41
- package/stylesheets/widgets/uploadWidget.styl +0 -43
- package/stylesheets/widgets/userOtpManagementWidget.styl +0 -159
- package/templates/body/adminConsole.pug +0 -13
- package/templates/body/assetstores.pug +0 -98
- package/templates/body/collectionList.pug +0 -40
- package/templates/body/collectionPage.pug +0 -36
- package/templates/body/filesystemImport.pug +0 -41
- package/templates/body/frontPage.pug +0 -83
- package/templates/body/groupList.pug +0 -30
- package/templates/body/groupPage.pug +0 -116
- package/templates/body/itemPage.pug +0 -61
- package/templates/body/plugins.pug +0 -20
- package/templates/body/s3Import.pug +0 -35
- package/templates/body/searchResults.pug +0 -15
- package/templates/body/searchResultsType.pug +0 -13
- package/templates/body/systemConfiguration.pug +0 -221
- package/templates/body/userAccount.pug +0 -83
- package/templates/body/userList.pug +0 -43
- package/templates/body/userPage.pug +0 -40
- package/templates/layout/alert.pug +0 -5
- package/templates/layout/layout.pug +0 -12
- package/templates/layout/layoutFooter.pug +0 -11
- package/templates/layout/layoutGlobalNav.pug +0 -7
- package/templates/layout/layoutHeader.pug +0 -8
- package/templates/layout/layoutHeaderUser.pug +0 -26
- package/templates/layout/layoutProgressArea.pug +0 -1
- package/templates/layout/loginDialog.pug +0 -30
- package/templates/layout/registerDialog.pug +0 -35
- package/templates/layout/resetPasswordDialog.pug +0 -25
- package/templates/widgets/accessEditor.pug +0 -23
- package/templates/widgets/accessEditorMixins.pug +0 -57
- package/templates/widgets/accessEditorNonModal.pug +0 -11
- package/templates/widgets/accessEntry.pug +0 -32
- package/templates/widgets/apiKeyList.pug +0 -50
- package/templates/widgets/browserWidget.pug +0 -32
- package/templates/widgets/checkedActionsMenu.pug +0 -46
- package/templates/widgets/collectionInfoDialog.pug +0 -37
- package/templates/widgets/confirmDialog.pug +0 -14
- package/templates/widgets/dateTimeRangeWidget.pug +0 -20
- package/templates/widgets/dateTimeWidget.pug +0 -8
- package/templates/widgets/editApiKeyWidget.pug +0 -43
- package/templates/widgets/editAssetstoreWidget.pug +0 -78
- package/templates/widgets/editCollectionWidget.pug +0 -27
- package/templates/widgets/editFileWidget.pug +0 -21
- package/templates/widgets/editFolderWidget.pug +0 -27
- package/templates/widgets/editGroupWidget.pug +0 -54
- package/templates/widgets/editItemWidget.pug +0 -27
- package/templates/widgets/fileInfoDialog.pug +0 -33
- package/templates/widgets/fileList.pug +0 -33
- package/templates/widgets/folderInfoDialog.pug +0 -42
- package/templates/widgets/folderList.pug +0 -21
- package/templates/widgets/groupAdminList.pug +0 -33
- package/templates/widgets/groupInviteDialog.pug +0 -76
- package/templates/widgets/groupInviteList.pug +0 -14
- package/templates/widgets/groupMemberList.pug +0 -39
- package/templates/widgets/groupModList.pug +0 -23
- package/templates/widgets/hierarchyBreadcrumb.pug +0 -37
- package/templates/widgets/hierarchyPaginated.pug +0 -19
- package/templates/widgets/hierarchyWidget.pug +0 -96
- package/templates/widgets/itemBreadcrumb.pug +0 -16
- package/templates/widgets/itemList.pug +0 -27
- package/templates/widgets/jsonMetadatumEditWidget.pug +0 -13
- package/templates/widgets/jsonMetadatumView.pug +0 -6
- package/templates/widgets/loadingAnimation.pug +0 -4
- package/templates/widgets/markdownWidget.pug +0 -34
- package/templates/widgets/metadataWidget.pug +0 -16
- package/templates/widgets/metadatumEditWidget.pug +0 -15
- package/templates/widgets/metadatumView.pug +0 -5
- package/templates/widgets/newAssetstore.pug +0 -118
- package/templates/widgets/paginateWidget.pug +0 -7
- package/templates/widgets/pluginConfigBreadcrumb.pug +0 -13
- package/templates/widgets/rootSelectorWidget.pug +0 -13
- package/templates/widgets/searchField.pug +0 -10
- package/templates/widgets/searchHelp.pug +0 -12
- package/templates/widgets/searchModeSelect.pug +0 -9
- package/templates/widgets/searchResults.pug +0 -14
- package/templates/widgets/sortCollectionWidget.pug +0 -14
- package/templates/widgets/taskProgress.pug +0 -16
- package/templates/widgets/timeline.pug +0 -15
- package/templates/widgets/uploadWidget.pug +0 -15
- package/templates/widgets/uploadWidgetMixins.pug +0 -31
- package/templates/widgets/uploadWidgetNonModal.pug +0 -10
- package/templates/widgets/userOtpBegin.pug +0 -4
- package/templates/widgets/userOtpDisable.pug +0 -6
- package/templates/widgets/userOtpEnable.pug +0 -44
- package/utilities/EventStream.js +0 -177
- package/utilities/PluginUtils.js +0 -36
- package/utilities/S3UploadHandler.js +0 -303
- package/utilities/index.js +0 -9
- package/utilities/jquery/girderEnable.js +0 -19
- package/utilities/jquery/girderModal.js +0 -48
- package/version.js +0 -10
- package/views/App.js +0 -359
- package/views/View.js +0 -78
- package/views/body/AdminView.js +0 -29
- package/views/body/AssetstoresView.js +0 -235
- package/views/body/CollectionView.js +0 -188
- package/views/body/CollectionsView.js +0 -120
- package/views/body/FilesystemImportView.js +0 -83
- package/views/body/FolderView.js +0 -54
- package/views/body/FrontPageView.js +0 -47
- package/views/body/GroupView.js +0 -336
- package/views/body/GroupsView.js +0 -106
- package/views/body/ItemView.js +0 -177
- package/views/body/PluginsView.js +0 -73
- package/views/body/S3ImportView.js +0 -80
- package/views/body/SearchResultsView.js +0 -162
- package/views/body/SystemConfigurationView.js +0 -196
- package/views/body/UserAccountView.js +0 -179
- package/views/body/UserView.js +0 -165
- package/views/body/UsersView.js +0 -124
- package/views/body/index.js +0 -37
- package/views/index.js +0 -13
- package/views/layout/FooterView.js +0 -29
- package/views/layout/GlobalNavView.js +0 -103
- package/views/layout/HeaderUserView.js +0 -45
- package/views/layout/HeaderView.js +0 -83
- package/views/layout/LoginView.js +0 -100
- package/views/layout/ProgressListView.js +0 -70
- package/views/layout/RegisterView.js +0 -101
- package/views/layout/ResetPasswordView.js +0 -70
- package/views/layout/index.js +0 -19
- package/views/widgets/AccessWidget.js +0 -427
- package/views/widgets/ApiKeyListWidget.js +0 -140
- package/views/widgets/BrowserWidget.js +0 -317
- package/views/widgets/CheckedMenuWidget.js +0 -68
- package/views/widgets/CollectionInfoWidget.js +0 -40
- package/views/widgets/DateTimeRangeWidget.js +0 -179
- package/views/widgets/DateTimeWidget.js +0 -109
- package/views/widgets/EditApiKeyWidget.js +0 -122
- package/views/widgets/EditAssetstoreWidget.js +0 -148
- package/views/widgets/EditCollectionWidget.js +0 -93
- package/views/widgets/EditFileWidget.js +0 -56
- package/views/widgets/EditFolderWidget.js +0 -116
- package/views/widgets/EditGroupWidget.js +0 -125
- package/views/widgets/EditItemWidget.js +0 -110
- package/views/widgets/FileInfoWidget.js +0 -26
- package/views/widgets/FileListWidget.js +0 -151
- package/views/widgets/FolderInfoWidget.js +0 -39
- package/views/widgets/FolderListWidget.js +0 -106
- package/views/widgets/GroupAdminsWidget.js +0 -88
- package/views/widgets/GroupInvitesWidget.js +0 -56
- package/views/widgets/GroupMembersWidget.js +0 -185
- package/views/widgets/GroupModsWidget.js +0 -77
- package/views/widgets/HierarchyWidget.js +0 -1097
- package/views/widgets/ItemBreadcrumbWidget.js +0 -38
- package/views/widgets/ItemListWidget.js +0 -345
- package/views/widgets/LoadingAnimation.js +0 -17
- package/views/widgets/MarkdownWidget.js +0 -217
- package/views/widgets/MetadataWidget.js +0 -504
- package/views/widgets/NewAssetstoreWidget.js +0 -81
- package/views/widgets/PaginateWidget.js +0 -37
- package/views/widgets/PluginConfigBreadcrumbWidget.js +0 -33
- package/views/widgets/RootSelectorWidget.js +0 -192
- package/views/widgets/SearchFieldWidget.js +0 -365
- package/views/widgets/SearchPaginateWidget.js +0 -149
- package/views/widgets/SortCollectionWidget.js +0 -53
- package/views/widgets/TaskProgressWidget.js +0 -91
- package/views/widgets/TimelineWidget.js +0 -155
- package/views/widgets/UploadWidget.js +0 -340
- package/views/widgets/UserOtpManagementWidget.js +0 -105
- package/views/widgets/index.js +0 -75
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import $ from 'jquery';
|
|
2
|
-
import _ from 'underscore';
|
|
3
|
-
|
|
4
|
-
import View from '@girder/core/views/View';
|
|
5
|
-
import events from '@girder/core/events';
|
|
6
|
-
import { handleClose, handleOpen } from '@girder/core/dialog';
|
|
7
|
-
import { login } from '@girder/core/auth';
|
|
8
|
-
import UserModel from '@girder/core/models/UserModel';
|
|
9
|
-
|
|
10
|
-
import LoginDialogTemplate from '@girder/core/templates/layout/loginDialog.pug';
|
|
11
|
-
|
|
12
|
-
import '@girder/core/utilities/jquery/girderEnable';
|
|
13
|
-
import '@girder/core/utilities/jquery/girderModal';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* This view shows a login modal dialog.
|
|
17
|
-
*/
|
|
18
|
-
var LoginView = View.extend({
|
|
19
|
-
events: {
|
|
20
|
-
'submit #g-login-form': function (e) {
|
|
21
|
-
e.preventDefault();
|
|
22
|
-
|
|
23
|
-
this.$('#g-login-button').girderEnable(false);
|
|
24
|
-
this.$('.g-validation-failed-message').text('');
|
|
25
|
-
|
|
26
|
-
const loginName = this.$('#g-login').val();
|
|
27
|
-
const password = this.$('#g-password').val();
|
|
28
|
-
const otpToken = this.$('#g-login-otp-group').hasClass('hidden') ? null : this.$('#g-login-otp').val();
|
|
29
|
-
login(loginName, password, undefined, otpToken)
|
|
30
|
-
.done(() => {
|
|
31
|
-
this.$el.modal('hide');
|
|
32
|
-
})
|
|
33
|
-
.fail((err) => {
|
|
34
|
-
if (err.responseJSON.message.indexOf('Girder-OTP') !== -1 &&
|
|
35
|
-
this.$('#g-login-otp-group').hasClass('hidden')
|
|
36
|
-
) {
|
|
37
|
-
this.$('#g-login-otp-group').removeClass('hidden');
|
|
38
|
-
this.$('#g-login-otp').trigger('focus');
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
this.$('.g-validation-failed-message').text(err.responseJSON.message);
|
|
43
|
-
|
|
44
|
-
if (err.responseJSON.extra === 'emailVerification') {
|
|
45
|
-
var html = err.responseJSON.message +
|
|
46
|
-
' <a class="g-send-verification-email">Click here to send verification email.</a>';
|
|
47
|
-
$('.g-validation-failed-message').html(html);
|
|
48
|
-
}
|
|
49
|
-
})
|
|
50
|
-
.always(() => {
|
|
51
|
-
this.$('#g-login-button').girderEnable(true);
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
'click .g-send-verification-email': function () {
|
|
56
|
-
this.$('.g-validation-failed-message').html('');
|
|
57
|
-
|
|
58
|
-
const loginName = this.$('#g-login').val();
|
|
59
|
-
UserModel.sendVerificationEmail(loginName)
|
|
60
|
-
.done((resp) => {
|
|
61
|
-
this.$('.g-validation-failed-message').html(resp.message);
|
|
62
|
-
}).fail((err) => {
|
|
63
|
-
this.$('.g-validation-failed-message').html(err.responseJSON.message);
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
'click a.g-register-link': function () {
|
|
68
|
-
events.trigger('g:registerUi');
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
'click a.g-forgot-password': function () {
|
|
72
|
-
events.trigger('g:resetPasswordUi');
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
initialize: function (settings) {
|
|
77
|
-
this.registrationPolicy = settings.registrationPolicy;
|
|
78
|
-
this.enablePasswordLogin = _.has(settings, 'enablePasswordLogin') ? settings.enablePasswordLogin : true;
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
render: function () {
|
|
82
|
-
this.$el.html(LoginDialogTemplate({
|
|
83
|
-
registrationPolicy: this.registrationPolicy,
|
|
84
|
-
enablePasswordLogin: this.enablePasswordLogin,
|
|
85
|
-
showOtp: true
|
|
86
|
-
})).girderModal(this)
|
|
87
|
-
.on('shown.bs.modal', () => {
|
|
88
|
-
this.$('#g-login').trigger('focus');
|
|
89
|
-
}).on('hidden.bs.modal', () => {
|
|
90
|
-
handleClose('login', { replace: true });
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
handleOpen('login', { replace: true });
|
|
94
|
-
this.$('#g-login').trigger('focus');
|
|
95
|
-
|
|
96
|
-
return this;
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
export default LoginView;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import _ from 'underscore';
|
|
2
|
-
|
|
3
|
-
import TaskProgressWidget from '@girder/core/views/widgets/TaskProgressWidget';
|
|
4
|
-
import View from '@girder/core/views/View';
|
|
5
|
-
|
|
6
|
-
import LayoutProgressAreaTemplate from '@girder/core/templates/layout/layoutProgressArea.pug';
|
|
7
|
-
|
|
8
|
-
import '@girder/core/stylesheets/layout/progressArea.styl';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Container showing list of active tasks that are reporting progress
|
|
12
|
-
* via a EventStream object.
|
|
13
|
-
*/
|
|
14
|
-
var ProgressListView = View.extend({
|
|
15
|
-
|
|
16
|
-
initialize: function (settings) {
|
|
17
|
-
this.eventStream = settings.eventStream;
|
|
18
|
-
this.listenTo(this.eventStream, 'g:event.progress', this._handleProgress, this);
|
|
19
|
-
// if the event stream disconnects, clear the progress so we don't have
|
|
20
|
-
// stale values lingering.
|
|
21
|
-
this.listenTo(this.eventStream, 'g:eventStream.stop', this._clearProgress, this);
|
|
22
|
-
|
|
23
|
-
// map progress IDs to widgets
|
|
24
|
-
this._map = {};
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
render: function () {
|
|
28
|
-
this.$el.html(LayoutProgressAreaTemplate());
|
|
29
|
-
|
|
30
|
-
this._onUpdate();
|
|
31
|
-
|
|
32
|
-
return this;
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
_handleProgress: function (progress) {
|
|
36
|
-
if (_.has(this._map, progress._id)) {
|
|
37
|
-
this._map[progress._id].update(progress);
|
|
38
|
-
} else {
|
|
39
|
-
this._map[progress._id] = new TaskProgressWidget({
|
|
40
|
-
className: 'g-progress-widget-container',
|
|
41
|
-
progress: progress,
|
|
42
|
-
parentView: null
|
|
43
|
-
}).on('g:hide', function (p) {
|
|
44
|
-
this._map[p._id].destroy();
|
|
45
|
-
delete this._map[p._id];
|
|
46
|
-
this._onUpdate();
|
|
47
|
-
}, this).render();
|
|
48
|
-
this._map[progress._id].$el.appendTo(this.$('.g-progress-list-container'));
|
|
49
|
-
}
|
|
50
|
-
this._onUpdate();
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
_clearProgress: function () {
|
|
54
|
-
const needsUpdate = !_.isEmpty(this._map);
|
|
55
|
-
_.each(this._map, (progressWidget, progressId) => {
|
|
56
|
-
progressWidget.destroy();
|
|
57
|
-
progressWidget.remove();
|
|
58
|
-
delete this._map[progressId];
|
|
59
|
-
});
|
|
60
|
-
if (needsUpdate) {
|
|
61
|
-
this._onUpdate();
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
_onUpdate: function () {
|
|
66
|
-
this.$el.toggle(!_.isEmpty(this._map));
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
export default ProgressListView;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import UserModel from '@girder/core/models/UserModel';
|
|
2
|
-
import View from '@girder/core/views/View';
|
|
3
|
-
import events from '@girder/core/events';
|
|
4
|
-
import { getCurrentUser, setCurrentUser, getCurrentToken, setCurrentToken } from '@girder/core/auth';
|
|
5
|
-
import { handleClose, handleOpen } from '@girder/core/dialog';
|
|
6
|
-
|
|
7
|
-
import RegisterDialogTemplate from '@girder/core/templates/layout/registerDialog.pug';
|
|
8
|
-
|
|
9
|
-
import '@girder/core/utilities/jquery/girderEnable';
|
|
10
|
-
import '@girder/core/utilities/jquery/girderModal';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This view shows a register modal dialog.
|
|
14
|
-
*/
|
|
15
|
-
var RegisterView = View.extend({
|
|
16
|
-
events: {
|
|
17
|
-
'submit #g-register-form': function (e) {
|
|
18
|
-
e.preventDefault();
|
|
19
|
-
|
|
20
|
-
this.$('.form-group').removeClass('has-error');
|
|
21
|
-
|
|
22
|
-
if (this.$('#g-password').val() !== this.$('#g-password2').val()) {
|
|
23
|
-
this.$('#g-group-password,#g-group-password2').addClass('has-error');
|
|
24
|
-
this.$('#g-password').trigger('focus');
|
|
25
|
-
this.$('.g-validation-failed-message').text('Passwords must match.');
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var user = new UserModel({
|
|
30
|
-
login: this.$('#g-login').val(),
|
|
31
|
-
password: this.$('#g-password').val(),
|
|
32
|
-
email: this.$('#g-email').val(),
|
|
33
|
-
firstName: this.$('#g-firstName').val(),
|
|
34
|
-
lastName: this.$('#g-lastName').val()
|
|
35
|
-
});
|
|
36
|
-
user.on('g:saved', function () {
|
|
37
|
-
if (getCurrentUser()) {
|
|
38
|
-
this.trigger('g:userCreated', {
|
|
39
|
-
user: user
|
|
40
|
-
});
|
|
41
|
-
} else {
|
|
42
|
-
var authToken = user.get('authToken') || {};
|
|
43
|
-
|
|
44
|
-
if (authToken.token) {
|
|
45
|
-
setCurrentUser(user);
|
|
46
|
-
setCurrentToken(authToken.token);
|
|
47
|
-
window.localStorage.setItem('girderToken', getCurrentToken());
|
|
48
|
-
|
|
49
|
-
events.trigger('g:login');
|
|
50
|
-
} else {
|
|
51
|
-
events.trigger('g:alert', {
|
|
52
|
-
icon: 'ok',
|
|
53
|
-
text: 'Check your email to verify registration.',
|
|
54
|
-
type: 'success',
|
|
55
|
-
timeout: 4000
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
handleClose('register', { replace: true });
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
this.$el.modal('hide');
|
|
63
|
-
}, this).on('g:error', function (err) {
|
|
64
|
-
var resp = err.responseJSON;
|
|
65
|
-
this.$('.g-validation-failed-message').text(resp.message);
|
|
66
|
-
if (resp.field) {
|
|
67
|
-
this.$('#g-group-' + resp.field).addClass('has-error');
|
|
68
|
-
this.$('#g-' + resp.field).trigger('focus');
|
|
69
|
-
}
|
|
70
|
-
this.$('#g-register-button').girderEnable(true);
|
|
71
|
-
}, this).save();
|
|
72
|
-
|
|
73
|
-
this.$('#g-register-button').girderEnable(false);
|
|
74
|
-
this.$('.g-validation-failed-message').text('');
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
'click a.g-login-link': function () {
|
|
78
|
-
events.trigger('g:loginUi');
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
render: function () {
|
|
83
|
-
this.$el.html(RegisterDialogTemplate({
|
|
84
|
-
currentUser: getCurrentUser(),
|
|
85
|
-
title: getCurrentUser() ? 'Create new user' : 'Sign up'
|
|
86
|
-
})).girderModal(this)
|
|
87
|
-
.on('shown.bs.modal', () => {
|
|
88
|
-
this.$('#g-login').trigger('focus');
|
|
89
|
-
}).on('hidden.bs.modal', () => {
|
|
90
|
-
handleClose('register', { replace: true });
|
|
91
|
-
});
|
|
92
|
-
this.$('#g-login').trigger('focus');
|
|
93
|
-
|
|
94
|
-
handleOpen('register', { replace: true });
|
|
95
|
-
|
|
96
|
-
return this;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
export default RegisterView;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import View from '@girder/core/views/View';
|
|
2
|
-
import events from '@girder/core/events';
|
|
3
|
-
import { handleClose, handleOpen } from '@girder/core/dialog';
|
|
4
|
-
import { restRequest } from '@girder/core/rest';
|
|
5
|
-
|
|
6
|
-
import ResetPasswordDialogTemplate from '@girder/core/templates/layout/resetPasswordDialog.pug';
|
|
7
|
-
|
|
8
|
-
import '@girder/core/utilities/jquery/girderEnable';
|
|
9
|
-
import '@girder/core/utilities/jquery/girderModal';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* This view shows a modal dialog for resetting a forgotten password.
|
|
13
|
-
*/
|
|
14
|
-
var ResetPasswordView = View.extend({
|
|
15
|
-
events: {
|
|
16
|
-
'submit #g-reset-password-form': function (e) {
|
|
17
|
-
e.preventDefault();
|
|
18
|
-
restRequest({
|
|
19
|
-
url: 'user/password/temporary',
|
|
20
|
-
data: {
|
|
21
|
-
email: this.$('#g-email').val().trim()
|
|
22
|
-
},
|
|
23
|
-
method: 'PUT',
|
|
24
|
-
error: null // don't do default error behavior
|
|
25
|
-
}).done(() => {
|
|
26
|
-
this.$el.modal('hide');
|
|
27
|
-
events.trigger('g:alert', {
|
|
28
|
-
icon: 'mail-alt',
|
|
29
|
-
text: 'Password reset email sent.',
|
|
30
|
-
type: 'success'
|
|
31
|
-
});
|
|
32
|
-
}).fail((err) => {
|
|
33
|
-
this.$('.g-validation-failed-message').text(err.responseJSON.message);
|
|
34
|
-
this.$('#g-reset-password-button').girderEnable(true);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
this.$('#g-reset-password-button').girderEnable(false);
|
|
38
|
-
this.$('.g-validation-failed-message').text('');
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
'click a.g-register-link': function () {
|
|
42
|
-
events.trigger('g:registerUi');
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
'click a.g-login-link': function () {
|
|
46
|
-
events.trigger('g:loginUi');
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
initialize: function (settings) {
|
|
51
|
-
this.registrationPolicy = settings.registrationPolicy;
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
render: function () {
|
|
55
|
-
this.$el.html(ResetPasswordDialogTemplate({
|
|
56
|
-
registrationPolicy: this.registrationPolicy
|
|
57
|
-
})).girderModal(this).on('shown.bs.modal', () => {
|
|
58
|
-
this.$('#g-email').trigger('focus');
|
|
59
|
-
}).on('hidden.bs.modal', () => {
|
|
60
|
-
handleClose('resetpassword', { replace: true });
|
|
61
|
-
});
|
|
62
|
-
this.$('#g-email').trigger('focus');
|
|
63
|
-
|
|
64
|
-
handleOpen('resetpassword', { replace: true });
|
|
65
|
-
|
|
66
|
-
return this;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
export default ResetPasswordView;
|
package/views/layout/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import FooterView from './FooterView';
|
|
2
|
-
import GlobalNavView from './GlobalNavView';
|
|
3
|
-
import HeaderUserView from './HeaderUserView';
|
|
4
|
-
import HeaderView from './HeaderView';
|
|
5
|
-
import LoginView from './LoginView';
|
|
6
|
-
import ProgressListView from './ProgressListView';
|
|
7
|
-
import RegisterView from './RegisterView';
|
|
8
|
-
import ResetPasswordView from './ResetPasswordView';
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
FooterView,
|
|
12
|
-
GlobalNavView,
|
|
13
|
-
HeaderUserView,
|
|
14
|
-
HeaderView,
|
|
15
|
-
LoginView,
|
|
16
|
-
ProgressListView,
|
|
17
|
-
RegisterView,
|
|
18
|
-
ResetPasswordView
|
|
19
|
-
};
|