-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1705 from zetkin/issue-1680/breadcrumbs-on-standa…
…lone-callAssignment Create functions to determine the url of a call assignment or survey.
- Loading branch information
Showing
7 changed files
with
39 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/features/callAssignments/utils/getCallAssignmentUrl.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ZetkinCallAssignment } from 'utils/types/zetkin'; | ||
|
||
export default function getCallAssignmentUrl( | ||
callAssignment: ZetkinCallAssignment | null | ||
) { | ||
if (callAssignment) { | ||
return `/organize/${callAssignment.organization.id}/projects/${ | ||
callAssignment.campaign ? `${callAssignment.campaign.id}` : 'standalone' | ||
}/callassignments/${callAssignment.id}`; | ||
} else { | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ZetkinSurvey } from 'utils/types/zetkin'; | ||
|
||
export default function getSurveyUrl(survey: ZetkinSurvey | null) { | ||
if (survey) { | ||
return `/organize/${survey.organization.id}/projects/${ | ||
survey.campaign ? `${survey.campaign.id}` : 'standalone' | ||
}/surveys/${survey.id}`; | ||
} else { | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters