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

[WIP]Request access to join private channels. #443

Closed
wants to merge 18 commits into from
Closed
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
1 change: 1 addition & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ rocketchat:mapview
rocketchat:markdown
rocketchat:mentions
rocketchat:mentions-flextab
rocketchat:message-action
rocketchat:message-attachments
rocketchat:message-mark-as-unread
rocketchat:message-pin
Expand Down
1 change: 1 addition & 0 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ rocketchat:mapview@0.0.1
rocketchat:markdown@0.0.2
rocketchat:mentions@0.0.1
rocketchat:mentions-flextab@0.0.1
rocketchat:message-action@0.0.1
rocketchat:message-attachments@0.0.1
rocketchat:message-mark-as-unread@0.0.1
rocketchat:message-pin@0.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,15 @@ Meteor.startup(function() {
};
}
});

RocketChat.MessageTypes.registerType({
id: 'join-private-channel',
system: true,
message: 'Room_join_request',
data(message) {
return {
user: `<a class="mention-link" data-username= "${ message.attachments[0].fields[0].requester }" >${ message.attachments[0].fields[0].requester } </a>`
};
}
});
});
250 changes: 134 additions & 116 deletions packages/rocketchat-channel-settings/client/views/channelSettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
<div class="rc-user-info__scroll">
{{#with settings.name}}
{{#if canView}}
<div class="rc-user-info__row">
<div class="rc-input">
<label class="rc-input__label">
<div class="rc-input__title">{{_ label}}{{equal default value '*'}}</div>
<div class="rc-input__wrapper">
<input type="text" name="name" value="{{value}}" class="rc-input__element js-input" disabled="{{./disabled}}"/>
</div>
</label>
<div class="rc-user-info__row">
<div class="rc-input">
<label class="rc-input__label">
<div class="rc-input__title">{{_ label}}{{equal default value '*'}}</div>
<div class="rc-input__wrapper">
<input type="text" name="name" value="{{value}}" class="rc-input__element js-input" disabled="{{./disabled}}"/>
</div>
</label>
</div>
</div>
</div>
{{/if}}
{{/with}}

Expand Down Expand Up @@ -119,47 +119,65 @@

{{#with settings.reactWhenReadOnly}}
{{#if canView}}
<div class="rc-user-info__row rc-user-info__row--separator">
<div class="rc-switch-double">
<div class="rc-switch-double__label {{equal false value 'disabled'}}">
{{_ "React_when_read_only"}}
<div class="rc-switch-double__description">
<div class="rc-user-info__row rc-user-info__row--separator">
<div class="rc-switch-double">
<div class="rc-switch-double__label {{equal false value 'disabled'}}">
{{_ "React_when_read_only"}}
<div class="rc-switch-double__description">
{{_ "React_when_read_only"}}
</div>
</div>
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<input type="checkbox" class="rc-switch__input js-input-check" name="reactWhenReadOnly" checked="{{checked}}" disabled="{{./disabled}}">
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
</div>
<div class="rc-switch-double__label {{equal true value 'disabled'}}">
{{_ "Disallow_reacting"}}
<div class="rc-switch-double__description">
{{_ "Disallow_reacting_Description"}}
</div>
</div>
</div>
</div>
{{/if}}
{{/with}}
{{#with settings.secret}}
{{#if settings.t.showSecretSetting settings.secret}}
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<input type="checkbox" class="rc-switch__input js-input-check" name="reactWhenReadOnly" checked="{{checked}}" disabled="{{./disabled}}">
<span class="rc-switch__text">
{{_ label}}{{equal default value '*'}}
</span>
<input type="checkbox" class="rc-switch__input js-input-check" name="secret" checked="{{checked}}" disabled="{{disabled}}">
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
</div>
<div class="rc-switch-double__label {{equal true value 'disabled'}}">
{{_ "Disallow_reacting"}}
<div class="rc-switch-double__description">
{{_ "Disallow_reacting_Description"}}
</div>
<div class="rc-switch-double__description">{{secretDescription}}</div>
</div>
</div>
</div>
{{/if}}
{{/with}}
{{#with settings.archived}}
{{#if canView}}
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<span class="rc-switch__text">
{{_ label}}{{equal default value '*'}}
</span>
<input type="checkbox" class="rc-switch__input js-input-check" name="archived" checked="{{checked}}" disabled="{{./disabled}}">
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<span class="rc-switch__text">
{{_ label}}{{equal default value '*'}}
</span>
<input type="checkbox" class="rc-switch__input js-input-check" name="archived" checked="{{checked}}" disabled="{{./disabled}}">
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
</div>
</div>
</div>
{{/if}}
{{/with}}

Expand All @@ -183,19 +201,19 @@

{{#with settings.broadcast}}
{{#if canView}}
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<span class="rc-switch__text">
{{_ label}}{{equal default value '*'}}
</span>
<input type="checkbox" class="rc-switch__input js-input-check" name="archived" checked="{{checked}}" disabled>
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<span class="rc-switch__text">
{{_ label}}{{equal default value '*'}}
</span>
<input type="checkbox" class="rc-switch__input js-input-check" name="archived" checked="{{checked}}" disabled>
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
</div>
</div>
</div>
{{/if}}
{{/with}}
{{#with settings.joinCode}}
Expand Down Expand Up @@ -226,7 +244,7 @@
</div>
{{/with}}
</div>
{{# if retentionEnabled settings.retentionEnabled.value.get }}
{{# if retentionEnabled settings.retentionEnabled.value.get }}
{{#with settings.retentionOverrideGlobal}}
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
Expand All @@ -242,61 +260,61 @@
</div>
</div>
{{/with}}
{{/if}}
{{# if settings.retentionOverrideGlobal.value.get }}
<div class="mail-messages__instructions mail-messages__instructions--warning" style="margin-bottom: 0;">
<div class="mail-messages__instructions-wrapper">
<div class="mail-messages__instructions-text">
<span>
{{{_ "RetentionPolicyRoom_ReadTheDocs"}}}
</span>
</div>
{{/if}}
{{# if settings.retentionOverrideGlobal.value.get }}
<div class="mail-messages__instructions mail-messages__instructions--warning" style="margin-bottom: 0;">
<div class="mail-messages__instructions-wrapper">
<div class="mail-messages__instructions-text">
<span>
{{{_ "RetentionPolicyRoom_ReadTheDocs"}}}
</span>
</div>
</div>
{{#with settings.retentionMaxAge}}
<div class="rc-user-info__row">
<div class="rc-input">
<label class="rc-input__label">
<div class="rc-input__title">{{retentionMaxAgeLabel label}}{{equal default value '*'}}</div>
<div class="rc-input__wrapper">
<input type="number" name="retentionMaxAge" value="{{value}}" class="rc-input__element js-input" disabled="{{./disabled}}"/>
</div>
</label>
</div>
</div>
{{#with settings.retentionMaxAge}}
<div class="rc-user-info__row">
<div class="rc-input">
<label class="rc-input__label">
<div class="rc-input__title">{{retentionMaxAgeLabel label}}{{equal default value '*'}}</div>
<div class="rc-input__wrapper">
<input type="number" name="retentionMaxAge" value="{{value}}" class="rc-input__element js-input" disabled="{{./disabled}}"/>
</div>
</label>
</div>
{{/with}}
{{#with settings.retentionExcludePinned}}
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<span class="rc-switch__text">
{{_ label}}{{equal default value '*'}}
</span>
<input type="checkbox" class="rc-switch__input js-input-check" name="retentionExcludePinned" checked="{{checked}}" disabled="{{./disabled}}">
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
</div>
</div>
{{/with}}
{{#with settings.retentionExcludePinned}}
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<span class="rc-switch__text">
{{_ label}}{{equal default value '*'}}
</span>
<input type="checkbox" class="rc-switch__input js-input-check" name="retentionExcludePinned" checked="{{checked}}" disabled="{{./disabled}}">
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
</div>
{{/with}}
{{#with settings.retentionFilesOnly}}
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<span class="rc-switch__text">
{{_ label}}{{equal default value '*'}}
</span>
<input type="checkbox" class="rc-switch__input js-input-check" name="retentionFilesOnly" checked="{{checked}}" disabled="{{./disabled}}">
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
</div>
</div>
{{/with}}
{{#with settings.retentionFilesOnly}}
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<span class="rc-switch__text">
{{_ label}}{{equal default value '*'}}
</span>
<input type="checkbox" class="rc-switch__input js-input-check" name="retentionFilesOnly" checked="{{checked}}" disabled="{{./disabled}}">
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
</div>
{{/with}}
</div>
{{/with}}
{{/if}}
{{/if}}
{{/if}}
</div>
<div class="rc-user-info__row">
<div class="rc-user-info__flex rc-user-info__row rc-user-info__row--separator">
Expand All @@ -306,7 +324,7 @@
</div>
<div class="rc-user-info__flex">
{{#if canDeleteRoom}}
<button class="rc-button rc-button--outline rc-button--cancel js-delete" title="{{_ 'Delete'}}">{{> icon icon='trash'}}{{_ 'Delete'}}</button>
<button class="rc-button rc-button--outline rc-button--cancel js-delete" title="{{_ 'Delete'}}">{{> icon icon='trash'}}{{_ 'Delete'}}</button>
{{/if}}
</div>
</div>
Expand All @@ -318,9 +336,9 @@
<div class="rc-user-info">
<div class="rc-user-info__avatar">
{{#if archived}}
<div class="rc-user-info__banner">
{{_ "Room_archived"}}
</div>
<div class="rc-user-info__banner">
{{_ "Room_archived"}}
</div>
{{/if}}
{{> avatar username=channelName}}
</div>
Expand Down Expand Up @@ -363,38 +381,38 @@ <h3 title="{{name}}" class="rc-user-info__name">{{> icon block="rc-header__icon"
{{#unless filesOnly}}
{{#unless excludePinned}}
{{_ "RetentionPolicy_RoomWarning" time=purgeTimeout}}
{{else}}
{{_ "RetentionPolicy_RoomWarning_Unpinned" time=purgeTimeout}}
{{/unless}}
{{else}}
{{#unless excludePinned}}
{{_ "RetentionPolicy_RoomWarning_FilesOnly" time=purgeTimeout}}
{{else}}
{{_ "RetentionPolicy_RoomWarning_UnpinnedFilesOnly" time=purgeTimeout}}
{{else}}
{{_ "RetentionPolicy_RoomWarning_Unpinned" time=purgeTimeout}}
{{/unless}}
{{else}}
{{#unless excludePinned}}
{{_ "RetentionPolicy_RoomWarning_FilesOnly" time=purgeTimeout}}
{{else}}
{{_ "RetentionPolicy_RoomWarning_UnpinnedFilesOnly" time=purgeTimeout}}
{{/unless}}
{{/unless}}
</div>
</div>
</div>
{{/if}}
{{/with}}
{{#each channelSettings}}
<div class="rc-user-info__row">
{{> Template.dynamic template=template data=data}}
</div>
{{/each}}
{{/with}}
{{#each channelSettings}}
<div class="rc-user-info__row">
{{> Template.dynamic template=template data=data}}
</div>
{{/each}}
</main>

<div class="rc-user-info__flex rc-user-info__row">
{{#if canEditRoom}}
<button class="rc-button rc-button--icon rc-button--outline js-edit" type="submit">{{> icon icon='edit'}}{{_ "Edit"}}</button>
<button class="rc-button rc-button--icon rc-button--outline js-edit" type="submit">{{> icon icon='edit'}}{{_ "Edit"}}</button>
{{/if}}
<button class="rc-button rc-button--icon rc-button--outline js-hide" type="submit">{{> icon icon='eye-off'}}{{_ "Hide"}}</button>
</div>
{{#if canLeaveRoom}}
<button class="rc-button rc-button--icon rc-button--outline rc-button--cancel js-leave">{{> icon icon='sign-out'}}{{_ "Leave"}}</button>
{{/if}}
{{#if canDeleteRoom}}
<button class="rc-button rc-button-outline rc-button-cancel js-delete rc-button--cancel rc-button--stack" title="{{_ 'Delete'}}">{{> icon icon='trash'}}{{_ 'Delete'}}</button>
<button class="rc-button rc-button-outline rc-button-cancel js-delete rc-button--cancel rc-button--stack" title="{{_ 'Delete'}}">{{> icon icon='trash'}}{{_ 'Delete'}}</button>
{{/if}}
</template>
Loading