Switch to new markdown editor everywhere

This commit is contained in:
Evan Cordell 2017-07-05 16:08:08 -04:00
parent f05b6d8c52
commit 3e3e25bb5a
7 changed files with 47 additions and 13 deletions

View file

@ -19,7 +19,7 @@
<td class="message-content">
<span ng-switch on="message.media_type">
<span ng-switch-when="text/markdown">
<span class="markdown-view" content="message.content"></span>
<markdown-view content="message.content"></markdown-view>
</span>
<span ng-switch-default>{{ message.content }}</span>
</span>
@ -81,7 +81,10 @@
</select>
<label>Message</label>
<div class="markdown-editor" content="newMessage.content"></div>
<markdown-input content="newMessage.content"
can-write="true"
(content-changed)="updateMessage($event.content)"
field-title="message"></markdown-input>
</div>
</div>
<div class="modal-footer" ng-show="createdMessage">

View file

@ -76,7 +76,10 @@
<tr>
<td><label for="create-key-notes">Approval Notes (optional):</label></td>
<td>
<div class="markdown-editor" content="preshared.notes"></div>
<markdown-input content="preshared.notes"
can-write="true"
(content-changed)="updateNotes($event.content)"
field-title="notes"></markdown-input>
<span class="co-help-text">
Optional notes for additional human-readable information about why the key was created.
</span>

View file

@ -251,7 +251,10 @@
<li ng-repeat="key in approveKeysInfo.keys">{{ getKeyTitle(key) }}</li>
</ul>
</div>
<div class="markdown-editor" content="approveKeysInfo.notes"></div>
<markdown-input content="approveKeysInfo.notes"
can-write="true"
(content-changed)="updateApproveKeysInfoNotes($event.content)"
field-title="notes"></markdown-input>
<span class="co-help-text">
Enter optional notes for additional human-readable information about why the keys were approved.
</span>
@ -268,7 +271,10 @@
<div style="margin-bottom: 10px;">
Approve service key <strong>{{ getKeyTitle(approvalKeyInfo.key) }}</strong>?
</div>
<div class="markdown-editor" content="approvalKeyInfo.notes"></div>
<markdown-input content="approvalKeysInfo.notes"
can-write="true"
(content-changed)="updateApprovalKeyInfoNotes($event.content)"
field-title="notes"></markdown-input>
<span class="co-help-text">
Enter optional notes for additional human-readable information about why the key was approved.
</span>
@ -344,7 +350,10 @@
<tr>
<td><label for="create-key-notes">Approval Notes:</label></td>
<td>
<div class="markdown-editor" content="newKey.notes"></div>
<markdown-input content="newKey.notes"
can-write="true"
(content-changed)="updateNewKeyNotes($event.content)"
field-title="notes"></markdown-input>
<span class="co-help-text">
Optional notes for additional human-readable information about why the key was added.
</span>

View file

@ -38,15 +38,15 @@ angular.module('quay').directive('globalMessageTab', function () {
ApiService.createGlobalMessage(data, null).then(function (resp) {
$scope.creatingMessage = false;
$scope.newMessage = {
'media_type': 'text/markdown',
'severity': 'info'
};
$('#createMessageModal').modal('hide');
$scope.loadMessageInternal();
}, errorHandler)
};
$scope.updateMessage = function(content) {
$scope.newMessage.content = content;
};
$scope.showDeleteMessage = function (uuid) {
$scope.messageToDelete = uuid;

View file

@ -108,6 +108,10 @@ angular.module('quay').directive('requestServiceKeyDialog', function () {
$scope.keyCreated({'key': resp});
}, ApiService.errorDisplay('Could not create service key'));
};
$scope.updateNotes = function(content) {
$scope.preshared.notes = content;
};
$scope.$watch('requestKeyInfo', function(info) {
if (info && info.service) {

View file

@ -31,8 +31,11 @@
<span class="avatar" data="result.namespace.avatar" size="16"></span>
<span class="result-name">{{ result.namespace.name }}/{{ result.name }}</span>
<div class="result-description" ng-if="result.description">
<div class="description markdown-view" content="result.description"
first-line-only="true" placeholder-needed="false"></div>
<div class="description">
<markdown-view content="result.description"
first-line-only="true"
placeholder-needed="false"></markdown-view>
</div>
</div>
</span>
<span ng-switch-when="application">

View file

@ -168,6 +168,10 @@ angular.module('quay').directive('serviceKeysManager', function () {
loadServiceKeys();
}, ApiService.errorDisplay('Could not create service key'));
};
$scope.updateNewKeyNotes = function(content) {
$scope.newKey.notes = content;
};
$scope.showApproveKey = function(key) {
$scope.approvalKeyInfo = {
@ -195,6 +199,10 @@ angular.module('quay').directive('serviceKeysManager', function () {
callback(true);
}, errorHandler);
};
$scope.updateApprovalKeyInfoNotes = function(content) {
$scope.approvalKeyInfo.notes = content;
};
$scope.showCreateKey = function() {
$scope.newKey = {
@ -351,7 +359,11 @@ angular.module('quay').directive('serviceKeysManager', function () {
forAllKeys(info.keys, 'Could not approve service key', performer, callback);
};
$scope.updateApproveKeysInfoNotes = function(content) {
$scope.approveKeysInfo.notes = content;
};
$scope.changeKeysExpiration = function(info, callback) {
var performer = function(key) {
var data = {