Fix Activity layout (#351)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov 2021-11-23 21:46:06 +03:00 committed by GitHub
parent 24aa40317d
commit 741ea0eafd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 58 deletions

View File

@ -159,6 +159,14 @@ table {
&:hover .icon { color: var(--theme-caption-color); } &:hover .icon { color: var(--theme-caption-color); }
} }
/* Tables */
// .activity-table > tr:last-child > .no-icon-cell {
// min-height: auto;
// height: auto;
// &::after { content: none; }
// }
/* Margins & Paddings */
.step-lr75 + .step-lr75 { margin-left: .75rem; } .step-lr75 + .step-lr75 { margin-left: .75rem; }
.step-tb75 + .step-tb75 { margin-top: .75rem; } .step-tb75 + .step-tb75 { margin-top: .75rem; }

View File

@ -13,6 +13,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import activity, { TxViewlet } from '@anticrm/activity' import activity, { TxViewlet } from '@anticrm/activity'
import chunter from '@anticrm/chunter' import chunter from '@anticrm/chunter'
@ -182,16 +183,5 @@
padding: 1.5rem 2.5rem; padding: 1.5rem 2.5rem;
height: max-content; height: max-content;
} }
.activity {
background-color: var(--theme-bg-accent-color);
&.header {
border-bottom: none;
}
&.content {
flex-grow: 1;
padding-bottom: 0;
background-color: var(--theme-bg-accent-color);
}
}
} }
</style> </style>

View File

@ -13,6 +13,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import type { TxViewlet } from '@anticrm/activity' import type { TxViewlet } from '@anticrm/activity'
import contact, { EmployeeAccount, formatName } from '@anticrm/contact' import contact, { EmployeeAccount, formatName } from '@anticrm/contact'
@ -91,26 +92,26 @@
</div> </div>
</div> </div>
<div class="flex-grow label"> <div class="flex-grow label">
<b> <div class="bold">
{#if employee} {#if employee}
{formatName(employee.name)} {formatName(employee.name)}
{:else} {:else}
No employee No employee
{/if} {/if}
</b> </div>
{#if viewlet} {#if viewlet}
<Label label={viewlet.label} /> <div><Label label={viewlet.label} /></div>
{/if} {/if}
{#if viewlet === undefined && model.length > 0 && utx} {#if viewlet === undefined && model.length > 0 && utx}
{#each model as m} {#each model as m}
changed {m.label} to <span>changed {m.label} to</span>
<strong><svelte:component this={m.presenter} value={getValue(utx, m.key)} /></strong> <div class="strong"><svelte:component this={m.presenter} value={getValue(utx, m.key)} /></div>
{/each} {/each}
{:else if viewlet && viewlet.display === 'inline' && viewlet.component} {:else if viewlet && viewlet.display === 'inline' && viewlet.component}
<Component is={viewlet.component} props={{ tx: displayTx }} /> <div><Component is={viewlet.component} props={{ tx: displayTx }} /></div>
{/if} {/if}
</div> </div>
<div class="content-trans-color"><TimeSince value={tx.modifiedOn} /></div> <div class="time"><TimeSince value={tx.modifiedOn} /></div>
</div> </div>
{#if viewlet && viewlet.component && viewlet.display !== 'inline'} {#if viewlet && viewlet.component && viewlet.display !== 'inline'}
<div class="content" class:emphasize={viewlet.display === 'emphasized'}> <div class="content" class:emphasize={viewlet.display === 'emphasized'}>
@ -123,29 +124,29 @@
<style lang="scss"> <style lang="scss">
.msgactivity-container { .msgactivity-container {
position: relative; position: relative;
&::after, &::before {
position: absolute;
left: 1.125rem;
width: 1px;
background-color: var(--theme-card-divider);
}
&::before {
top: -1.5rem;
height: 1.5rem;
}
&::after { &::after {
content: ''; content: '';
position: absolute;
top: 2.25rem; top: 2.25rem;
left: 1.125rem;
bottom: 0; bottom: 0;
width: 1px;
background-color: var(--theme-card-divider);
} }
} }
:global(.msgactivity-container + .msgactivity-container::before) { :global(.msgactivity-container + .msgactivity-container::before) { content: ''; }
content: ''; // :global(.msgactivity-container > *:last-child::after) { content: none; }
position: absolute;
top: -1.5rem;
left: 1.125rem;
height: 1.5rem;
width: 1px;
background-color: var(--theme-card-divider);
}
.icon { .icon {
flex-shrink: 0; flex-shrink: 0;
align-self: flex-start; align-self: flex-start;
margin-right: 1rem;
width: 2.25rem; width: 2.25rem;
height: 2.25rem; height: 2.25rem;
color: var(--theme-caption-color); color: var(--theme-caption-color);
@ -162,14 +163,23 @@
border-radius: 0.75rem; border-radius: 0.75rem;
padding: 1rem; padding: 1rem;
} }
.time {
margin-left: 1rem;
color: var(--theme-content-trans-color);
}
.label { .label {
margin: 0 1rem; display: flex;
align-items: center;
flex-wrap: wrap;
b { & > * { margin-right: .5rem; }
& > *:last-child { margin-right: 0; }
.bold {
font-weight: 500;
color: var(--theme-caption-color); color: var(--theme-caption-color);
} }
strong { .strong {
font-weight: 500; font-weight: 500;
color: var(--theme-content-accent-color); color: var(--theme-content-accent-color);
} }

View File

@ -31,7 +31,8 @@
</script> </script>
{#if tx.operations.state} {#if tx.operations.state}
updated State to <div class="flex-row-center update-container">
<span>updated State to</span>
{#if statePresenter?.presenter} {#if statePresenter?.presenter}
{#await client.findOne(core.class.State, { _id: tx.operations.state }) then st} {#await client.findOne(core.class.State, { _id: tx.operations.state }) then st}
{#if st} {#if st}
@ -39,17 +40,9 @@
{/if} {/if}
{/await} {/await}
{/if} {/if}
</div>
{/if} {/if}
<style lang='scss'> <style lang="scss">
.state { .update-container span { margin-right: .5rem; }
display: flex;
align-items: center;
span {
margin-left: 10px;
margin-right: 10px;
display: flex;
align-items: center;
}
}
</style> </style>

View File

@ -30,14 +30,14 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: .375rem 1rem; padding: .25rem .75rem;
width: min-content; width: fit-content;
text-transform: uppercase; text-transform: uppercase;
font-weight: 500; font-weight: 500;
letter-spacing: .5px; letter-spacing: .5px;
font-size: .625rem; font-size: .625rem;
color: #fff; color: #fff;
border: 1px solid rgba(0, 0, 0, .1); border: 1px solid rgba(0, 0, 0, .1);
border-radius: .5rem; border-radius: .25rem;
} }
</style> </style>