Skip to content
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

UBER-496: Fix few issues #3439

Merged
merged 1 commit into from
Jun 16, 2023
Merged
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
5 changes: 4 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@
"TRANSACTOR_URL": "ws:/localhost:3333",
"ACCOUNT_PORT": "3000",
"FRONT_URL": "http://localhost:8080",
"SES_URL": "http://localhost:8091"
"SES_URL": "http://localhost:8091",
"MINIO_ACCESS_KEY": "minioadmin",
"MINIO_SECRET_KEY": "minioadmin",
"MINIO_ENDPOINT": "localhost"
},
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
Expand Down
3 changes: 3 additions & 0 deletions models/contact/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,9 @@ export function createModel (builder: Builder): void {
builder.mixin(core.class.Account, core.class.Class, view.mixin.ObjectPresenter, {
presenter: contact.component.EmployeeAccountPresenter
})
builder.mixin(core.class.Account, core.class.Class, view.mixin.AttributePresenter, {
presenter: contact.component.EmployeeAccountRefPresenter
})

builder.mixin(contact.class.Organization, core.class.Class, view.mixin.ObjectPresenter, {
presenter: contact.component.OrganizationPresenter
Expand Down
1 change: 1 addition & 0 deletions models/contact/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default mergeIds(contactId, contact, {
Contacts: '' as AnyComponent,
ContactsTabs: '' as AnyComponent,
EmployeeAccountPresenter: '' as AnyComponent,
EmployeeAccountRefPresenter: '' as AnyComponent,
OrganizationEditor: '' as AnyComponent,
EmployeePresenter: '' as AnyComponent,
EmployeeRefPresenter: '' as AnyComponent,
Expand Down
2 changes: 1 addition & 1 deletion models/recruit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ export function createModel (builder: Builder): void {

const applicantViewOptions = (colors: boolean): ViewOptionsModel => {
const model: ViewOptionsModel = {
groupBy: ['state', 'assignee', 'space'],
groupBy: ['state', 'assignee', 'space', 'createdBy', 'modifiedBy'],
orderBy: [
['state', SortingOrder.Ascending],
['modifiedOn', SortingOrder.Descending],
Expand Down
90 changes: 78 additions & 12 deletions models/tracker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import {
TimeSpendReport,
trackerId
} from '@hcengineering/tracker'
import { KeyBinding, ViewOptionsModel } from '@hcengineering/view'
import { KeyBinding, ViewAction, ViewOptionsModel } from '@hcengineering/view'
import tracker from './plugin'

import { generateClassNotificationTypes } from '@hcengineering/model-notification'
Expand Down Expand Up @@ -385,7 +385,7 @@ export function createModel (builder: Builder): void {
)

const issuesOptions = (kanban: boolean): ViewOptionsModel => ({
groupBy: ['status', 'assignee', 'priority', 'component', 'milestone'],
groupBy: ['status', 'assignee', 'priority', 'component', 'milestone', 'createdBy', 'modifiedBy'],
orderBy: [
['status', SortingOrder.Ascending],
['priority', SortingOrder.Descending],
Expand Down Expand Up @@ -554,7 +554,7 @@ export function createModel (builder: Builder): void {
)

const subIssuesOptions: ViewOptionsModel = {
groupBy: ['status', 'assignee', 'priority', 'milestone'],
groupBy: ['status', 'assignee', 'priority', 'milestone', 'createdBy', 'modifiedBy'],
orderBy: [
['rank', SortingOrder.Ascending],
['status', SortingOrder.Ascending],
Expand Down Expand Up @@ -667,7 +667,7 @@ export function createModel (builder: Builder): void {
attachTo: tracker.class.IssueTemplate,
descriptor: view.viewlet.List,
viewOptions: {
groupBy: ['assignee', 'priority', 'component', 'milestone'],
groupBy: ['assignee', 'priority', 'component', 'milestone', 'createdBy', 'modifiedBy'],
orderBy: [
['priority', SortingOrder.Ascending],
['modifiedOn', SortingOrder.Descending],
Expand Down Expand Up @@ -1060,6 +1060,20 @@ export function createModel (builder: Builder): void {
['backlog', tracker.string.Backlog, {}]
]
}
},
{
id: 'all-projects',
component: workbench.component.SpecialView,
icon: view.icon.Archive,
label: tracker.string.AllProjects,
position: 'bottom',
visibleIf: workbench.function.IsOwner,
spaceClass: tracker.class.Project,
componentProps: {
_class: tracker.class.Project,
label: tracker.string.AllIssues,
icon: tracker.icon.Issues
}
}
],
spaces: [
Expand All @@ -1068,6 +1082,7 @@ export function createModel (builder: Builder): void {
spaceClass: tracker.class.Project,
addSpaceLabel: tracker.string.CreateProject,
createComponent: tracker.component.CreateProject,
visibleIf: tracker.function.IsProjectJoined,
icon: tracker.icon.Home,
specials: [
{
Expand Down Expand Up @@ -1162,9 +1177,7 @@ export function createModel (builder: Builder): void {
input: 'focus',
category: tracker.category.Tracker,
target: tracker.class.Project,
query: {
archived: false
},
query: {},
context: {
mode: ['context', 'browser'],
group: 'edit'
Expand All @@ -1182,9 +1195,7 @@ export function createModel (builder: Builder): void {
input: 'focus',
category: tracker.category.Tracker,
target: tracker.class.Project,
query: {
archived: false
},
query: {},
context: {
mode: ['context', 'browser'],
group: 'edit'
Expand Down Expand Up @@ -1213,6 +1224,28 @@ export function createModel (builder: Builder): void {
},
tracker.action.DeleteProject
)
createAction(builder, {
label: tracker.string.Unarchive,
icon: view.icon.Archive,
action: view.actionImpl.UpdateDocument as ViewAction,
actionProps: {
key: 'archived',
ask: true,
value: false,
label: tracker.string.Unarchive,
message: tracker.string.UnarchiveConfirm
},
input: 'any',
category: tracker.category.Tracker,
query: {
archived: true
},
context: {
mode: ['context', 'browser'],
group: 'tools'
},
target: tracker.class.Project
})

createAction(
builder,
Expand Down Expand Up @@ -1391,6 +1424,10 @@ export function createModel (builder: Builder): void {
override: [view.action.Open]
})

builder.mixin(tracker.class.Project, core.class.Class, view.mixin.IgnoreActions, {
actions: [view.action.Open]
})

builder.mixin(tracker.class.Issue, core.class.Class, view.mixin.ClassFilters, {
filters: [
'status',
Expand Down Expand Up @@ -1852,7 +1889,7 @@ export function createModel (builder: Builder): void {
)

const milestoneOptions: ViewOptionsModel = {
groupBy: ['status'],
groupBy: ['status', 'createdBy', 'modifiedBy'],
orderBy: [
['modifiedOn', SortingOrder.Descending],
['targetDate', SortingOrder.Descending],
Expand Down Expand Up @@ -1934,7 +1971,7 @@ export function createModel (builder: Builder): void {
)

const componentListViewOptions: ViewOptionsModel = {
groupBy: ['lead'],
groupBy: ['lead', 'createdBy', 'modifiedBy'],
orderBy: [
['modifiedOn', SortingOrder.Descending],
['createdOn', SortingOrder.Descending]
Expand Down Expand Up @@ -1973,4 +2010,33 @@ export function createModel (builder: Builder): void {
},
tracker.viewlet.ComponentList
)

builder.createDoc(
view.class.Viewlet,
core.space.Model,
{
attachTo: tracker.class.Project,
descriptor: view.viewlet.List,
viewOptions: {
groupBy: ['createdBy'],
orderBy: [
['modifiedOn', SortingOrder.Descending],
['createdOn', SortingOrder.Descending]
],
other: [showColorsViewOption]
},
configOptions: {
strict: true,
hiddenKeys: ['label', 'description']
},
config: [
{
key: '',
props: { kind: 'list' }
},
{ key: '', displayProps: { grow: true } }
]
},
tracker.viewlet.ProjectList
)
}
8 changes: 6 additions & 2 deletions models/tracker/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export default mergeIds(trackerId, tracker, {
CreatedDate: '' as IntlString,
ChangeStatus: '' as IntlString,
ConfigLabel: '' as IntlString,
ConfigDescription: '' as IntlString
ConfigDescription: '' as IntlString,
Unarchive: '' as IntlString,
UnarchiveConfirm: '' as IntlString,
AllProjects: '' as IntlString
},
activity: {
TxIssueCreated: '' as AnyComponent,
Expand All @@ -62,7 +65,8 @@ export default mergeIds(trackerId, tracker, {
IssueTemplateList: '' as Ref<Viewlet>,
IssueKanban: '' as Ref<Viewlet>,
MilestoneList: '' as Ref<Viewlet>,
ComponentList: '' as Ref<Viewlet>
ComponentList: '' as Ref<Viewlet>,
ProjectList: '' as Ref<Viewlet>
},
ids: {
TxIssueCreated: '' as Ref<TxViewlet>,
Expand Down
7 changes: 4 additions & 3 deletions models/workbench/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.
//

import { Space } from '@hcengineering/core'
import { IntlString, mergeIds, Resource } from '@hcengineering/platform'
import { Doc, Space } from '@hcengineering/core'
import { IntlString, Resource, mergeIds } from '@hcengineering/platform'
import { AnyComponent } from '@hcengineering/ui'
import { workbenchId } from '@hcengineering/workbench'
import workbench from '@hcengineering/workbench-resources/src/plugin'
Expand All @@ -32,6 +32,7 @@ export default mergeIds(workbenchId, workbench, {
HiddenApplication: '' as IntlString
},
function: {
HasArchiveSpaces: '' as Resource<(spaces: Space[]) => Promise<boolean>>
HasArchiveSpaces: '' as Resource<(spaces: Space[]) => Promise<boolean>>,
IsOwner: '' as Resource<(docs: Doc[]) => Promise<boolean>>
}
})
12 changes: 12 additions & 0 deletions packages/platform-rig/profiles/assets/config/heft.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
"heftEvent": "clean",
"actionId": "defaultClean",
"globsToDelete": ["dist", "lib", "temp"]
},
{
"actionKind": "copyFiles",
"heftEvent": "pre-compile",
"actionId": "copy-lang",
"copyOperations": [
{
"sourceFolder": "src",
"destinationFolders": ["lib"],
"includeGlobs": ["lang"]
}
]
}
],
"heftPlugins": [
Expand Down
12 changes: 12 additions & 0 deletions packages/platform-rig/profiles/default/config/heft.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
"heftEvent": "clean",
"actionId": "defaultClean",
"globsToDelete": ["dist", "lib", "temp"]
},
{
"actionKind": "copyFiles",
"heftEvent": "pre-compile",
"actionId": "copy-lang",
"copyOperations": [
{
"sourceFolder": "src",
"destinationFolders": ["lib"],
"includeGlobs": ["lang"]
}
]
}
],
"heftPlugins": [
Expand Down
1 change: 1 addition & 0 deletions packages/platform/src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"WorkspaceNotFound": "Workspace not found",
"InvalidPassword": "Invalid password",
"AccountAlreadyExists": "Account already exists",
"WorkspaceRateLimit": "Server is busy, Please wait a bit and try again",
"AccountAlreadyConfirmed": "Account already confirmed",
"AccountWasMerged": "Account was merged",
"WorkspaceAlreadyExists": "Workspace already exists",
Expand Down
1 change: 1 addition & 0 deletions packages/platform/src/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"WorkspaceNotFound": "Рабочее пространство не найдено",
"InvalidPassword": "Неверный пароль",
"AccountAlreadyExists": "Аккаунт уже существует",
"WorkspaceRateLimit": "Сервер перегружен, Пожалуйста подождите",
"AccountAlreadyConfirmed": "Аккаунт уже подтвержден",
"AccountWasMerged": "Аккаунт был объединен",
"WorkspaceAlreadyExists": "Рабочее пространство уже существует",
Expand Down
1 change: 1 addition & 0 deletions packages/platform/src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export default plugin(platformId, {
AccountAlreadyConfirmed: '' as StatusCode<{ account: string }>,
AccountWasMerged: '' as StatusCode<{ account: string }>,
WorkspaceAlreadyExists: '' as StatusCode<{ workspace: string }>,
WorkspaceRateLimit: '' as StatusCode<{ workspace: string }>,
ProductIdMismatch: '' as StatusCode<{ productId: string }>
},
metadata: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{#if value}
<!-- svelte-ignore a11y-click-events-have-key-events -->
{#if employee}
<EmployeePresenter value={employee} {disabled} {inline} {accent} {avatarSize} />
<EmployeePresenter value={employee} {disabled} {inline} {accent} {avatarSize} on:accent-color />
{:else}
<div class="flex-row-center">
<Avatar size={avatarSize} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
</script>

{#if account}
<EmployeeAccountPresenter value={account} {disabled} {inline} {avatarSize} />
<EmployeeAccountPresenter value={account} {disabled} {inline} {avatarSize} on:accent-color />
{/if}
7 changes: 5 additions & 2 deletions plugins/contact-resources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import EmployeePresenter from './components/EmployeePresenter.svelte'
import EmployeeRefPresenter from './components/EmployeeRefPresenter.svelte'
import MemberPresenter from './components/MemberPresenter.svelte'
import Members from './components/Members.svelte'
import MembersBox from './components/MembersBox.svelte'
import MembersPresenter from './components/MembersPresenter.svelte'
import MergeEmployee from './components/MergeEmployee.svelte'
import OrganizationEditor from './components/OrganizationEditor.svelte'
Expand Down Expand Up @@ -141,7 +142,8 @@ export {
UserInfo,
IconMembers,
SelectAvatars,
UserBoxItems
UserBoxItems,
MembersBox
}

const toObjectSearchResult = (e: WithLookup<Contact>): ObjectSearchResult => ({
Expand Down Expand Up @@ -311,7 +313,8 @@ export default async (): Promise<Resources> => ({
EmployeeFilter,
EmployeeFilterValuePresenter,
EmployeeAccountFilterValuePresenter,
DeleteConfirmationPopup
DeleteConfirmationPopup,
EmployeeAccountRefPresenter
},
completion: {
EmployeeQuery: async (
Expand Down
3 changes: 2 additions & 1 deletion plugins/lead-resources/src/components/EditFunnel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import type { Ref } from '@hcengineering/core'
import core from '@hcengineering/core'
import { Panel } from '@hcengineering/panel'
import { createQuery, getClient, MembersBox } from '@hcengineering/presentation'
import { createQuery, getClient } from '@hcengineering/presentation'
import { MembersBox } from '@hcengineering/contact-resources'
import type { Funnel } from '@hcengineering/lead'
import { FullDescriptionBox } from '@hcengineering/text-editor'
import { EditBox, Grid } from '@hcengineering/ui'
Expand Down
Loading