LT-239: Handle the error if the last imported file is not dcm file
- Add message label in progress dialog
This commit is contained in:
1 parent
2a17760ff8
commit
dfcb33153f
8 files changed
+246
-170
No files matched your search
@@ -9,7 +9,9 @@
|
||||
{{progressStatus}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="message">{{progressMessage}}</div>
|
||||
<div id="message">
|
||||
{{{progressMessage}}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,9 +1,24 @@
|
||||
progressDialog = {
|
||||
'show': function(title, numberOfTotal) {
|
||||
Session.set("progressDialogSettings", { title: title, numberOfCompleted: 0, numberOfTotal: numberOfTotal });
|
||||
|
||||
/**
|
||||
* Shows progress dialog
|
||||
* @param {Object} settings - Settings used by progress dialog
|
||||
* @param {string} settings.title
|
||||
* @param {int} settings.numberOfCompleted - The value of progress dialog
|
||||
* @param {int} settings.numberOfTotal - The max value of progress dialog
|
||||
* @param {Object} [settings.messageParams] - Show a message in progress dialog by setting message and messageType
|
||||
* @param {string} [settings.messageParams.message="Progress"] - The message will be shown in the progress dialog
|
||||
* @param {string} [settings.messageParams.messageType="info"] - Sets ui, accepts bootstrap predefined classes such as success, info, warning, danger
|
||||
*/
|
||||
'show': function(settings) {
|
||||
// Set dialog settings
|
||||
Session.set("progressDialogSettings", settings);
|
||||
$('#progressDialog').css('display', 'block');
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates the value of the progress dialog
|
||||
* @param {int} numberOfCompleted
|
||||
*/
|
||||
'update': function(numberOfCompleted) {
|
||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||
progressDialogSettings.numberOfCompleted = numberOfCompleted;
|
||||
@@ -14,13 +29,29 @@ progressDialog = {
|
||||
progressDialog.close();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Closes the progress dialog
|
||||
*/
|
||||
'close': function() {
|
||||
Session.set("progressDialogSettings", { title: "", numberOfCompleted: 0, numberOfTotal: 1 });
|
||||
// Reset progressDialogSettings session
|
||||
resetDialogSettingsSession();
|
||||
|
||||
// Close dialog
|
||||
$('#progressDialog').css('display', 'none');
|
||||
},
|
||||
'setMessage': function(message) {
|
||||
/**
|
||||
* Shows a message in the progress dialog
|
||||
* @param {Object} messageParams
|
||||
* @param {string} messageParams.message
|
||||
* @param {string} messageParams.messageType
|
||||
*/
|
||||
'setMessage': function(messageParams) {
|
||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||
progressDialogSettings.message = message;
|
||||
if (!messageParams.messageType || messageParams.messageType == '') {
|
||||
messageParams.messageType = 'info';
|
||||
}
|
||||
progressDialogSettings.messageParams = messageParams;
|
||||
Session.set("progressDialogSettings", progressDialogSettings);
|
||||
}
|
||||
};
|
||||
@@ -31,7 +62,7 @@ Template.progressDialog.helpers({
|
||||
return Session.get("progressDialogSettings").title;
|
||||
}
|
||||
|
||||
return "";
|
||||
return "Progress:";
|
||||
},
|
||||
'progressStatus': function() {
|
||||
var numberOfCompleted = 0;
|
||||
@@ -48,9 +79,22 @@ Template.progressDialog.helpers({
|
||||
},
|
||||
'progressMessage': function() {
|
||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||
if (progressDialogSettings && progressDialogSettings.message) {
|
||||
return progressDialogSettings.message;
|
||||
var messageParams = progressDialogSettings && progressDialogSettings.messageParams || false;
|
||||
if (messageParams && messageParams.message) {
|
||||
return '<span class="label label-'+messageParams.messageType+'">'+messageParams.message+'</span>';
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
// Resets progressDialogSettings
|
||||
function resetDialogSettingsSession() {
|
||||
Session.set("progressDialogSettings",
|
||||
{
|
||||
title: 'Progress',
|
||||
numberOfCompleted: 0,
|
||||
numberOfTotal: 0,
|
||||
messageParams: {message: null, messageType: 'info'}
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
right: 0
|
||||
margin: auto
|
||||
width: 20%
|
||||
height: 15%
|
||||
height: 20%
|
||||
z-index: 100
|
||||
border-radius: 5px
|
||||
padding: 10px 20px 10px 20px
|
||||
@@ -16,3 +16,10 @@
|
||||
|
||||
.dialogContent
|
||||
margin-bottom: 20px
|
||||
|
||||
#message
|
||||
width: 100%
|
||||
|
||||
span
|
||||
display: inline-block;
|
||||
width: 100%
|
||||
Reference in new issue
Block a user