1
0
mirror of https://github.com/quay/quay.git synced 2025-04-18 10:44:06 +03:00
quay/static/js/directives/quay-message-bar.js
Kenny Lee Sin Cheong a839a78eb5
chore: allows Quay to run for account recoveries (PROJQUAY-970) (#793)
Adds ACCOUNT_RECOVERY_MODE to allow Quay to run with some core
features disabled. When this is set, the instance should only be used
in order by existing users who hasn't linked their account to an
external login service, after database authentication has been
disabled.
2021-07-07 12:45:24 -04:00

30 lines
888 B
JavaScript

/**
* An element which displays a message for users to read.
*/
angular.module('quay').directive('quayMessageBar', function () {
return {
priority: 0,
templateUrl: '/static/directives/quay-message-bar.html',
replace: false,
transclude: false,
restrict: 'C',
scope: {},
controller: function ($scope, $element, $rootScope, ApiService, NotificationService,
StateService) {
$scope.messages = [];
$scope.NotificationService = NotificationService;
StateService.updateStateIn($scope, function(state) {
$scope.inReadOnlyMode = state.inReadOnlyMode;
$scope.inAccountRecoveryMode = state.inAccountRecoveryMode;
});
ApiService.getGlobalMessages().then(function (data) {
$scope.messages = data['messages'] || [];
}, function (resp) {
return true;
});
}
};
});