Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow renaming of requests #12

Merged
merged 1 commit into from
Sep 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ Template.AssistifyCreateRequest.events({
console.log(err);
switch (err.error) {
case 'error-invalid-name':
toastr.error(TAPi18n.__('Invalid_room_name', name));
toastr.error(TAPi18n.__('Invalid_room_name', `${ expertise }...`));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like this is a real mistake, since 'expertise' has been there before.
Could it be that 'name' is a relict from a previous refactoring or this is relict by copy & paste?

return;
case 'error-duplicate-channel-name':
toastr.error(TAPi18n.__('Duplicate_channel_name', name));
toastr.error(TAPi18n.__('Request_already_exists'));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow up from previous fix

return;
case 'error-archived-duplicate-name':
toastr.error(TAPi18n.__('Duplicate_archived_channel_name', name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Template.channelSettings.onCreated(function() {
},
save(value, room) {
let nameValidation;
if (!RocketChat.authz.hasAllPermission('edit-room', room._id) || (room.t !== 'c' && room.t !== 'p')) {
if (!RocketChat.authz.hasAllPermission('edit-room', room._id) || (room.t !== 'c' && room.t !== 'p' && room.t !== 'e' && room.t !== 'r')) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the semantic of 'room.t' values.
Since I'm not that familiar with RC 'c', 'p', 'e', 'r' is not self explaining, even one could suggest.
Also I do not have any clue how the room type and the name vs. expertise thing belong together.

return toastr.error(t('error-not-allowed'));
}
if (!RocketChat.settings.get('UI_Allow_room_names_with_special_chars')) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

RocketChat.saveRoomName = function(rid, displayName, user, sendMessage = true) {
const room = RocketChat.models.Rooms.findOneById(rid);
if (room.t !== 'c' && room.t !== 'p') {
if (room.t !== 'c' && room.t !== 'p' && room.t !== 'r' && room.t !== 'e') {
throw new Meteor.Error('error-not-allowed', 'Not allowed', {
'function': 'RocketChat.saveRoomdisplayName'
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ Search_Requests: Anfragen suchen
Expertise: Thema
Expertises: Themen
Expertise_title: Titel des Themas
Request_already_exists: Eine Anfrage mit der nächsten laufenen Nummer existiert bereits. Bitte erneut versuchen.
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ New_request_for_expertise: New request for topic
Experts: Experts
Experts_channel: Experts channel
Search_Requests: Search requests
Request_already_exists: A request with the next rawn number already exists. Please try again.