Добавлен стиль приоритета на карточку в Wishlist-е

This commit is contained in:
Pavel Gnedov 2023-07-03 23:09:45 +07:00
parent ed451557f2
commit 62cb7d15ed

View file

@ -8,11 +8,14 @@ import * as IssueHrefNs from '../misc-components/issue-href';
import * as IssueDetailsDialogNs from '../misc-components/issue-details-dialog';
import * as UnreadedFlagNs from '../misc-components/unreaded-flag';
import { SpentHoursToFixed } from '../utils/spent-hours-to-fixed';
import { getStyleObjectFromString } from '../utils/style';
export type Props = {
store: IIssueStore
};
export const defaultPriorityStyleKey = 'priorityStyle';
export const IssuesListCard = observer((props: Props): JSX.Element => {
const unreadedStore = UnreadedFlagNs.CreateStoreFromLocalStorage(props.store);
const detailsStore = IssueDetailsDialogNs.Store.create({
@ -20,28 +23,7 @@ export const IssuesListCard = observer((props: Props): JSX.Element => {
visible: false,
unreadedFlagStore: unreadedStore
});
// return (
// <div className={Css.listItem} onClick={(e) => {e.stopPropagation(); detailsStore.show();}}>
// <IssueDetailsDialogNs.IssueDetailsDialog store={detailsStore}/>
// <div>
// <UnreadedFlagNs.UnreadedFlag store={unreadedStore}/>
// <TimePassedNs.TimePassed params={{ fromIssue: { issue: props.store, keyName: 'timePassedClass' } }}/>
// <span className={Css.issueSubject}>
// <IssueHrefNs.IssueHref
// url={props.store.url?.url || ''}
// subject={props.store.subject}
// tracker={props.store.tracker?.name || ''}
// id={props.store.id}
// />
// </span>
// <span className={Css.issueStatus}>| {props.store.status.name}</span>
// <span className={Css.issueTime}>| {props.store.total_spent_hours} / {props.store.total_estimated_hours}</span>
// </div>
// <div className={Css.tagsContainer}>
// <TagsNs.Tags params={{ tags: props.store.styledTags }}/>
// </div>
// </div>
// );
const priorityStyle = getStyleObjectFromString(props.store[defaultPriorityStyleKey]);
const tagsNewLine = (props.store.styledTags && props.store.styledTags.length > 0) ? <br/> : null;
return (
<div className={Css.todoBlock} onClick={(e) => { e.stopPropagation(); detailsStore.show(); }}>
@ -63,8 +45,8 @@ export const IssuesListCard = observer((props: Props): JSX.Element => {
{tagsNewLine}
<TagsNs.Tags params={{ tags: props.store.styledTags }} />
<div className={Css.positionInfo}>
<span className={Css.timeBox}>{props.store.status.name}</span>
<span className={Css.priorityBox}>{props.store.priority.name}</span>
<span className={Css.timeBox}>{props.store.status.name}</span><span> </span>
<span className={Css.priorityBox} style={priorityStyle}>{props.store.priority.name}</span>
</div>
</div>
</div>