Merge branch 'preview' of github.com:makeplane/plane into preview
This commit is contained in:
commit
0d6e581789
6 changed files with 43 additions and 20 deletions
|
|
@ -55,7 +55,6 @@ class IssueSerializer(BaseSerializer):
|
|||
"project",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
]
|
||||
exclude = [
|
||||
|
|
|
|||
|
|
@ -309,6 +309,11 @@ class IssueAPIEndpoint(BaseAPIView):
|
|||
)
|
||||
|
||||
serializer.save()
|
||||
# Refetch the issue
|
||||
issue = Issue.objects.filter(workspace__slug=slug, project_id=project_id, pk=serializer.data["id"]).first()
|
||||
issue.created_at = request.data.get("created_at")
|
||||
issue.save(update_fields=["created_at"])
|
||||
|
||||
|
||||
# Track the issue
|
||||
issue_activity.delay(
|
||||
|
|
|
|||
|
|
@ -582,17 +582,18 @@ def create_issue_activity(
|
|||
issue_activities,
|
||||
epoch,
|
||||
):
|
||||
issue_activities.append(
|
||||
IssueActivity(
|
||||
issue_id=issue_id,
|
||||
project_id=project_id,
|
||||
workspace_id=workspace_id,
|
||||
comment="created the issue",
|
||||
verb="created",
|
||||
actor_id=actor_id,
|
||||
epoch=epoch,
|
||||
)
|
||||
issue = Issue.objects.get(pk=issue_id)
|
||||
issue_activity = IssueActivity.objects.create(
|
||||
issue_id=issue_id,
|
||||
project_id=project_id,
|
||||
workspace_id=workspace_id,
|
||||
comment="created the issue",
|
||||
verb="created",
|
||||
actor_id=actor_id,
|
||||
epoch=epoch,
|
||||
)
|
||||
issue_activity.created_at = issue.created_at
|
||||
issue_activity.save(update_fields=["created_at"])
|
||||
requested_data = (
|
||||
json.loads(requested_data) if requested_data is not None else None
|
||||
)
|
||||
|
|
@ -1717,12 +1718,16 @@ def issue_activity(
|
|||
event=(
|
||||
"issue_comment"
|
||||
if activity.field == "comment"
|
||||
else "inbox_issue" if inbox else "issue"
|
||||
else "inbox_issue"
|
||||
if inbox
|
||||
else "issue"
|
||||
),
|
||||
event_id=(
|
||||
activity.issue_comment_id
|
||||
if activity.field == "comment"
|
||||
else inbox if inbox else activity.issue_id
|
||||
else inbox
|
||||
if inbox
|
||||
else activity.issue_id
|
||||
),
|
||||
verb=activity.verb,
|
||||
field=(
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export const ActiveCycleRoot: React.FC<IActiveCycleDetails> = observer((props) =
|
|||
{!currentProjectActiveCycle ? (
|
||||
<EmptyState type={EmptyStateType.PROJECT_CYCLE_ACTIVE} size="sm" />
|
||||
) : (
|
||||
<div className="flex flex-col bg-custom-background-90">
|
||||
<div className="flex flex-col bg-custom-background-90 border-b border-custom-border-200">
|
||||
{currentProjectActiveCycleId && (
|
||||
<CyclesListItem
|
||||
key={currentProjectActiveCycleId}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import React, { useState } from "react";
|
||||
import intersection from "lodash/intersection";
|
||||
import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
import { Dialog, Transition } from "@headlessui/react";
|
||||
|
|
@ -9,11 +10,10 @@ import { IUser, IImporterService } from "@plane/types";
|
|||
// ui
|
||||
import { Button, CustomSearchSelect, TOAST_TYPE, setToast } from "@plane/ui";
|
||||
// hooks
|
||||
import { useProject } from "@/hooks/store";
|
||||
import { useProject, useUser } from "@/hooks/store";
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
// services
|
||||
import { ProjectExportService } from "@/services/project";
|
||||
|
||||
type Props = {
|
||||
isOpen: boolean;
|
||||
handleClose: () => void;
|
||||
|
|
@ -35,8 +35,13 @@ export const Exporter: React.FC<Props> = observer((props) => {
|
|||
const { workspaceSlug } = useParams();
|
||||
// store hooks
|
||||
const { workspaceProjectIds, getProjectById } = useProject();
|
||||
const { projectsWithCreatePermissions } = useUser();
|
||||
|
||||
const options = workspaceProjectIds?.map((projectId) => {
|
||||
const wsProjectIdsWithCreatePermisisons = projectsWithCreatePermissions
|
||||
? intersection(workspaceProjectIds, Object.keys(projectsWithCreatePermissions))
|
||||
: [];
|
||||
|
||||
const options = wsProjectIdsWithCreatePermisisons?.map((projectId) => {
|
||||
const projectDetails = getProjectById(projectId);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import { ImportExportSettingsLoader } from "@/components/ui";
|
|||
// constants
|
||||
import { EmptyStateType } from "@/constants/empty-state";
|
||||
import { EXPORT_SERVICES_LIST } from "@/constants/fetch-keys";
|
||||
import { EXPORTERS_LIST } from "@/constants/workspace";
|
||||
import { EUserWorkspaceRoles, EXPORTERS_LIST } from "@/constants/workspace";
|
||||
// hooks
|
||||
import { useProject, useUser } from "@/hooks/store";
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
|
|
@ -37,7 +37,11 @@ const IntegrationGuide = observer(() => {
|
|||
const searchParams = useSearchParams();
|
||||
const provider = searchParams.get("provider");
|
||||
// store hooks
|
||||
const { data: currentUser } = useUser();
|
||||
const {
|
||||
data: currentUser,
|
||||
canPerformAnyCreateAction,
|
||||
membership: { currentWorkspaceRole },
|
||||
} = useUser();
|
||||
const { workspaceProjectIds } = useProject();
|
||||
|
||||
const { data: exporterServices } = useSWR(
|
||||
|
|
@ -52,6 +56,7 @@ const IntegrationGuide = observer(() => {
|
|||
};
|
||||
|
||||
const hasProjects = workspaceProjectIds && workspaceProjectIds.length > 0;
|
||||
const isAdmin = currentWorkspaceRole === EUserWorkspaceRoles.ADMIN;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
@ -76,7 +81,11 @@ const IntegrationGuide = observer(() => {
|
|||
<div className="flex-shrink-0">
|
||||
<Link href={`/${workspaceSlug}/settings/exports?provider=${service.provider}`}>
|
||||
<span>
|
||||
<Button variant="primary" className="capitalize" disabled={!hasProjects}>
|
||||
<Button
|
||||
variant="primary"
|
||||
className="capitalize"
|
||||
disabled={!isAdmin && (!hasProjects || !canPerformAnyCreateAction)}
|
||||
>
|
||||
{service.type}
|
||||
</Button>
|
||||
</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue