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

Design property #106

Merged
merged 34 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
afbcb65
New slick design base
mamikals Dec 3, 2024
5c5a726
added new template for filter component + fixed bug with filter funct…
saramoh2309 Dec 3, 2024
0ca8440
added changes for filter + group timeline
saramoh2309 Dec 5, 2024
ef4e6ea
Merge remote-tracking branch 'origin/master' into designProperty
mamikals Dec 9, 2024
82e6683
Add customComponent to slick view
mamikals Dec 9, 2024
79d234a
styling fixes
saramoh2309 Dec 10, 2024
c5cd458
fix design + refactor code + run prettier
saramoh2309 Dec 11, 2024
033feb3
expandable item
saramoh2309 Dec 11, 2024
9258ca0
Update prettier version
mamikals Dec 13, 2024
0713716
Add multiple header support for slick design
mamikals Dec 13, 2024
d5f2f05
Delete whitespace
mamikals Dec 17, 2024
72b9168
Merge branch 'designProperty' into designPropertyCopy
mamikals Dec 17, 2024
81d9c16
Remove showSubtitle and add custom clamp line amount
mamikals Dec 19, 2024
740cd01
Merge pull request #104 from navikt/designPropertyCopy
mamikals Dec 20, 2024
c370112
Merge branch 'master' into designProperty
mamikals Dec 20, 2024
71df7f4
resolve comment
saramoh2309 Jan 6, 2025
cf4bc01
removed duplicates
saramoh2309 Jan 6, 2025
e94e2b5
Update thread view dependency
mamikals Jan 6, 2025
28933b9
Fix review comments
mamikals Jan 7, 2025
675b287
Send logEvent down to custom component
mamikals Jan 7, 2025
d4c58fd
Update force-app/main/default/lwc/timeline/timeline.js-meta.xml
mamikals Jan 8, 2025
4d52c3c
Reform getDateFormat to be more readable
mamikals Jan 8, 2025
ff7a5fb
Fix unexpected token error
mamikals Jan 9, 2025
e4d9ab4
Update date error handling
mamikals Jan 14, 2025
233ffee
Merge branch 'master' into designProperty
mamikals Jan 14, 2025
82e9726
do not show Load More if records is filtered + remove "Tomt"
saramoh2309 Jan 14, 2025
de962f5
removed border if user has no cases
saramoh2309 Jan 14, 2025
c99408d
removed isLoadig from Load More
saramoh2309 Jan 14, 2025
6fc7ef8
Adjust line size and distance
mamikals Jan 15, 2025
bb48c84
Fix issues with data loading by using the old code instead
mamikals Jan 16, 2025
a1dfdf3
Merge remote-tracking branch 'origin/designProperty' into fixForFilter
mamikals Jan 17, 2025
7bb1a5b
Use modified data for filter and record count
mamikals Jan 20, 2025
99e513c
Merge pull request #109 from navikt/fixForFilter
mamikals Jan 20, 2025
339404c
fixed filter
EirikFladby Jan 21, 2025
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
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"printWidth": 120,
"singleQuote": true,
"tabWidth": 4,
"plugins": ["prettier-plugin-apex"],
"overrides": [
{
"files": "**/lwc/**/*.html",
Expand All @@ -15,6 +16,12 @@
"options": {
"parser": "html"
}
},
{
"files": "*.cls",
"options": {
"parser": "apex"
}
}
]
}
2 changes: 0 additions & 2 deletions force-app/main/default/classes/Timeline_Helper.cls
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ public with sharing class Timeline_Helper {
for (String key : modelsSeparatedByMonth.keySet()) {
Datetime d = modelsSeparatedByMonth.get(key)[0].record.dateValueDb;
String name = getMonth(d.month()) + ' ' + d.year();
if (includeSize == true)
name += ' (' + modelsSeparatedByMonth.get(key).size() + ')';
mamikals marked this conversation as resolved.
Show resolved Hide resolved
results.add(new Timeline_ModelList(key, name, modelsSeparatedByMonth.get(key), true));
}

Expand Down
40 changes: 39 additions & 1 deletion force-app/main/default/classes/Timeline_Model.cls
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,38 @@ global with sharing class Timeline_Model implements Comparable {

@AuraEnabled
public String customComponent;

@AuraEnabled
public Integer clampLines;

@AuraEnabled
public List<Header> headers;
}

public class Header {
@AuraEnabled
public Object header;
@AuraEnabled
public String type;
@AuraEnabled
public boolean isString;
@AuraEnabled
public boolean isDatetime;
@AuraEnabled
public boolean isDate;

public Header(String header, sObject sObj) {
this.header = get(sObj, header);
Schema.DescribeFieldResult fi = sObj.getSObjectType()
.getDescribe()
.fields.getMap()
.get(header)
.getDescribe();
this.type = fi.getType().name();
this.isString = this.type == 'STRING';
this.isDatetime = this.type == 'DATETIME';
this.isDate = this.type == 'DATE';
}
}

public class Filter {
Expand Down Expand Up @@ -104,7 +136,7 @@ global with sharing class Timeline_Model implements Comparable {
? (Id) get(sObj, config.Timeline_Child__r.SObjectRelatedUserId__c)
: null;
record.assigneeId = config.SObjectAssigneeId__c != null ? (Id) get(sObj, config.SObjectAssigneeId__c) : null;
record.title = (String) get(sObj, config.Timeline_Child__r.SObjectTitle__c);
record.title = (String) get(sObj, config.Timeline_Child__r.SObjectTitle__c.deleteWhiteSpace().split(',')[0]);
record.durationInMinute = (Integer) get(sObj, 'DurationInMinutes');
record.allowAutoOpen = config.Timeline_Child__r.AllowAutoOpen__c;
record.sObjectKind = config.Timeline_Child__r.SObjectName__c;
Expand All @@ -116,6 +148,12 @@ global with sharing class Timeline_Model implements Comparable {
record.dateValueDb = getDateValue(config, sObj, record);
record.subtitleOverride = (String) get(sObj, config.Timeline_Child__r.SObjectSubtitle__c); // To add subtitle for samtale
record.customComponent = config.Timeline_Child__r.CustomComponent__c;
record.clampLines = (Integer) config.Timeline_Child__r.ClampLines__c;
mamikals marked this conversation as resolved.
Show resolved Hide resolved

record.headers = new List<Header>();
for (String headerField : config.Timeline_Child__r.SObjectTitle__c.deleteWhiteSpace().split(',')) {
record.headers.add(new Header(headerField, sObj));
}

theme.sldsTimelineItemColor = config.Timeline_Child__r.SLDS_Timeline_Color__c;
theme.icon = getIconValue(config, sObj);
Expand Down
32 changes: 24 additions & 8 deletions force-app/main/default/classes/Timeline_QueriesHelper.cls
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public with sharing class Timeline_QueriesHelper {
'Timeline_Child__r.SubtitleRelatedUserPrepositionEng__c, Timeline_Child__r.SubtitleRelatedUserPrepositionNor__c, ' +
'Timeline_Child__r.AutomaticRefresh__c, Timeline_Child__r.AutomaticRefresh_PushTopicName__c, ' +
'Timeline_Child__r.AllowAutoOpen__c, ' +
'Timeline_Child__r.CustomComponent__c,' +
'Timeline_Child__r.CustomComponent__c, ' +
'Timeline_Child__r.ClampLines__c, ' +
'Timeline_Child__r.FilterablePicklist1__c, Timeline_Child__r.FilterablePicklist2__c, Timeline_Child__r.FilterableCheckbox__c ' +
'FROM TimelineParent__mdt ' +
'WHERE SObjectParent__c = : parentSObjectType';
Expand Down Expand Up @@ -78,7 +79,8 @@ public with sharing class Timeline_QueriesHelper {
fields,
mdt.Timeline_Child__r.SObjectName__c,
parameters,
mdt.Timeline_Child__r.SObjectDateField__c);
mdt.Timeline_Child__r.SObjectDateField__c
);
}

// --------------------------------------------------- //
Expand All @@ -97,7 +99,10 @@ public with sharing class Timeline_QueriesHelper {
field = (String) mdt.get(mdtField);
}
if (field != null) {
fieldsToQuery.add(field);
List<String> splitFields = field.split(',');
for (String f : splitFields) {
fieldsToQuery.add(f.trim());
}
}
}
if (!mdt.Timeline_Child__r.SLDS_Icon__c.contains(':')) {
Expand All @@ -122,15 +127,26 @@ public with sharing class Timeline_QueriesHelper {
// ---------------- getQueryParameters --------------- //
// --------------------------------------------------- //

public static String getQueryParameters(TimelineParent__mdt mdt, String recordId, Integer amountOfMonths, String recordTypeId) {
public static String getQueryParameters(
TimelineParent__mdt mdt,
String recordId,
Integer amountOfMonths,
String recordTypeId
) {
String now = getTime(mdt.Timeline_Child__r.SObjectDateFieldIsDate__c);
String dateField = mdt.Timeline_Child__r.SObjectDateField__c;
String parameters = '';

if(String.isNotBlank(recordTypeId)) {
parameters = mdt.SObjectRelationshipField__c + ' = \'' + recordId + '\' AND ' + 'RecordTypeId = \'' + recordTypeId + '\' AND ';
}
else {
if (String.isNotBlank(recordTypeId)) {
parameters =
mdt.SObjectRelationshipField__c +
' = \'' +
recordId +
'\' AND ' +
'RecordTypeId = \'' +
recordTypeId +
'\' AND ';
} else {
parameters = mdt.SObjectRelationshipField__c + ' = \'' + recordId + '\' AND ';
}
// task specific parameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@
<behavior>Edit</behavior>
<field>SubtitleRelatedUserPrepositionNor__c</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>ClampLines__c</field>
</layoutItems>
</layoutColumns>
<layoutColumns>
<layoutItems>
Expand Down Expand Up @@ -259,7 +263,7 @@
<field>ExpandedFieldsToDisplay__c</field>
</layoutItems>
</layoutColumns>
<layoutColumns/>
<layoutColumns />
<style>TwoColumnsLeftToRight</style>
</layoutSections>
<layoutSections>
Expand Down Expand Up @@ -294,9 +298,9 @@
<detailHeading>true</detailHeading>
<editHeading>false</editHeading>
<label>Custom Links</label>
<layoutColumns/>
<layoutColumns/>
<layoutColumns/>
<layoutColumns />
<layoutColumns />
<layoutColumns />
<style>CustomLinks</style>
</layoutSections>
<showEmailCheckbox>false</showEmailCheckbox>
Expand All @@ -305,9 +309,9 @@
<showRunAssignmentRulesCheckbox>false</showRunAssignmentRulesCheckbox>
<showSubmitAndAttachButton>false</showSubmitAndAttachButton>
<summaryLayout>
<masterLabel>00hKM0000018E96</masterLabel>
<masterLabel>00hKF000004VW8D</masterLabel>
<sizeX>4</sizeX>
<sizeY>0</sizeY>
<summaryLayoutStyle>Default</summaryLayoutStyle>
</summaryLayout>
</Layout>
</Layout>
14 changes: 14 additions & 0 deletions force-app/main/default/lwc/timeline/slick.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.custom-container {
align-items: flex-start;
border-bottom: 1px solid #767676;
margin: 0 1rem;
}

.left-column {
padding-top: 4rem;
padding-bottom: 1.25rem;
}

.right-column {
padding-top: 1.75rem;
}
71 changes: 71 additions & 0 deletions force-app/main/default/lwc/timeline/slick.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<template>
<div class="slds-theme_default slds-is-relative">
<div class="slds-grid custom-container">
<div class="slds-col slds-large-size_8-of-12 left-column">
<h3 class="slds-card__header-title">
<lightning-icon icon-name={headerIcon} size="small" class="slds-var-m-right_small"></lightning-icon>
{header}
</h3>
</div>
<div class="slds-col slds-large-size_4-of-12 right-column">
<c-timeline-filter
lwc:if={filterIsActive}
filter-properties={filterProperties}
is-grouped={isGrouped}
picklist-filter-1-label={picklistFilter1Label}
picklist-filter-2-label={picklistFilter2Label}
hide-my-activities-filter={hideMyActivitiesFilter}
onfilterchange={handleFilter}
log-event={logEvent}
design={design}
></c-timeline-filter>
</div>
</div>
<div lwc:if={loading} class="slds-scrollable" style={loadingStyle}>
<lightning-spinner alternative-text="Loading" size="small"></lightning-spinner>
</div>
<div lwc:elseif={error}>
<div class="slds-text-heading_large slds-align_absolute-center">{labels.errorTitle}</div>
<div class="slds-text-color_destructive slds-align_absolute-center slds-var-m-around_x-large">
{errorMsg}
</div>
</div>
<div lwc:elseif={empty}>
<div class="slds-text-heading_large slds-align_absolute-center">{labels.emptyTitle}</div>
<div class="slds-text-heading_small slds-align_absolute-center slds-var-m-around_x-large">
{emptySubtitle}
</div>
</div>
<div lwc:else>
<ul class="slds-timeline">
<lightning-accordion
allow-multiple-sections-open
active-section-name={openAccordionSections}
onsectiontoggle={handleSectionToggle}
lwc:if={finishedLoading}
>
<template for:each={data} for:item="group" for:index="groupIndex">
<c-timeline-group
key={group.id}
group={group}
labels={labels}
amount-of-records={amountOfRecords}
amount-of-records-to-load={amountOfRecordsToLoad}
open-accordion-sections={openAccordionSections}
group-index={groupIndex}
expand-check={expandCheck}
log-event={logEvent}
design={design}
include-amount-in-title={includeAmountInTitle}
>
</c-timeline-group>
</template>
</lightning-accordion>
</ul>
<div lwc:if={hasMoreDataToLoad} class="slds-align_absolute-center loadMoreFooter" onclick={loadMore}>
<button class="slds-button loadMoreBtn">{labels.loadMore}</button>
</div>
<div lwc:else class="slds-align_absolute-center slds-text-color_weak slds-var-p-top_medium"></div>
</div>
</div>
</template>
10 changes: 8 additions & 2 deletions force-app/main/default/lwc/timeline/timeline.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
group-index={groupIndex}
expand-check={expandCheck}
log-event={logEvent}
design={design}
include-amount-in-title={includeAmountInTitle}
>
</c-timeline-group>
</template>
Expand All @@ -74,11 +76,15 @@
</div>
<div if:true={error} class="slds-var-m-top_large">
<div class="slds-text-heading_large slds-align_absolute-center">{labels.errorTitle}</div>
<div class="slds-text-color_destructive slds-align_absolute-center slds-var-m-around_x-large">{errorMsg}</div>
<div class="slds-text-color_destructive slds-align_absolute-center slds-var-m-around_x-large">
{errorMsg}
</div>
</div>
<div if:true={empty} class="slds-var-m-top_large">
<div class="slds-text-heading_large slds-align_absolute-center">{labels.emptyTitle}</div>
<div class="slds-text-heading_small slds-align_absolute-center slds-var-m-around_x-large">{emptySubtitle}</div>
<div class="slds-text-heading_small slds-align_absolute-center slds-var-m-around_x-large">
{emptySubtitle}
</div>
</div>

<!-- ************************************************************************ -->
Expand Down
Loading
Loading