Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
knowledgebase-front
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Applications
Knowledge Base
knowledgebase-front
Commits
7d1eff91
Commit
7d1eff91
authored
4 years ago
by
Benoit Alessandroni
Browse files
Options
Downloads
Patches
Plain Diff
Somes fixes while trying to debug the refresh issues
parent
00a7a144
No related branches found
Branches containing commit
No related tags found
1 merge request
!151
Bug/#140
Pipeline
#5626
failed
4 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scripts/coopstarter.js
+44
-23
44 additions, 23 deletions
src/scripts/coopstarter.js
with
44 additions
and
23 deletions
src/scripts/coopstarter.js
+
44
−
23
View file @
7d1eff91
...
@@ -101,13 +101,38 @@ async function refreshList(formId, listId) {
...
@@ -101,13 +101,38 @@ async function refreshList(formId, listId) {
let
list
=
document
.
getElementById
(
listId
);
let
list
=
document
.
getElementById
(
listId
);
if
(
list
)
{
if
(
list
)
{
let
listProxy
=
await
list
.
component
.
resource
let
listProxy
=
await
list
.
component
.
resource
;
// Refresh du cache sur la liste
listProxy
.
clearCache
();
listProxy
.
clearCache
();
list
.
dataset
.
src
=
list
.
dataset
.
src
;
list
.
dataset
.
src
=
list
.
dataset
.
src
;
}
}
});
});
}
}
/**
* Refresh user and account information after a form submission
* @param {String} formId - Id of the sumitted form
* @param {String} listId - Id of the user object to refresh
*/
async
function
refreshUser
(
formId
,
listId
)
{
let
form
=
document
.
getElementById
(
formId
);
form
.
addEventListener
(
"
save
"
,
async
function
()
{
let
list
=
document
.
getElementById
(
listId
);
if
(
list
)
{
let
listProxy
=
await
list
.
component
.
resource
;
let
account
=
await
listProxy
[
'
account
'
];
// Refresh du cache sur le User
listProxy
.
clearCache
();
account
.
clearCache
();
list
.
dataset
.
src
=
list
.
dataset
.
src
;
}
});
}
/**
/**
* Remove pagination when there is no resource in a step group.
* Remove pagination when there is no resource in a step group.
*/
*/
...
@@ -553,7 +578,6 @@ function addProperFilterToSearchComponents(targetId) {
...
@@ -553,7 +578,6 @@ function addProperFilterToSearchComponents(targetId) {
let
language_field_search
=
more_criterias_form
.
querySelector
(
let
language_field_search
=
more_criterias_form
.
querySelector
(
`select[name="language"]`
`select[name="language"]`
);
);
let
language_hidden_field
=
baseElement
.
querySelectorAll
(
let
language_hidden_field
=
baseElement
.
querySelectorAll
(
'
hidden-widget[name="more_criterias_hidden"] select[name="language"]
'
'
hidden-widget[name="more_criterias_hidden"] select[name="language"]
'
);
);
...
@@ -785,25 +809,20 @@ jQuery(document).ready(function($) {
...
@@ -785,25 +809,20 @@ jQuery(document).ready(function($) {
refreshList
(
"
validation_form
"
,
"
pending_resources
"
);
refreshList
(
"
validation_form
"
,
"
pending_resources
"
);
refreshList
(
"
refusal_dialog_form
"
,
"
pending_resources
"
);
refreshList
(
"
refusal_dialog_form
"
,
"
pending_resources
"
);
refreshList
(
"
improvement_dialog_form
"
,
"
pending_resources
"
);
refreshList
(
"
improvement_dialog_form
"
,
"
pending_resources
"
);
initFileUpload
(
"
entrepreneur_profile_creation
"
,
"
account.picture
"
);
refreshUser
(
"
entrepreneur_profile_creation
"
,
"
entrepreneur_info
"
);
refreshList
(
"
entrepreneur_profile_creation
"
,
"
entrepreneur_info
"
);
refreshUser
(
"
entrepreneur_profile_creation
"
,
"
entrepreneur_contact
"
);
refreshList
(
"
entrepreneur_profile_creation
"
,
"
entrepreneur_contact
"
);
refreshUser
(
"
entrepreneur_profile_creation
"
,
"
entrepreneur_account_picture
"
);
refreshList
(
"
entrepreneur_profile_creation
"
,
"
entrepreneur_account_picture
"
);
refreshUser
(
"
mentor_profile_creation
"
,
"
mentor_info
"
);
initFileUpload
(
"
mentor_profile_creation
"
,
"
account.picture
"
);
refreshUser
(
"
mentor_profile_creation
"
,
"
mentor_complementary
"
);
refreshList
(
"
mentor_profile_creation
"
,
"
mentor_info
"
);
refreshUser
(
"
mentor_profile_creation
"
,
"
mentor_contact
"
);
refreshList
(
"
mentor_profile_creation
"
,
"
mentor_complementary
"
);
refreshUser
(
"
mentor_profile_creation
"
,
"
mentor_account_picture
"
);
refreshList
(
"
mentor_profile_creation
"
,
"
mentor_contact
"
);
refreshUser
(
"
entrepreneur_profile_edition
"
,
"
entrepreneur_info
"
);
refreshList
(
"
mentor_profile_creation
"
,
"
mentor_account_picture
"
);
refreshUser
(
"
entrepreneur_profile_edition
"
,
"
entrepreneur_contact
"
);
initFileUpload
(
"
entrepreneur_profile_edition
"
,
"
account.picture
"
);
refreshUser
(
"
entrepreneur_profile_edition
"
,
"
entrepreneur_account_picture
"
);
refreshList
(
"
entrepreneur_profile_edition
"
,
"
entrepreneur_info
"
);
refreshUser
(
"
mentor_profile_edition
"
,
"
mentor_info
"
);
refreshList
(
"
entrepreneur_profile_edition
"
,
"
entrepreneur_contact
"
);
refreshUser
(
"
mentor_profile_edition
"
,
"
mentor_complementary
"
);
refreshList
(
"
entrepreneur_profile_edition
"
,
"
entrepreneur_account_picture
"
);
refreshUser
(
"
mentor_profile_edition
"
,
"
mentor_contact
"
);
initFileUpload
(
"
mentor_profile_edition
"
,
"
account.picture
"
);
refreshUser
(
"
mentor_profile_edition
"
,
"
mentor_account_picture
"
);
refreshList
(
"
mentor_profile_edition
"
,
"
mentor_info
"
);
refreshList
(
"
mentor_profile_edition
"
,
"
mentor_complementary
"
);
refreshList
(
"
mentor_profile_edition
"
,
"
mentor_contact
"
);
refreshList
(
"
mentor_profile_edition
"
,
"
mentor_account_picture
"
);
refreshRequestList
(
"
change_status_request
"
,
"
request_list
"
);
addProperFilterToSearchComponents
(
"
entrepreneur-resource-list
"
);
addProperFilterToSearchComponents
(
"
entrepreneur-resource-list
"
);
addProperFilterToSearchComponents
(
"
mentor-database
"
);
addProperFilterToSearchComponents
(
"
mentor-database
"
);
...
@@ -879,7 +898,10 @@ jQuery(document).ready(function($) {
...
@@ -879,7 +898,10 @@ jQuery(document).ready(function($) {
//Init the form file behaviour
//Init the form file behaviour
initFileUpload
(
"
resource_creation_form
"
,
"
preview_image
"
);
initFileUpload
(
"
resource_creation_form
"
,
"
preview_image
"
);
initFileUpload
(
"
resource_edition_form
"
,
"
preview_image
"
);
initFileUpload
(
"
resource_edition_form
"
,
"
preview_image
"
);
initFileUpload
(
"
mentor_profile_creation
"
,
"
account.picture
"
);
initFileUpload
(
"
mentor_profile_edition
"
,
"
account.picture
"
);
initFileUpload
(
"
mentor_profile_edition
"
,
"
account.picture
"
);
refreshRequestList
(
"
change_status_request
"
,
"
request_list
"
);
//Manage the accordion in request mentor dashboard.
//Manage the accordion in request mentor dashboard.
manageAccordionForRequest
();
manageAccordionForRequest
();
...
@@ -931,9 +953,8 @@ jQuery(document).ready(function($) {
...
@@ -931,9 +953,8 @@ jQuery(document).ready(function($) {
//manage accordion for "More criteria"
//manage accordion for "More criteria"
manageAccordionMoreCriteria
();
manageAccordionMoreCriteria
();
//Init the form file behaviour
// initFileUpload();
initFileUpload
(
"
entrepreneur_profile_edition
"
,
"
account.picture
"
);
initFileUpload
(
"
entrepreneur_profile_edition
"
,
"
account.picture
"
);
initFileUpload
(
"
entrepreneur_profile_creation
"
,
"
account.picture
"
);
//Correct the native default of pagination
//Correct the native default of pagination
refreshPagination
();
refreshPagination
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment