Skip to content

Commit

Permalink
implement script hint (#3054)
Browse files Browse the repository at this point in the history
  • Loading branch information
René Reitmann committed Dec 16, 2021
1 parent 47d8778 commit c0edd0c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ angular.module('metadatamanagementApp').config(
'software-package': 'Softwarepaket',
'language': 'Skriptsprache',
'version': 'Version des Softwarepakets',
'file': 'Datei'
'file': 'Datei',
'file-must-be-ordered': 'Das Skript ist nicht über einen direkten Download verfügbar, bitte bestellen Sie das Analysepaket über den Warenkorb.'
},
'attachments': {
'table-title': 'Materialien zu diesem Analysepaket',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ angular.module('metadatamanagementApp').config(
'language': 'Document Language',
'file': 'File'
},
'additional-links': 'Additional Links',
'additional-links': 'Additional Links',
'analysisPackage': 'Analysis Package',
'analysisPackages': 'Analysis Packages',
'analysis-data': 'Analysis Data',
Expand Down Expand Up @@ -76,7 +76,8 @@ angular.module('metadatamanagementApp').config(
'software-package': 'Software Package',
'language': 'Script Language',
'version': 'Version of Software Package',
'file': 'File'
'file': 'File',
'file-must-be-ordered': 'The script is not available via direct download, please order the analysis package via the shopping cart.'
},
'attachments': {
'table-title': 'Documents related to this Analysis Package',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@
<td>{{row.usedLanguage | displayIsoLanguage: $ctrl.lang}}</td>
<td>{{row.softwarePackage}}</td>
<td>{{row.softwarePackageVersion}}</td>
<td class="fdz-td-filename"><a ng-href="{{row.attachment.id}}" target="_blank" fdz-track-download analytics-if="row.type.en === 'Method Report'" analytics-on="click" analytics-event="download-method-report" analytics-label="{{row.title}}" analytics-category="Downloads">{{row.attachment.fileName}}
<td class="fdz-td-filename"><a ng-if="row.attachment" ng-href="{{row.attachment.id}}" target="_blank" fdz-track-download analytics-on="click" analytics-event="download-script" analytics-label="{{row.title[$ctrl.lang]}}" analytics-category="Downloads">{{row.attachment.fileName}}
<md-tooltip md-autohide="true" md-z-index="bowser.mobile || bowser.tablet ? -100 : 100001">
{{'global.tooltips.files.download' | translate: {filename: row.attachment.fileName} }}
</md-tooltip>
</a>
</a><strong ng-if="!row.attachment">*</strong>
</td>
</tr>
</tbody>
</table>
<p ng-if="$ctrl.options.containsScriptWithoutAttachment" style="columns: 1"><strong>*</strong> {{'analysis-package-management.detail.scripts.file-must-be-ordered' | translate }}</p>
</md-card-content>
</div>
</md-card>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ angular.module('metadatamanagementApp')
MessageBus,
PageMetadataService,
LanguageService, DataPackageSearchService,
$state, $location,
$state,
BreadcrumbService, Principal, SimpleMessageToastService,
SearchResultNavigatorService,
$stateParams,
Expand Down Expand Up @@ -112,6 +112,15 @@ angular.module('metadatamanagementApp')
if (attachments.length > 0) {
ctrl.scriptAttachments = attachments;
getScriptAttachmentMetadata();
ctrl.analysisPackage.scripts.forEach(function(script) {
if (!script.attachment) {
ctrl.analysisPackage.scripts
.containsScriptWithoutAttachment = true;
}
});
} else {
ctrl.analysisPackage.scripts.containsScriptWithoutAttachment =
true;
}
});
};
Expand Down Expand Up @@ -173,14 +182,6 @@ angular.module('metadatamanagementApp')
ctrl.loadDataPackages(result.analysisDataPackages);
ctrl.loadAttachments();
ctrl.loadScriptAttachments();

$timeout(function() {
if ($location.search().query ||
$location.search()['repeated-measurement-identifier'] ||
$location.search()['derived-variables-identifier']) {
ctrl.scroll();
}
}, 1000);
} else {
SimpleMessageToastService.openAlertMessageToast(
'analysis-package-management.detail.not-released-toast',
Expand Down
2 changes: 2 additions & 0 deletions src/main/webapp/scripts/app.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ angular.module('metadatamanagementApp')

.constant('ElasticSearchProperties', {apiVersion:'7.x',logLevel:'error',pageSize:10})

.constant('AuthProperties', {clientId:'0804cf40-fb4e-4fc5-8334-fe33973ec2c5',clientSecret:'0804cf40-fb4e-4fc5-8334-fe33973ec2c5',issuer:'http://localhost:8082'})

;

0 comments on commit c0edd0c

Please sign in to comment.