Skip to content

Commit

Permalink
Rename team messages to scratchpad (#767)
Browse files Browse the repository at this point in the history
* Rename team messages to scratchpad

* Renaming more team messages

* Rename migration file

Co-authored-by: Aditya Bharadwaj <aditya@b12.io>
  • Loading branch information
adbharadwaj and Aditya Bharadwaj committed Apr 21, 2021
1 parent 4cc11ad commit 30a91f4
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 34 deletions.
2 changes: 1 addition & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ All requests must be signed using `HTTP signatures <http://tools.ietf.org/html/d
"id": 123,
"short_description": "Project Description",
"priority": 10,
"team_messages_url": "http://review.document.url",
"scratchpad_url": "http://review.document.url",
"task_class": 1,
"project_data": {
"sample_data_item": "sample_data_value_new"
Expand Down
4 changes: 2 additions & 2 deletions docs/source/getting_started_transcript.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Information received! Here's what we got::
'project': {'id': 5,
'priority': 10,
'project_data': {'url': 'http://www.josephbotros.com/'},
'team_messages_url': 'https://docs.google.com/document/d/1s0IJycNAwHtZfsUwyo6lCJ7kI9pTOZddcaiRDdZUSAs',
'scratchpad_url': 'https://docs.google.com/document/d/1s0IJycNAwHtZfsUwyo6lCJ7kI9pTOZddcaiRDdZUSAs',
'short_description': 'A test run of our simple workflow',
'start_datetime': '2015-09-25T17:51:14.784739Z',
'task_class': 0,
Expand Down Expand Up @@ -94,7 +94,7 @@ Information received! Here's what we got::
'project': {'id': 5,
'priority': 10,
'project_data': {'url': 'http://www.josephbotros.com/'},
'team_messages_url': 'https://docs.google.com/document/d/1s0IJycNAwHtZfsUwyo6lCJ7kI9pTOZddcaiRDdZUSAs',
'scratchpad_url': 'https://docs.google.com/document/d/1s0IJycNAwHtZfsUwyo6lCJ7kI9pTOZddcaiRDdZUSAs',
'short_description': 'A test run of our simple workflow',
'start_datetime': '2015-09-25T17:51:14.784739Z',
'task_class': 0,
Expand Down
8 changes: 4 additions & 4 deletions orchestra/google_apps/convenience.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
logger = logging.getLogger(__name__)
_image_mimetype_regex = re.compile('(image/(?:jpg|jpeg|gif|png|svg))',
re.IGNORECASE)
TEAM_MESSAGES_TEMPLATE_ID = '1d0kIgq8G_Su6j5abP-tP6yJ2sp-sFDk6vZiREil0_70'
SCRATCHPAD_TEMPLATE_ID = '1d0kIgq8G_Su6j5abP-tP6yJ2sp-sFDk6vZiREil0_70'
GSPREAD_RE = re.compile('https://docs.google.com/spreadsheets/d/([^/]*)/.*')
GSPREAD_EXPORT_URL = ('https://docs.google.com/spreadsheets/d/'
'{}/export?format=csv')
Expand Down Expand Up @@ -140,9 +140,9 @@ def create_project_google_folder(project):
[write_with_link_permission])
folder_id = folder.get('id')
project.project_data['project_folder_id'] = folder_id
project.team_messages_url = create_document_from_template(
TEAM_MESSAGES_TEMPLATE_ID,
'Team Messages',
project.scratchpad_url = create_document_from_template(
SCRATCHPAD_TEMPLATE_ID,
'Scratchpad',
[folder_id],
[write_with_link_permission])['alternateLink']
project.save()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_project_information_api(self):
expected_project = {
'task_class': project.task_class,
'start_datetime': '2015-10-12T00:00:00Z',
'team_messages_url': None,
'scratchpad_url': None,
'admin_url': settings.ORCHESTRA_URL + reverse(
'admin:orchestra_project_change',
args=(project.id,)),
Expand Down
18 changes: 18 additions & 0 deletions orchestra/migrations/0094_rename_team_messages_url.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.13 on 2021-04-19 17:47

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('orchestra', '0093_todo_status_default'),
]

operations = [
migrations.RenameField(
model_name='project',
old_name='team_messages_url',
new_name='scratchpad_url',
),
]
4 changes: 2 additions & 2 deletions orchestra/models/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class Project(ProjectMixin, models.Model):
task_class (int):
Represents whether the project is a worker training exercise
or a deliverable project.
team_messages_url (str):
scratchpad_url (str):
A scratchpad in which teammates can collaborate, created only if
Google Apps support is turned on.
slack_group_id (str):
Expand Down Expand Up @@ -419,7 +419,7 @@ class Status:
project_data = JSONField(default={}, blank=True)
task_class = models.IntegerField(
choices=WorkerCertification.TASK_CLASS_CHOICES)
team_messages_url = models.URLField(null=True, blank=True)
scratchpad_url = models.URLField(null=True, blank=True)
slack_group_id = models.CharField(max_length=200, null=True, blank=True)

class Meta:
Expand Down
2 changes: 1 addition & 1 deletion orchestra/project_api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Meta:
'start_datetime',
'priority',
'project_data',
'team_messages_url',
'scratchpad_url',
'task_class',
'status'
)
Expand Down
2 changes: 1 addition & 1 deletion orchestra/project_api/tests/test_project_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_project_information(self):
'workflow_slug': 'w1',
'workflow_version_slug': 'test_workflow',
'project_data': {},
'team_messages_url': None,
'scratchpad_url': None,
'priority': 0,
'status': 0
},
Expand Down
18 changes: 9 additions & 9 deletions orchestra/static/dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32540,9 +32540,9 @@ var _quillDirectiveEs = __webpack_require__(165);

var _quillDirectiveEs2 = _interopRequireDefault(_quillDirectiveEs);

var _teamMessagesDirectiveEs = __webpack_require__(172);
var _scratchpadDirectiveEs = __webpack_require__(172);

var _teamMessagesDirectiveEs2 = _interopRequireDefault(_teamMessagesDirectiveEs);
var _scratchpadDirectiveEs2 = _interopRequireDefault(_scratchpadDirectiveEs);

var _projectFolderDirectiveEs = __webpack_require__(174);

Expand All @@ -32557,7 +32557,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
/* global angular */

var name = 'orchestra.common';
angular.module('orchestra.common', []).factory('orchestraService', _orchestraServicesEs.orchestraService).factory('orchestraTasks', _orchestraServicesEs.orchestraTasks).factory('orchestraApi', _orchestra_apiEs2.default).factory('helpers', _helpersEs2.default).filter('capitalize', _orchestraFiltersEs.capitalize).filter('toArray', _orchestraFiltersEs.toArray).directive('orchestraChecklist', _checklistDirectiveEs2.default).directive('orchestraChecklistItem', _checklistItemDirectiveEs2.default).directive('orchestraQuill', _quillDirectiveEs2.default).directive('orchestraTeamMessages', _teamMessagesDirectiveEs2.default).directive('projectFolder', _projectFolderDirectiveEs2.default).directive('websiteIframe', _websiteIframeDirectiveEs2.default);
angular.module('orchestra.common', []).factory('orchestraService', _orchestraServicesEs.orchestraService).factory('orchestraTasks', _orchestraServicesEs.orchestraTasks).factory('orchestraApi', _orchestra_apiEs2.default).factory('helpers', _helpersEs2.default).filter('capitalize', _orchestraFiltersEs.capitalize).filter('toArray', _orchestraFiltersEs.toArray).directive('orchestraChecklist', _checklistDirectiveEs2.default).directive('orchestraChecklistItem', _checklistItemDirectiveEs2.default).directive('orchestraQuill', _quillDirectiveEs2.default).directive('orchestraScratchpad', _scratchpadDirectiveEs2.default).directive('projectFolder', _projectFolderDirectiveEs2.default).directive('websiteIframe', _websiteIframeDirectiveEs2.default);

exports.default = name;

Expand Down Expand Up @@ -60482,17 +60482,17 @@ module.exports = SnowTheme;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = orchestraTeamMessages;
exports.default = orchestraScratchpad;

var _teamMessages = __webpack_require__(173);
var _scratchpad = __webpack_require__(173);

var _teamMessages2 = _interopRequireDefault(_teamMessages);
var _scratchpad2 = _interopRequireDefault(_scratchpad);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function orchestraTeamMessages() {
function orchestraScratchpad() {
return {
template: _teamMessages2.default,
template: _scratchpad2.default,
restrict: 'E',
controllerAs: 'vm',
controller: function controller($scope, orchestraService) {
Expand All @@ -60506,7 +60506,7 @@ function orchestraTeamMessages() {
/* 173 */
/***/ (function(module, exports) {

module.exports = "<website-iframe title=\"Team Messages\"\n\t\tid=\"team-messages\" \n\t\tng-if=\"vm.taskAssignment.project.team_messages_url\"\n\t\tiframe-url=\"{{vm.taskAssignment.project.team_messages_url}}\">\n</website-iframe>\n";
module.exports = "<website-iframe title=\"Scratchpad\"\n\t\tid=\"scratchpad\" \n\t\tng-if=\"vm.taskAssignment.project.scratchpad_url\"\n\t\tiframe-url=\"{{vm.taskAssignment.project.scratchpad_url}}\">\n</website-iframe>\n";

/***/ }),
/* 174 */
Expand Down
4 changes: 2 additions & 2 deletions orchestra/static/orchestra/common/common.module.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import orchestraChecklist from 'orchestra/common/components/checklist/checklist.directive.es6.js'
import orchestraChecklistItem from 'orchestra/common/components/checklist/checklist-item.directive.es6.js'
import orchestraQuill from 'orchestra/common/components/quill/quill.directive.es6.js'
import orchestraTeamMessages from 'orchestra/common/components/team-messages/team-messages.directive.es6.js'
import orchestraScratchpad from 'orchestra/common/components/scratchpad/scratchpad.directive.es6.js'
import projectFolder from 'orchestra/common/components/project-folder/project-folder.directive.es6.js'
import websiteIframe from 'orchestra/common/components/website-iframe/website-iframe.directive.es6.js'

Expand All @@ -30,7 +30,7 @@ angular.module('orchestra.common', [])
.directive('orchestraChecklist', orchestraChecklist)
.directive('orchestraChecklistItem', orchestraChecklistItem)
.directive('orchestraQuill', orchestraQuill)
.directive('orchestraTeamMessages', orchestraTeamMessages)
.directive('orchestraScratchpad', orchestraScratchpad)
.directive('projectFolder', projectFolder)
.directive('websiteIframe', websiteIframe)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import template from './team-messages.html'
import template from './scratchpad.html'

export default function orchestraTeamMessages () {
export default function orchestraScratchpad () {
return {
template,
restrict: 'E',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<website-iframe title="Scratchpad"
id="scratchpad"
ng-if="vm.taskAssignment.project.scratchpad_url"
iframe-url="{{vm.taskAssignment.project.scratchpad_url}}">
</website-iframe>

This file was deleted.

2 changes: 1 addition & 1 deletion orchestra/tests/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def _verify_good_task_assignment_information(
'project_data': {},
'status': dict(
Project.STATUS_CHOICES)[task.project.status],
'team_messages_url': None},
'scratchpad_url': None},
'status': assignment_status,
'task': {'data': task_data, 'status': task_status},
'task_id': task.id,
Expand Down
2 changes: 1 addition & 1 deletion orchestra/tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_create_project_google_folder(self):
project_folder = create_project_google_folder(project)
self.assertEqual(project_folder['id'], 1)
self.assertEqual(
project.team_messages_url, 'http://a.google.com/link')
project.scratchpad_url, 'http://a.google.com/link')

@override_settings(ORCHESTRA_SLACK_EXPERTS_ENABLED=True)
def test_create_project_slack_group(self):
Expand Down
2 changes: 1 addition & 1 deletion orchestra/utils/task_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def get_task_details(task_id):
'project': {
'id': project.id,
'details': project.short_description,
'team_messages_url': project.team_messages_url,
'scratchpad_url': project.scratchpad_url,
'project_data': project.project_data,
'status': dict(Project.STATUS_CHOICES)[project.status]
},
Expand Down
2 changes: 1 addition & 1 deletion orchestra/utils/tests/test_task_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def test_get_task_overview_for_worker(self):
'id': task.project.id,
'project_data': {},
'status': 'Active',
'team_messages_url': None},
'scratchpad_url': None},
'workflow': {'slug': 'w1',
'name': 'Workflow One'},
'workflow_version': {'slug': 'test_workflow',
Expand Down

0 comments on commit 30a91f4

Please sign in to comment.