Browser extension fixes (#8)

* Set full url on service

* Link logo to `/activities` in modal

* Update changelog

* Honor the selected task and set the correct billability
This commit is contained in:
Manuel Bouza
2019-03-30 06:59:18 +01:00
committed by Tobias Miesel
parent 0f5172a820
commit 02a0bec738
10 changed files with 87 additions and 52 deletions

View File

@@ -36,6 +36,7 @@ class App extends Component {
projectId: PropTypes.string,
taskId: PropTypes.string
}),
subdomain: PropTypes.string,
activities: PropTypes.array,
schedules: PropTypes.array,
projects: PropTypes.array,
@@ -62,12 +63,14 @@ class App extends Component {
const { service, projects, lastProjectId, lastTaskId } = this.props
const project =
findProjectByValue(this.changeset.assignment_id)(projects) ||
findProjectByIdentifier(service?.projectId)(projects) ||
findProjectByValue(Number(lastProjectId))(projects) ||
head(projects)
const task =
findTask(service?.taskId || lastTaskId)(project) || head(project?.tasks)
findTask(this.changeset.task_id || service?.taskId || lastTaskId)(project) ||
head(project?.tasks)
const defaults = {
remote_service: service?.name,
@@ -108,7 +111,7 @@ class App extends Component {
if (name === "assignment_id") {
const project = findProjectByValue(value)(projects)
this.changeset.task_id = head(project?.tasks).value || null
this.changeset.task_id = head(project?.tasks)?.value
}
};
@@ -145,6 +148,7 @@ class App extends Component {
render() {
const {
loading,
subdomain,
projects,
activities,
schedules,
@@ -179,7 +183,7 @@ class App extends Component {
>
{props => (
<animated.div className="moco-bx-app-container" style={props}>
<Header />
<Header subdomain={subdomain} />
<Observer>
{() => (
<>