Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into staging
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <[email protected]>
  • Loading branch information
haiodo committed Sep 24, 2024
2 parents 143de3c + 822731c commit f72dd3b
Show file tree
Hide file tree
Showing 28 changed files with 609 additions and 506 deletions.
72 changes: 37 additions & 35 deletions dev/tool/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1140,49 +1140,51 @@ export function devTool (
.option('-bl, --blobLimit <blobLimit>', 'A blob size limit in megabytes (default 50mb)', '50')
.option('-c, --concurrency <concurrency>', 'Number of files being processed concurrently', '10')
.option('--disabled', 'Include disabled workspaces', false)
.action(async (cmd: { workspace: string, move: string, blobLimit: string, concurrency: string, disabled: boolean }) => {
const params = {
blobSizeLimitMb: parseInt(cmd.blobLimit),
concurrency: parseInt(cmd.concurrency),
move: cmd.move === 'true'
}
.action(
async (cmd: { workspace: string, move: string, blobLimit: string, concurrency: string, disabled: boolean }) => {
const params = {
blobSizeLimitMb: parseInt(cmd.blobLimit),
concurrency: parseInt(cmd.concurrency),
move: cmd.move === 'true'
}

const { mongodbUri } = prepareTools()
await withDatabase(mongodbUri, async (db) => {
await withStorage(mongodbUri, async (adapter) => {
try {
const exAdapter = adapter as StorageAdapterEx
if (exAdapter.adapters === undefined || exAdapter.adapters.size < 2) {
throw new Error('bad storage config, at least two storage providers are required')
}
const { mongodbUri } = prepareTools()
await withDatabase(mongodbUri, async (db) => {
await withStorage(mongodbUri, async (adapter) => {
try {
const exAdapter = adapter as StorageAdapterEx
if (exAdapter.adapters === undefined || exAdapter.adapters.size < 2) {
throw new Error('bad storage config, at least two storage providers are required')
}

console.log('moving files to storage provider', exAdapter.defaultAdapter)
console.log('moving files to storage provider', exAdapter.defaultAdapter)

let index = 1
const workspaces = await listWorkspacesPure(db)
workspaces.sort((a, b) => b.lastVisit - a.lastVisit)
let index = 1
const workspaces = await listWorkspacesPure(db)
workspaces.sort((a, b) => b.lastVisit - a.lastVisit)

for (const workspace of workspaces) {
if (cmd.workspace !== '' && workspace.workspace !== cmd.workspace) {
continue
}
if (workspace.disabled === true && !cmd.disabled) {
console.log('ignore disabled workspace', workspace.workspace)
continue
}
for (const workspace of workspaces) {
if (cmd.workspace !== '' && workspace.workspace !== cmd.workspace) {
continue
}
if (workspace.disabled === true && !cmd.disabled) {
console.log('ignore disabled workspace', workspace.workspace)
continue
}

console.log('start', workspace.workspace, index, '/', workspaces.length)
await moveFiles(toolCtx, getWorkspaceId(workspace.workspace), exAdapter, params)
console.log('done', workspace.workspace)
console.log('start', workspace.workspace, index, '/', workspaces.length)
await moveFiles(toolCtx, getWorkspaceId(workspace.workspace), exAdapter, params)
console.log('done', workspace.workspace)

index += 1
index += 1
}
} catch (err: any) {
console.error(err)
}
} catch (err: any) {
console.error(err)
}
})
})
})
})
}
)

program
.command('sync-files')
Expand Down
4 changes: 4 additions & 0 deletions models/notification/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ export class TBrowserNotification extends TDoc implements BrowserNotification {
onClickLocation?: Location | undefined
user!: Ref<Account>
status!: NotificationStatus
messageId?: Ref<ActivityMessage>
messageClass?: Ref<Class<ActivityMessage>>
objectId!: Ref<Doc>
objectClass!: Ref<Class<Doc>>
}

@Model(notification.class.PushSubscription, core.class.Doc, DOMAIN_USER_NOTIFY)
Expand Down
1 change: 0 additions & 1 deletion models/time/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default mergeIds(timeId, time, {
EditToDo: '' as IntlString,
GotoTimePlaning: '' as IntlString,
GotoTimeTeamPlaning: '' as IntlString,
NewToDo: '' as IntlString,
Priority: '' as IntlString,
MarkedAsDone: '' as IntlString
},
Expand Down
174 changes: 174 additions & 0 deletions packages/theme/styles/button.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,177 @@
.hulyButton {
display: inline-flex;
justify-content: center;
align-items: center;
flex-shrink: 0;
gap: var(--spacing-1);
border: 1px solid transparent;

&:not(:disabled, .disabled, .loading) { cursor: pointer; }
&.inheritFont { font: inherit; }

.icon {
display: flex;
align-items: center;
justify-content: center;
width: var(--spacing-2_5);
height: var(--spacing-2_5);
}
span { white-space: nowrap; }

&:focus {
outline: 2px solid var(--global-focus-BorderColor);
outline-offset: 2px;
}
&.type-button-icon { padding: 0; }
&.large {
height: var(--global-large-Size);
border-radius: var(--medium-BorderRadius);

&.round { border-radius: var(--large-BorderRadius); }

&.type-button:not(.iconOnly) { padding: 0 var(--spacing-2); }
&.iconOnly,
&.type-button-icon { width: var(--global-large-Size); }
}
&.medium {
height: var(--global-medium-Size);
border-radius: var(--medium-BorderRadius);

&.round { border-radius: var(--large-BorderRadius); }
&.type-button:not(.iconOnly) { padding: 0 var(--spacing-2); }
&.iconOnly,
&.type-button-icon { width: var(--global-medium-Size); }
}
&.small {
height: var(--global-small-Size);
gap: var(--spacing-0_5);
border-radius: var(--small-BorderRadius);

&.round { border-radius: var(--large-BorderRadius); }
&.type-button:not(.iconOnly) { padding: 0 var(--spacing-1); }
&.iconOnly,
&.type-button-icon { width: var(--global-small-Size); }
}
&.extra-small {
height: var(--global-extra-small-Size);
border-radius: var(--extra-small-BorderRadius);

&.round { border-radius: var(--large-BorderRadius); }
&.type-button:not(.iconOnly) { padding: 0 var(--spacing-1); }
&.iconOnly,
&.type-button-icon { width: var(--global-extra-small-Size); }
}
&.min {
height: var(--global-min-Size);
border: 0;
border-radius: var(--min-BorderRadius);
}
&.type-button-icon .icon,
&.menu .icon {
width: var(--spacing-2);
height: var(--spacing-2);
}

&:disabled:not(.loading),
&.disabled:not(.loading) {
border-color: transparent;
cursor: not-allowed;

.icon { color: var(--button-disabled-IconColor); }
span { color: var(--button-disabled-LabelColor); }
}

&.primary {
border-color: var(--button-primary-BorderColor);
background-color: var(--button-primary-BackgroundColor);

.icon { color: var(--button-accent-IconColor); }
span { color: var(--button-accent-LabelColor); }

&:not(.disabled, :disabled):hover { background-color: var(--button-primary-hover-BackgroundColor); }
&:not(.disabled, :disabled):active,
&.pressed:not(.disabled, :disabled) { background-color: var(--button-primary-active-BackgroundColor); }
&.menu:not(.disabled, :disabled):active,
&.pressed:not(.disabled, :disabled) { border-color: var(--button-menu-active-BorderColor); }
&:disabled:not(.loading),
&.disabled:not(.loading) { background-color: var(--button-disabled-BackgroundColor); }
&.loading {
background-color: var(--button-primary-active-BackgroundColor);

span { color: var(--button-primary-loading-LabelColor); }
}
}

&.secondary {
border-color: var(--button-secondary-BorderColor);
background-color: var(--button-secondary-BackgroundColor);

.icon { color: var(--button-subtle-IconColor); }
span { color: var(--button-subtle-LabelColor); }

&:not(.disabled, :disabled):hover { background-color: var(--button-secondary-hover-BackgroundColor); }
&:not(.disabled, :disabled):active,
&.pressed:not(.disabled, :disabled) { background-color: var(--button-secondary-active-BackgroundColor); }
&.menu:not(.disabled, :disabled):active,
&.pressed:not(.disabled, :disabled) { border-color: var(--button-menu-active-BorderColor); }
&:disabled:not(.loading),
&.disabled:not(.loading) { background-color: var(--button-disabled-BackgroundColor); }
&.loading {
background-color: var(--button-secondary-active-BackgroundColor);

span { color: var(--button-disabled-LabelColor); }
}
}

&.tertiary {
border-color: transparent;
background-color: transparent;

&:not(.inheritColor) .icon { color: var(--button-subtle-IconColor); }
&.inheritColor {
color: inherit;

.icon { color: currentColor; }
}
span { color: var(--button-subtle-LabelColor); }

&:not(.disabled, :disabled):hover { background-color: var(--button-tertiary-hover-BackgroundColor); }
&:not(.disabled, :disabled):active,
&.pressed:not(.disabled, :disabled) { background-color: var(--button-tertiary-active-BackgroundColor); }
&.menu:not(.disabled, :disabled):active,
&.pressed:not(.disabled, :disabled) { border-color: var(--button-menu-active-BorderColor); }
&.loading {
background-color: var(--button-tertiary-active-BackgroundColor);

span { color: var(--button-disabled-LabelColor); }
}
}

&.negative {
border-color: var(--button-negative-BorderColor);
background-color: var(--button-negative-BackgroundColor);

.icon { color: var(--button-accent-IconColor); }
span { color: var(--button-accent-LabelColor); }

&:not(.disabled, :disabled):hover { background-color: var(--button-negative-hover-BackgroundColor); }
&:not(.disabled, :disabled):active,
&.pressed:not(.disabled, :disabled) { background-color: var(--button-negative-active-BackgroundColor); }
&.menu:not(.disabled, :disabled):active,
&.pressed:not(.disabled, :disabled) { border-color: var(--button-menu-active-BorderColor); }
&:disabled:not(.loading),
&.disabled:not(.loading) { background-color: var(--button-disabled-BackgroundColor); }
&.loading {
background-color: var(--button-negative-active-BackgroundColor);

span { color: var(--button-negative-loading-LabelColor); }
}
}

& > * { pointer-events: none; }
}

// Old style Button
.antiButton {
display: flex;
align-items: center;
Expand Down
Loading

0 comments on commit f72dd3b

Please sign in to comment.