Skip to content

[Feat]: Add Create/Update Time column on the Orgs Page #1806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/packages/lowcoder/src/api/userApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export interface GetMyOrgsResponse extends ApiResponse {
data: Array<{
orgId: string;
orgName: string;
createdAt?: number;
updatedAt?: number;
}>;
pageNum: number;
pageSize: number;
Expand Down
2 changes: 2 additions & 0 deletions client/packages/lowcoder/src/constants/orgConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export type Org = {
createdBy: string;
commonSettings: CommonSettingResponseData;
createTime?: string;
createdAt?: number;
updatedAt?: number;
};

export type OrgAndRole = {
Expand Down
4 changes: 3 additions & 1 deletion client/packages/lowcoder/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3062,7 +3062,9 @@ export const en = {
"inviteSuccessMessage": "Join the Workspace Successfully",
"inviteFailMessage": "Failed to Join Workspace",
"uploadErrorMessage": "Upload Error",
"orgName": "Workspace Name"
"orgName": "Workspace Name",
"createdAt": "Created",
"updatedAt": "Updated"
},
"freeLimit": "Free Trial",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ import { isSaasMode } from "util/envUtils";
import { selectSystemConfig } from "redux/selectors/configSelectors";
import { default as Form } from "antd/es/form";
import { default as Input } from "antd/es/input";
import { Pagination, Spin } from "antd";
import { Pagination, Spin, Tooltip } from "antd";
import { getUser } from "redux/selectors/usersSelectors";
import { getOrgCreateStatus } from "redux/selectors/orgSelectors";
import { useWorkspaceManager } from "util/useWorkspaceManager";
import { Org } from "constants/orgConstants";
import { useState } from "react";
import { SwapOutlined } from "@ant-design/icons";
import dayjs from "dayjs";

const OrgName = styled.div`
display: flex;
Expand Down Expand Up @@ -170,6 +171,8 @@ type DataItemInfo = {
del: boolean;
orgName: string;
logoUrl: string;
createdAt?: number;
updatedAt?: number;
};

function OrganizationSetting() {
Expand All @@ -194,6 +197,7 @@ function OrganizationSetting() {
});



// Filter to only show orgs where user has admin permissions
const adminOrgs = displayWorkspaces.filter((org: Org) => {
const role = user.orgRoleMap.get(org.id);
Expand All @@ -205,10 +209,14 @@ function OrganizationSetting() {
del: adminOrgs.length > 1,
orgName: org.name,
logoUrl: org.logoUrl || "",
createdAt: org.createdAt,
updatedAt: org.updatedAt,
}));



return (
<Level1SettingPageContentWithList>
<Level1SettingPageContentWithList style={{ minWidth: "1000px" }}>
<Level1SettingPageTitleWithBtn>
{trans("settings.organization")}
{isSaasMode(sysConfig) && (
Expand Down Expand Up @@ -249,7 +257,7 @@ function OrganizationSetting() {
onClick: () => history.push(buildOrgId((record as DataItemInfo).id)),
})}
columns={[
{
{
title: trans("orgSettings.orgName"),
dataIndex: "orgName",
ellipsis: true,
Expand All @@ -264,6 +272,34 @@ function OrganizationSetting() {
);
},
},
{
title: trans("orgSettings.createdAt"),
dataIndex: "createdAt",
width: "150px",
render: (createdAt: number) => {
if (!createdAt) return "-";
return (
<Tooltip title={dayjs.unix(createdAt).format("YYYY/MM/DD HH:mm:ss")}
placement="bottom">
<span style={{ color: "#8b8fa3" }}>{dayjs.unix(createdAt).fromNow()}</span>
</Tooltip>
);
},
},
{
title: trans("orgSettings.updatedAt"),
dataIndex: "updatedAt",
width: "150px",
render: (updatedAt: number) => {
if (!updatedAt) return "-";
return (
<Tooltip title={dayjs.unix(updatedAt).format("YYYY/MM/DD HH:mm:ss")}
placement="bottom">
<span style={{ color: "#8b8fa3" }}>{dayjs.unix(updatedAt).fromNow()}</span>
</Tooltip>
);
},
},
{ title: " ", dataIndex: "operation", width: "208px" },
]}
dataSource={dataSource.map((item, i) => ({
Expand Down
2 changes: 2 additions & 0 deletions client/packages/lowcoder/src/redux/sagas/orgSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ export function* fetchWorkspacesSaga(action: ReduxAction<{page: number, pageSize
const transformedItems = apiData.data.map(item => ({
id: item.orgId,
name: item.orgName,
createdAt: item.createdAt,
updatedAt: item.updatedAt,
}));

yield put({
Expand Down
2 changes: 2 additions & 0 deletions client/packages/lowcoder/src/util/useWorkspaceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ export function useWorkspaceManager({
const transformedItems = apiData.data.map(item => ({
id: item.orgId,
name: item.orgName,
createdAt: item.createdAt,
updatedAt: item.updatedAt,
}));

dispatch({
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy