Skip to content

Commit

Permalink
minor wording things and using shortenText function
Browse files Browse the repository at this point in the history
  • Loading branch information
kapil1garg committed May 23, 2024
1 parent f22fe5f commit 2e38d40
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 35 deletions.
8 changes: 1 addition & 7 deletions components/LastWeekIssueCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,7 @@ export default function LastWeekIssueCard({
<>
{/* Issue title */}
<div className="p-1 w-full flex flex-col">
<h2 className="text-xs font-semibold mb-auto">
{title.length > 100
? title.substring(0, 100 - 3) + '...'
: title.trim() === ''
? 'click to enter title'
: title}
</h2>
<h2 className="text-xs font-semibold mb-auto">{title}</h2>

{/* TODO: 05-07-24 maybe show that there are missing deliverables */}
<div className="flex flex-row items-center text-2xs font-medium mt-2 text-blue-600">
Expand Down
27 changes: 13 additions & 14 deletions components/LastWeekIssuePane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ export default function LastWeekIssuePane({
setPracticeGapData
}): JSX.Element {
// state variable for showing practice gaps
const [showPracticeGaps, setShowPracticeGaps] = useState(
'Show Gaps with Details'
);
const [showPracticeGaps, setShowPracticeGaps] = useState('Show Gaps');

// get the issue from soapData with the given issueId
const issueIndex = pastIssuesData.findIndex((issue) => issue.id === issueId);
Expand Down Expand Up @@ -148,8 +146,6 @@ export default function LastWeekIssuePane({
newPracticeOutcome.currentSprint = currentSprint;
}

console.log('newPracticeOutcome', newPracticeOutcome);

setPracticeOutcome(newPracticeOutcome);
};

Expand All @@ -160,7 +156,7 @@ export default function LastWeekIssuePane({
return {
practice: practice.replace('[reflect]', ''),
introText: 'Reflect on your own:',
type: 'reflect'
type: 'Reflect After Sprint:'
};
} else if (practice.includes('[plan]')) {
return {
Expand All @@ -172,20 +168,20 @@ export default function LastWeekIssuePane({
return {
practice: practice.replace('[self-work]', ''),
introText: 'On your own, try to:',
type: 'self-work'
type: 'Self-Work'
};
} else if (practice.includes('[help]')) {
if (practice.includes('mysore')) {
return {
practice: practice.replace('[help]', ''),
introText: 'At Mysore:',
type: 'help'
type: 'At Mysore'
};
} else if (practice.includes('pair research')) {
return {
practice: practice.replace('[help]', ''),
introText: 'At Pair Research:',
type: 'help'
type: 'At Pair Research'
};
}

Expand Down Expand Up @@ -256,7 +252,10 @@ export default function LastWeekIssuePane({
<div className="flex flex-wrap w-full">
{/* Split Pane in half with assesments on 1/3 */}
<div className="w-full flex flex-row">
<div className="w-1/4 flex flex-col mr-6">
<div className="w-1/3 flex flex-col mr-6">
<div className="text-xs italic mb-1">
Below are your notes from the last SIG meeting.
</div>
<h1 className="font-bold text-base">Context for Issue</h1>
{/* Context notes on Last Week's Issues */}
<div className="mb-2">
Expand Down Expand Up @@ -330,7 +329,7 @@ export default function LastWeekIssuePane({
</div>

{/* Show practice gaps linked to issue */}
<div className="w-3/4">
<div className="w-2/3">
<div className="flex flex-row items-center">
<h1 className="font-bold text-base">
Self-Regulation Gaps for Issue
Expand Down Expand Up @@ -440,7 +439,7 @@ export default function LastWeekIssuePane({
<div className="mb-4">
<div className="flex flex-row items-center text-xs font-normal border-b border-black">
<div className="text-sm font-semibold mr-1">
Plan Updating Practices
Plan Updates You Suggested
</div>
<LinkIcon className="h-4 stroke-2 mr-1 text-blue-600" />
<a
Expand Down Expand Up @@ -476,8 +475,8 @@ export default function LastWeekIssuePane({
{/* Stories and Deliverables */}
<div className="w-full flex flex-col mb-2">
<div className="w-full grid grid-cols-2 text-sm border-b border-black">
<div>Prior Sprint Stories</div>
<div>Prior Sprint Deliverables</div>
<div>Updated Sprint Stories</div>
<div>Updated Sprint Deliverables</div>
</div>
{practiceOutcome.currentSprint !== null && (
<>
Expand Down
9 changes: 3 additions & 6 deletions components/PracticeGapCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import CheckBadgeIcon from '@heroicons/react/24/outline/CheckBadgeIcon';

import React, { useState, useRef } from 'react';
import { useDrag } from 'react-dnd';
import { htmlToText, longDate, shortDate } from '../lib/helperFns';
import { htmlToText, longDate, shortDate, shortenText } from '../lib/helperFns';
import { DragTypes } from '../controllers/draggable/dragTypes';
import ContentEditable from 'react-contenteditable';
import { createNewPracticeGapObject } from '../controllers/practiceGapObjects/createPracticeGapObject';
Expand Down Expand Up @@ -259,22 +259,19 @@ export default function PracticeGapCard({
priorInstances && (
<div className="flex flex-col">
<h3 className="mt-4 text-xs font-medium border-b border-black">
Past items of concern with this practice gap:
Past items of concern with practice gap
</h3>

{priorInstances.map((instance, idx) => (
<div key={idx} className="flex flex-col mb-2">
<h2 className="mt-1 text-xs font-semibold">
{instance.title} |{' '}
{shortenText(instance.title, 50)} |{' '}
<span className="mt-1 text-2xs font-semibold">
{shortDate(new Date(instance.date))}
</span>
</h2>

<div className="w-full">
<h3 className="text-xs border-b">
Context from issue
</h3>
{instance.context.map((context, idx) => (
<div key={idx} className="text-xs">
{context.value.trim() !== '' && (
Expand Down
20 changes: 12 additions & 8 deletions pages/soap-notes/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';

// utilities
import { longDate, serializeDates, shortDate } from '../../lib/helperFns';
import {
longDate,
serializeDates,
shortDate,
shortenText
} from '../../lib/helperFns';

// data models and controllers
import { fetchCAPNote } from '../../controllers/capNotes/fetchCAPNotes';
Expand Down Expand Up @@ -304,11 +309,10 @@ export default function CAPNote({
{/* Set title of the page to be project name */}
<Head>
<title>
{`${
noteInfo.project.length > 15
? noteInfo.project.substring(0, 15 - 3) + '...'
: noteInfo.project
} | ${new Date(noteInfo.sigDate).toLocaleString().split(',')[0]}`}
{`${shortenText(
noteInfo.project,
15
)} | ${new Date(noteInfo.sigDate).toLocaleString().split(',')[0]}`}
</title>
</Head>

Expand Down Expand Up @@ -528,7 +532,7 @@ export default function CAPNote({
</div>
)}

{/* if a last week issue is selected */}
{/* if a current week issue is selected */}
{selectedIssue !== null &&
currentIssuesData.findIndex(
(issue) => issue.id === selectedIssue
Expand Down Expand Up @@ -577,7 +581,7 @@ export default function CAPNote({
</>
)}

{/* if a current week issue is selected */}
{/* if a last week issue is selected */}
{selectedIssue !== null &&
pastIssuesData.findIndex(
(issue) => issue.id === selectedIssue
Expand Down

0 comments on commit 2e38d40

Please sign in to comment.