fix: webview redirection logs & description rendering (#2433)

* fix: redirection console logs

* fix: sub issues overflow

* fix: cycle bottom sheet typo

* fix: description rendering

* fix: formatting
This commit is contained in:
Lakhan Baheti 2023-10-16 20:27:55 +05:30 committed by GitHub
parent 651b252c23
commit ceb878e72f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 28 deletions

View File

@ -235,7 +235,7 @@ const activityDetails: {
JSON.stringify({
cycle_id: activity.new_identifier ?? activity.old_identifier,
project_id: activity.project,
cycle_name: activity.verb === "created" ? activity.new_value : activity.old_value,
cycle_name: !activity.new_value || activity.new_value === "" ? activity.old_value : activity.new_value,
})
)
}
@ -355,7 +355,7 @@ const activityDetails: {
JSON.stringify({
module_id: activity.new_identifier ?? activity.old_identifier,
project_id: activity.project,
module_name: activity.verb === "created" ? activity.new_value : activity.old_value,
module_name: !activity.new_value || activity.new_value === "" ? activity.old_value : activity.new_value,
})
)
}

View File

@ -232,6 +232,7 @@ export const IssuePropertiesDetail: React.FC<Props> = (props) => {
JSON.stringify({
issue_id: relation.issue_detail?.id,
project_id: relation.issue_detail?.project_detail.id,
issue_identifier: `${relation.issue_detail?.project_detail.identifier}-${relation.issue_detail?.sequence_id}`
})
)
}
@ -294,6 +295,7 @@ export const IssuePropertiesDetail: React.FC<Props> = (props) => {
JSON.stringify({
issue_id: relation.issue_detail?.id,
project_id: relation.issue_detail?.project_detail.id,
issue_identifier: `${relation.issue_detail?.project_detail.identifier}-${relation.issue_detail?.sequence_id}`
})
)
}
@ -356,6 +358,7 @@ export const IssuePropertiesDetail: React.FC<Props> = (props) => {
JSON.stringify({
issue_id: relation.issue_detail?.id,
project_id: relation.issue_detail?.project_detail.id,
issue_identifier: `${relation.issue_detail?.project_detail.identifier}-${relation.issue_detail?.sequence_id}`
})
)
}
@ -418,6 +421,7 @@ export const IssuePropertiesDetail: React.FC<Props> = (props) => {
JSON.stringify({
issue_id: relation.issue_detail?.id,
project_id: relation.issue_detail?.project_detail.id,
issue_identifier: `${relation.issue_detail?.project_detail.identifier}-${relation.issue_detail?.sequence_id}`
})
)
}

View File

@ -115,8 +115,9 @@ export const IssueWebViewForm: React.FC<Props> = (props) => {
<Controller
name="description_html"
control={control}
render={({ field: { value, onChange } }) => (
<RichTextEditor
render={({ field: { value, onChange } }) => {
if(value==null)return <></>;
return <RichTextEditor
uploadFile={fileService.getUploadFileFunction(workspaceSlug as string)}
deleteFile={fileService.deleteImage}
value={
@ -136,7 +137,7 @@ export const IssueWebViewForm: React.FC<Props> = (props) => {
handleSubmit(handleDescriptionFormSubmit)().finally(() => setIsSubmitting("submitted"));
}}
/>
)}
}}
/>
<div
className={`absolute right-5 bottom-5 text-xs text-custom-text-200 border border-custom-border-400 rounded-xl w-[6.5rem] py-1 z-10 flex items-center justify-center ${

View File

@ -97,7 +97,11 @@ export const CycleSelect: React.FC<Props> = (props) => {
return (
<>
<WebViewModal isOpen={isBottomSheetOpen} onClose={() => setIsBottomSheetOpen(false)} modalTitle="Select Module">
<WebViewModal
isOpen={isBottomSheetOpen}
onClose={() => setIsBottomSheetOpen(false)}
modalTitle="Select Cycle"
>
<WebViewModal.Options
options={[
...(incompleteCycles ?? []).map((cycle) => ({

View File

@ -121,11 +121,11 @@ export const SubIssueList: React.FC<Props> = (props) => {
{subIssuesResponse?.sub_issues?.map((subIssue) => (
<div key={subIssue.id} className="flex items-center justify-between gap-2 py-2">
<div className="flex items-center">
<div className="grid grid-flow-col ">
<p className="mr-3 text-sm text-custom-text-300">
{subIssue.project_detail.identifier}-{subIssue.sequence_id}
</p>
<p className="text-sm font-normal">{subIssue.name}</p>
<p className="text-sm font-normal truncate ">{subIssue.name}</p>
</div>
<button
type="button"

View File

@ -54,26 +54,25 @@ const Editor: NextPage = () => {
<Controller
name="data_html"
control={control}
render={({ field: { value, onChange } }) => (
<RichTextEditor
uploadFile={fileService.getUploadFileFunction(workspaceSlug as string)}
deleteFile={fileService.deleteImage}
borderOnFocus={false}
value={
!value || value === "" || (typeof value === "object" && Object.keys(value).length === 0)
? watch("data_html")
: value
}
noBorder={true}
customClassName="h-full shadow-sm overflow-auto"
editorContentCustomClassNames="pb-9"
onChange={(description: Object, description_html: string) => {
onChange(description_html);
setValue("data_html", description_html);
setValue("data", JSON.stringify(description));
}}
/>
)}
render={({ field: { value, onChange } }) => {
if (value == null) return <></>;
return (
<RichTextEditor
uploadFile={fileService.getUploadFileFunction(workspaceSlug as string)}
deleteFile={fileService.deleteImage}
borderOnFocus={false}
value={!value || value === "" ? "<p></p>" : value}
noBorder={true}
customClassName="h-full shadow-sm overflow-auto"
editorContentCustomClassNames="pb-9"
onChange={(description: Object, description_html: string) => {
onChange(description_html);
setValue("data_html", description_html);
setValue("data", JSON.stringify(description));
}}
/>
);
}}
/>
{isEditable && (
<Button