Skip to content

Commit

Permalink
Enable multiline question while create new request (RocketChat#185)
Browse files Browse the repository at this point in the history
Enable multiline question while create new request

Travis failed inexplicably. Integration-tested locally with success
  • Loading branch information
vickyokrm authored and mrsimpson committed Mar 27, 2018
1 parent 9fa2f4f commit 8dc185c
Show file tree
Hide file tree
Showing 7 changed files with 961 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,33 @@
}
}
}

.create-channel__inputs {
.rc-input__textarea {
width: 100%;

height: 45px;

padding: 0.75rem 1rem 0.75rem 2.75rem;

color: var(--input-text-color);

border-width: var(--input-border-width);

border-color: var(--input-border-color);

border-radius: var(--input-border-radius);

background-color: transparent;

font: inherit;

resize: none;

max-height: 250px;

&::placeholder {
color: var(--input-placeholder-color);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,24 @@ <h1 class="create-channel__title">{{_ "Requests"}}</h1>
<div class="rc-input__icon">
{{> icon block="rc-input__icon-svg" icon="send"}}
</div>
<input name="first_question" type="text" class="rc-input__element" id="first_question"
placeholder={{_ "New_request_first_question"}} autocomplete="off">
<textarea name="first_question" class="help-request-context rc-input__textarea autogrow-short" placeholder="{{_ 'New_request_first_question'}}" maxlength="{{maxMessageLength}}"
id="first_question" rows="1"></textarea>
</div>
</label>
</div>
<div class="rc-input">
<input class="rc-button rc-button--primary js-save-request" type="submit" data-button="create"
value="{{_ "Create"}}" {{createIsDisabled}}>
</div>

</div>

</form>

</template>



<template name="AssistifyCreateRequestAutocomplete">
<li class="rc-popup-list__item">
<span class="rc-popup-list__item-name">{{{modifier item.name}}}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ Template.AssistifyCreateRequest.helpers({
titleError() {
const instance = Template.instance();
return instance.titleError.get();
},
maxMessageLength() {
return RocketChat.settings.get('Message_MaxAllowedSize');
}
});

Expand Down Expand Up @@ -142,7 +145,10 @@ Template.AssistifyCreateRequest.onRendered(function() {
const instance = this;
const expertiseElement = this.find('input[name="expertise"]');
const titleElement = this.find('input[name="request_title"]');
const questionElement = this.find('input[name="first_question"]');
const questionElement = this.find('[name="first_question"]');

//Bind autogrow property to 'First Question' element
questionElement.textarea = this.$('.rc-input__textarea').autogrow();

instance.ac.element = expertiseElement;
instance.ac.$element = $(instance.ac.element);
Expand Down
2 changes: 1 addition & 1 deletion packages/assistify-help-request/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ Meteor.startup(() => {
_createExpertsChannel();

RocketChat.theme.addPackageAsset(() => {
return Assets.getText('assets/stylesheets/helpRequestContext.less');
return Assets.getText('assets/stylesheets/helpRequest.less');
});
});
2 changes: 1 addition & 1 deletion packages/assistify-help-request/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Package.onUse(function(api) {
api.addFiles('client/hooks/openAiTab.js', 'client');

//Assets
api.addAssets('assets/stylesheets/helpRequestContext.less', 'server'); //has to be done on the server, it exposes the completed css to the client
api.addAssets('assets/stylesheets/helpRequest.less', 'server'); //has to be done on the server, it exposes the completed css to the client
api.addFiles('client/public/stylesheets/help-request.css', 'client');

//global UI modifications
Expand Down
Loading

0 comments on commit 8dc185c

Please sign in to comment.