fix: github colored circles
This commit is contained in:
parent
0a4a465d53
commit
dfdc8cc154
5 changed files with 30 additions and 12 deletions
|
|
@ -7,7 +7,8 @@ import { addActivity, init, edit, fetchAssignments, fetchMeta } from 'Duck/assig
|
||||||
const SelectedValue = ({ icon, text }) => {
|
const SelectedValue = ({ icon, text }) => {
|
||||||
return(
|
return(
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<img className="mr-2" src={ icon } width="13" height="13" />
|
{/* <img className="mr-2" src={ icon } width="13" height="13" /> */}
|
||||||
|
{ icon }
|
||||||
<span>{ text }</span>
|
<span>{ text }</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
@ -52,8 +53,9 @@ class IssueForm extends React.PureComponent {
|
||||||
const { creating, projects, users, issueTypes, instance, closeHandler, metaLoading } = this.props;
|
const { creating, projects, users, issueTypes, instance, closeHandler, metaLoading } = this.props;
|
||||||
const projectOptions = projects.map(({name, id}) => ({text: name, value: id })).toArray();
|
const projectOptions = projects.map(({name, id}) => ({text: name, value: id })).toArray();
|
||||||
const userOptions = users.map(({name, id}) => ({text: name, value: id })).toArray();
|
const userOptions = users.map(({name, id}) => ({text: name, value: id })).toArray();
|
||||||
const issueTypeOptions = issueTypes.map(({name, id, iconUrl }) => {
|
|
||||||
return {text: name, value: id, iconUrl, icon: <img className="pt-2" src={ iconUrl } /> }
|
const issueTypeOptions = issueTypes.map(({name, id, iconUrl, color }) => {
|
||||||
|
return {text: name, value: id, iconUrl, color }
|
||||||
}).toArray();
|
}).toArray();
|
||||||
|
|
||||||
const selectedIssueType = issueTypes.filter(issue => issue.id == instance.issueType).first();
|
const selectedIssueType = issueTypes.filter(issue => issue.id == instance.issueType).first();
|
||||||
|
|
@ -80,6 +82,7 @@ class IssueForm extends React.PureComponent {
|
||||||
<Dropdown
|
<Dropdown
|
||||||
selection
|
selection
|
||||||
name="issueType"
|
name="issueType"
|
||||||
|
labeled
|
||||||
options={ issueTypeOptions }
|
options={ issueTypeOptions }
|
||||||
value={ instance.issueType }
|
value={ instance.issueType }
|
||||||
fluid
|
fluid
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ const IssueHeader = ({issue, typeIcon, assignee}) => {
|
||||||
{/* <GotoSessionLink /> */}
|
{/* <GotoSessionLink /> */}
|
||||||
{/* <ActiveIssueClose /> */}
|
{/* <ActiveIssueClose /> */}
|
||||||
<div className="flex leading-none mb-2 items-center">
|
<div className="flex leading-none mb-2 items-center">
|
||||||
<img className="mr-2" src={typeIcon} alt="" width={16} height={16} />
|
{ typeIcon }
|
||||||
|
{/* <img className="mr-2" src={typeIcon} alt="" width={16} height={16} /> */}
|
||||||
<span className="mr-2 font-medium">{ issue.id }</span>
|
<span className="mr-2 font-medium">{ issue.id }</span>
|
||||||
{/* <div className="text-gray-700 text-sm">{ '@ 00:13 Secs'}</div> */}
|
{/* <div className="text-gray-700 text-sm">{ '@ 00:13 Secs'}</div> */}
|
||||||
{ assignee &&
|
{ assignee &&
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@ const IssueListItem = ({ issue, onClick, icon, user, active }) => {
|
||||||
>
|
>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<img src={ icon } width="16" height="16" className="mr-3" />
|
{ icon }
|
||||||
|
{/* <img src={ icon } width="16" height="16" className="mr-3" /> */}
|
||||||
<span>{ issue.id }</span>
|
<span>{ issue.id }</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import withRequestState, { RequestTypes } from './requestStateCreator';
|
||||||
import { createListUpdater, createItemInListUpdater } from './funcTools/tools';
|
import { createListUpdater, createItemInListUpdater } from './funcTools/tools';
|
||||||
import { editType, initType } from './funcTools/crud/types';
|
import { editType, initType } from './funcTools/crud/types';
|
||||||
import { createInit, createEdit } from './funcTools/crud';
|
import { createInit, createEdit } from './funcTools/crud';
|
||||||
|
import IssuesType from 'Types/issue/issuesType'
|
||||||
|
|
||||||
const idKey = 'id';
|
const idKey = 'id';
|
||||||
const name = 'assignment';
|
const name = 'assignment';
|
||||||
|
|
@ -41,17 +42,20 @@ const reducer = (state = initialState, action = {}) => {
|
||||||
return state.mergeIn([ 'instance' ], action.instance);
|
return state.mergeIn([ 'instance' ], action.instance);
|
||||||
case FETCH_PROJECTS.SUCCESS:
|
case FETCH_PROJECTS.SUCCESS:
|
||||||
return state.set('projects', List(action.data)).set('projectsFetched', true);
|
return state.set('projects', List(action.data)).set('projectsFetched', true);
|
||||||
case FETCH_ASSIGNMENTS.SUCCESS:
|
case FETCH_ASSIGNMENTS.SUCCESS:
|
||||||
return state.set('list', List(action.data).map(Assignment));
|
return state.set('list', List(action.data.issues).map(Assignment));
|
||||||
case FETCH_ASSIGNMENT.SUCCESS:
|
case FETCH_ASSIGNMENT.SUCCESS:
|
||||||
return state.set('activeIssue', Assignment({ ...action.data, users}));
|
return state.set('activeIssue', Assignment({ ...action.data, users}));
|
||||||
case FETCH_META.SUCCESS:
|
case FETCH_META.SUCCESS:
|
||||||
issueTypes = action.data.issueTypes;
|
issueTypes = List(action.data.issueTypes).map(IssuesType);
|
||||||
var issueTypeIcons = {}
|
var issueTypeIcons = {}
|
||||||
for (var i =0; i < issueTypes.length; i++) {
|
// for (var i =0; i < issueTypes.length; i++) {
|
||||||
issueTypeIcons[issueTypes[i].id] = issueTypes[i].iconUrl
|
// issueTypeIcons[issueTypes[i].id] = issueTypes[i].iconUrl
|
||||||
}
|
// }
|
||||||
return state.set('issueTypes', List(issueTypes))
|
issueTypes.forEach(iss => {
|
||||||
|
issueTypeIcons[iss.id] = iss.iconUrl
|
||||||
|
})
|
||||||
|
return state.set('issueTypes', issueTypes)
|
||||||
.set('users', List(action.data.users))
|
.set('users', List(action.data.users))
|
||||||
.set('issueTypeIcons', issueTypeIcons)
|
.set('issueTypeIcons', issueTypeIcons)
|
||||||
case ADD_ACTIVITY.SUCCESS:
|
case ADD_ACTIVITY.SUCCESS:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,16 @@ import Record from 'Types/Record';
|
||||||
|
|
||||||
export default Record({
|
export default Record({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
|
color: undefined,
|
||||||
|
description: '',
|
||||||
name: undefined,
|
name: undefined,
|
||||||
iconUrl: undefined
|
iconUrl: undefined
|
||||||
}, {
|
}, {
|
||||||
|
fromJS: ({ iconUrl, color, ...issueType }) => ({
|
||||||
|
...issueType,
|
||||||
|
color,
|
||||||
|
iconUrl: iconUrl ?
|
||||||
|
<img className="mr-2" src={ iconUrl } width="13" height="13" /> :
|
||||||
|
<div className="mr-2 w-2 h-2 rounded-full float-left" style={{ backgroundColor: `#${color}`}} />,
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue