Skip to content

Commit 69136cf

Browse files
committed
Minor updates
1 parent 99e8aad commit 69136cf

File tree

2 files changed

+38
-57
lines changed

2 files changed

+38
-57
lines changed

src/js/@WebParts/ProgramProjectStatus/index.tsx

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import * as React from "react";
33
import { IProgressIndicatorProps, ProgressIndicator } from "office-ui-fabric-react/lib/ProgressIndicator";
44
import { MessageBar, MessageBarType } from "office-ui-fabric-react/lib/MessageBar";
5-
import { StickyContainer } from "react-sticky";
65
import pnp, { Web } from "sp-pnp-js";
76
import IProgramProjectStatusProps, { ProgramProjectStatusDefaultProps } from "./IProgramProjectStatusProps";
87
import IProgramProjectStatusState from "./IProgramProjectStatusState";
@@ -21,6 +20,7 @@ import * as config from "../../config";
2120
export default class ProgramProjectStatus extends React.Component<IProgramProjectStatusProps, IProgramProjectStatusState> {
2221
public static displayName = "ProgramProjectStatus";
2322
public static defaultProps = ProgramProjectStatusDefaultProps;
23+
private container: HTMLDivElement;
2424

2525
/**
2626
* Constructor
@@ -52,15 +52,33 @@ export default class ProgramProjectStatus extends React.Component<IProgramProjec
5252

5353

5454
public render(): React.ReactElement<IProgramProjectStatusProps> {
55-
const { isLoading, errorMessage, loadProgress, enrichedProjects } = this.state;
55+
const {
56+
isLoading,
57+
errorMessage,
58+
loadProgress,
59+
enrichedProjects,
60+
} = this.state;
61+
5662
if (isLoading) {
57-
return <ProgressIndicator { ...loadProgress } />;
63+
return (
64+
<div ref={ele => this.container = ele} >
65+
<ProgressIndicator {...loadProgress} />
66+
</div>
67+
);
5868
}
5969
if (errorMessage) {
60-
return <MessageBar messageBarType={MessageBarType.error}>{errorMessage}</MessageBar>;
70+
return (
71+
<div ref={ele => this.container = ele} >
72+
<MessageBar messageBarType={MessageBarType.error}>{errorMessage}</MessageBar>
73+
</div>
74+
);
6175
}
6276
if (enrichedProjects.length === 0) {
63-
return <NoStoredProjectsMessage />;
77+
return (
78+
<div ref={ele => this.container = ele} >
79+
<NoStoredProjectsMessage />
80+
</div>
81+
);
6482
}
6583
return this.renderSummarySections();
6684
}
@@ -70,8 +88,9 @@ export default class ProgramProjectStatus extends React.Component<IProgramProjec
7088
*/
7189
private renderSummarySections() {
7290
const { enrichedProjects, failedProjects } = this.state;
91+
7392
return (
74-
<div>
93+
<div ref={ele => this.container = ele} style={{ width: this.container.parentElement.clientWidth }}>
7594
<div>
7695
{failedProjects.map(p => (
7796
<div style={{ marginBottom: 10 }}>
@@ -80,20 +99,18 @@ export default class ProgramProjectStatus extends React.Component<IProgramProjec
8099
))}
81100
</div>
82101
<div className="ms-Grid">
83-
<StickyContainer>
84-
{enrichedProjects.map(({ Title, URL, Data }, i) => {
85-
return (
86-
<SummarySection
87-
key={`ProjectSummarySection_${i}`}
88-
webUrl={URL}
89-
title={Title}
90-
titleUrl={`${URL}/SitePages/ProjectStatus.aspx`}
91-
style={{ marginBottom: 20, paddingBottom: 20 }}
92-
project={Data.project}
93-
sections={Data.sections} />
94-
);
95-
})}
96-
</StickyContainer>
102+
{enrichedProjects.map(({ Title, URL, Data }, i) => {
103+
return (
104+
<SummarySection
105+
key={`ProjectSummarySection_${i}`}
106+
webUrl={URL}
107+
title={Title}
108+
titleUrl={`${URL}/SitePages/ProjectStatus.aspx`}
109+
style={{ marginBottom: 20, paddingBottom: 20 }}
110+
project={Data.project}
111+
sections={Data.sections} />
112+
);
113+
})}
97114
</div>
98115
</div>
99116
);
@@ -132,7 +149,7 @@ export default class ProgramProjectStatus extends React.Component<IProgramProjec
132149
failedProjects.push(project);
133150
}
134151
}
135-
let enrichedProjects: EnrichedProjectItem[] = enrichedProjectsArray.sort((p1, p2) => {return p1.Title.localeCompare(p2.Title); });
152+
let enrichedProjects: EnrichedProjectItem[] = enrichedProjectsArray.sort((p1, p2) => { return p1.Title.localeCompare(p2.Title); });
136153
return { enrichedProjects, failedProjects };
137154
}
138155
}

templates/root/Objects/SiteFields.xml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,6 @@
2121
<CHOICE>Utenfor programmmet</CHOICE>
2222
</CHOICES>
2323
</Field>
24-
<Field ID="{325543a5-815d-485d-a9a5-e0773ad762e9}" Name="GtProjectPhase" DisplayName="Fase" Type="TaxonomyFieldType" WebId="{siteid}" Group="Prosjektportalenkolonner" Description="" Indexed="TRUE" StaticName="GtProjectPhase">
25-
<Customization>
26-
<ArrayOfProperty>
27-
<Property>
28-
<Name>SspId</Name>
29-
<Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:string"
30-
xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{sitecollectiontermstoreid}
31-
</Value>
32-
</Property>
33-
<Property>
34-
<Name>TermSetId</Name>
35-
<Value xmlns:q2="http://www.w3.org/2001/XMLSchema" p4:type="q2:string"
36-
xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">eb9d651a-cf88-4c80-b1dd-212f244a6903
37-
</Value>
38-
</Property>
39-
</ArrayOfProperty>
40-
</Customization>
41-
</Field>
42-
<Field ID="{5563056f-533f-4333-bd29-85a2f94a37d0}" Name="GtProductPhase" DisplayName="Produktfase" Type="TaxonomyFieldType" WebId="{siteid}" Group="Prosjektportalenkolonner" Description="" Indexed="TRUE" StaticName="GtProductPhase">
43-
<Customization>
44-
<ArrayOfProperty>
45-
<Property>
46-
<Name>SspId</Name>
47-
<Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:string"
48-
xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{sitecollectiontermstoreid}
49-
</Value>
50-
</Property>
51-
<Property>
52-
<Name>TermSetId</Name>
53-
<Value xmlns:q2="http://www.w3.org/2001/XMLSchema" p4:type="q2:string"
54-
xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">eb9d651a-cf88-4c80-b1dd-212f244a6903
55-
</Value>
56-
</Property>
57-
</ArrayOfProperty>
58-
</Customization>
59-
</Field>
6024
<Field ID="{aa889e95-d364-4a65-9d18-5c62715f5e3b}" Name="GtProjectPhaseChoice" DisplayName="Programfase" Type="Choice" Group="Prosjektportalenkolonner" Description="Programmets fase fase, som valg-felt for å tillate integrasjon med enkelte tredjepartsverktøy" ShowInNewForm="FALSE" ShowInEditForm="FALSE" FillInChoice="TRUE" StaticName="GtProjectPhaseChoice" SourceID="{497fcfa4-6b52-4f2f-931a-a18f7b96c7ca}" AllowDeletion="TRUE">
6125
<CHOICES>
6226
<CHOICE>Identifisere</CHOICE>

0 commit comments

Comments
 (0)