Feature update

-- added support for adding links in intern update
-- removed separate link field for intern update
-- UI fix
This commit is contained in:
sairaj mote 2023-01-16 19:22:05 +05:30
parent c80459dc1b
commit a91d092dec
5 changed files with 14 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -664,6 +664,7 @@ ul {
} }
.multi-state-button button { .multi-state-button button {
z-index: 1; z-index: 1;
width: 100%;
} }
.password-field label { .password-field label {

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -631,6 +631,7 @@ ul {
} }
button { button {
z-index: 1; z-index: 1;
width: 100%;
} }
} }
.password-field { .password-field {

View File

@ -683,7 +683,6 @@
<sm-form> <sm-form>
<sm-textarea id="update__brief" placeholder="Type the update" rows="4" autofocus required> <sm-textarea id="update__brief" placeholder="Type the update" rows="4" autofocus required>
</sm-textarea> </sm-textarea>
<sm-input id="update__link" placeholder="Related link (optional)" animate></sm-input>
<div class="multi-state-button"> <div class="multi-state-button">
<button id="post_update_btn" title="post this update" class="button button--primary" type="submit" <button id="post_update_btn" title="post this update" class="button button--primary" type="submit"
disabled onclick="postUpdate()"> disabled onclick="postUpdate()">
@ -1982,6 +1981,10 @@
const { floID, time, note, update: { projectCode, branch, task, description, link }, tag } = update const { floID, time, note, update: { projectCode, branch, task, description, link }, tag } = update
let topic = `${RIBC.getProjectDetails(projectCode).projectName} / ${RIBC.getTaskDetails(projectCode, branch, task).title}` let topic = `${RIBC.getProjectDetails(projectCode).projectName} / ${RIBC.getTaskDetails(projectCode, branch, task).title}`
const internName = RIBC.getInternList()[floID] const internName = RIBC.getInternList()[floID]
const updateMessage = createElement('p', {
className: 'update__message ws-pre-line wrap-around',
innerHTML: DOMPurify.sanitize(linkify(description))
})
let replyButton let replyButton
let saveButton let saveButton
if (userType === "admin") { if (userType === "admin") {
@ -2008,7 +2011,7 @@
<span class="update__time">${getFormattedTime(time)}</span> <span class="update__time">${getFormattedTime(time)}</span>
</div> </div>
<h4 class="update__topic">${topic}</h4> <h4 class="update__topic">${topic}</h4>
<p class="update__message ws-pre-line wrap-around">${description}</p> ${updateMessage}
${providedLink} ${providedLink}
${adminReply} ${adminReply}
${saveButton || replyButton ? html`<div class="flex align-center gap-0-3">${saveButton}${replyButton}</div>` : ''} ${saveButton || replyButton ? html`<div class="flex align-center gap-0-3">${saveButton}${replyButton}</div>` : ''}
@ -3621,11 +3624,9 @@
function postUpdate() { function postUpdate() {
const [projectCode, branch, task] = currentTaskId.split('_') const [projectCode, branch, task] = currentTaskId.split('_')
const description = getRef('update__brief').value.trim() const description = getRef('update__brief').value.trim()
const linkText = getRef('update__link').value.trim()
const link = linkText !== '' ? linkText : null
if (description !== '') { if (description !== '') {
buttonLoader(getRef('post_update_btn'), true) buttonLoader(getRef('post_update_btn'), true)
RIBC.postInternUpdate({ projectCode, branch, task, description, link }) RIBC.postInternUpdate({ projectCode, branch, task, description })
.then((result) => { .then((result) => {
notify('Update posted', 'success') notify('Update posted', 'success')
closePopup() closePopup()