Skip to content

Commit

Permalink
Merge pull request #72 from carfup/release
Browse files Browse the repository at this point in the history
Release 1.3.3.1
  • Loading branch information
carfup authored Nov 5, 2020
2 parents 3150f04 + b7c1f2d commit 217e6a8
Show file tree
Hide file tree
Showing 18 changed files with 132 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<control namespace="Carfup" constructor="AnyCompositeFIelds" version="0.0.77" display-name-key="Carfup.AnyCompositeFIelds" description-key="AnyCompositeFIelds will allow you to display any stack of fields as composite rendering." control-type="standard" preview-image="img/preview.png">
<control namespace="Carfup" constructor="AnyCompositeFIelds" version="0.0.78" display-name-key="Carfup.AnyCompositeFIelds" description-key="AnyCompositeFIelds will allow you to display any stack of fields as composite rendering." control-type="standard" preview-image="img/preview.png">
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
<property name="FieldToAttachControl" display-name-key="FieldToAttachControl" description-key="Field to attach the control to" of-type-group="strings" usage="bound" required="true" />
<property name="separator" display-name-key="Values separator" description-key="Separator to split the mapped values (for a space, put %20)" of-type="SingleLine.Text" usage="input" required="true" default-value="%20" />
Expand Down
12 changes: 6 additions & 6 deletions AnyCompositeFields/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BICValidator/BicValidator/ControlManifest.Input.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<control namespace="Carfup" constructor="BicValidator" version="0.0.11" display-name-key="Carfup.BicValidator" description-key="BicValidator description" control-type="standard">
<control namespace="Carfup" constructor="BicValidator" version="0.0.12" display-name-key="Carfup.BicValidator" description-key="BicValidator description" control-type="standard">
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
<property name="BICValue" display-name-key="BICValidator_BICValue" description-key="BIC field value" of-type="SingleLine.Text" usage="bound" required="true" />
<property name="IsValid" display-name-key="BICValidator_IsValid" description-key="Is BIC valid" of-type="TwoOptions" usage="bound" required="false" />
Expand Down
6 changes: 3 additions & 3 deletions BICValidator/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Carfup_PCFControls/Other/Solution.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<LocalizedName description="Carfup_PCFControls" languagecode="1033" />
</LocalizedNames>
<Descriptions />
<Version>1.3.3.0</Version>
<Version>1.3.3.1</Version>
<!-- Solution Package Type: Unmanaged(0)/Managed(1)/Both(2)-->
<Managed>2</Managed>
<Publisher>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<control namespace="Carfup" constructor="FileFieldTypeManager" version="0.0.23" display-name-key="Carfup.FileFieldTypeManager" description-key="FileFieldTypeManager description" control-type="standard">
<control namespace="Carfup" constructor="FileFieldTypeManager" version="0.0.24" display-name-key="Carfup.FileFieldTypeManager" description-key="FileFieldTypeManager description" control-type="standard">
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
<property name="FieldToAttachControl" display-name-key="FieldToAttachControl" description-key="Text Control to attach the PCF control" of-type="SingleLine.Text" usage="bound" required="true" />
Expand Down
6 changes: 3 additions & 3 deletions FileFieldTypeManager/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion IbanValidator/IbanValidator/ControlManifest.Input.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<control namespace="Carfup" constructor="IbanValidator" version="0.0.22" display-name-key="Carfup.IbanValidator" description-key="IBAN validator for PCF" control-type="standard">
<control namespace="Carfup" constructor="IbanValidator" version="0.0.23" display-name-key="Carfup.IbanValidator" description-key="IBAN validator for PCF" control-type="standard">
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
<property name="IbanValue" display-name-key="IbanValidator_IbanValue" description-key="IBAN field value" of-type="SingleLine.Text" usage="bound" required="true" />
<property name="IsValidIban" display-name-key="IbanValidator_IsValidIban" description-key="Is IBAN valid" of-type="TwoOptions" usage="bound" required="false" />
Expand Down
6 changes: 3 additions & 3 deletions IbanValidator/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion QuickEditForm/QuickEditForm/ControlManifest.Input.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<control namespace="Carfup" constructor="QuickEditForm" version="0.0.238" display-name-key="Carfup.QuickEditForm" description-key="QuickEditForm allows you to edit data from a lookup record using a Quick View Form definition as enty form." control-type="standard" preview-image="img/preview.png">
<control namespace="Carfup" constructor="QuickEditForm" version="0.0.239" display-name-key="Carfup.QuickEditForm" description-key="QuickEditForm allows you to edit data from a lookup record using a Quick View Form definition as enty form." control-type="standard" preview-image="img/preview.png">
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
<property name="FieldToAttachControl" display-name-key="FieldToAttachControl" description-key="Property_Desc_Key" of-type="SingleLine.Text" usage="bound" required="true" />
<property name="QuickViewFormId" display-name-key="QuickViewFormId" description-key="GUID of the Quick View Form to render" of-type="SingleLine.Text" usage="input" required="true" />
Expand Down
2 changes: 2 additions & 0 deletions QuickEditForm/QuickEditForm/EntitiesDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export class EntityReferenceInfo{
public Id:string;
public Name:string;
public Attributes?: any;
public SchemaName: string;
public QuickCreateEnabled : boolean;
}

export class EntityReferenceIdName{
Expand Down
28 changes: 19 additions & 9 deletions QuickEditForm/QuickEditForm/components/DatePickerControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,23 @@ export default class DatePickerControl extends React.Component<IDatePickerProper
}

private onSelectedDate = (date: Date | null | undefined) : void => {
let currentDateValue = this.state.fieldDefinition?.fieldValue as Date;
let currentDateValue = this.state.fieldDefinition?.fieldValue === null ? new Date() : this.state.fieldDefinition?.fieldValue as Date;
const fieldDefTemp = {...this.state}.fieldDefinition;

if(fieldDefTemp != undefined){
// @ts-ignore
currentDateValue.setYear(date?.getFullYear());
// @ts-ignore
currentDateValue.setMonth(date?.getMonth());
// @ts-ignore
currentDateValue.setDate(date?.getDate());

fieldDefTemp["fieldValue"] = currentDateValue;
if(date === null){
fieldDefTemp["fieldValue"] = null;
}
else {
// @ts-ignore
currentDateValue.setYear(date?.getFullYear());
// @ts-ignore
currentDateValue.setMonth(date?.getMonth());
// @ts-ignore
currentDateValue.setDate(date?.getDate());

fieldDefTemp["fieldValue"] = currentDateValue;
}
fieldDefTemp["isDirty"] = true;
this.setState({ fieldDefinition: fieldDefTemp });

Expand All @@ -179,6 +184,11 @@ export default class DatePickerControl extends React.Component<IDatePickerProper
}

private formatDate = function date2str(x: Date, y: string) {

if(x === null){
return undefined;
}

var z = {
M: x.getMonth() + 1,
d: x.getDate(),
Expand Down
9 changes: 8 additions & 1 deletion QuickEditForm/QuickEditForm/components/MessageBarControl.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import * as React from 'react';
import {MessageBar, MessageBarType } from '@fluentui/react/lib/MessageBar';

import { MessageBarButton } from '@fluentui/react/lib/Button';

export interface IMessageProps {
messageType? : MessageBarType;
messageText? : string;
showMessageBar : boolean;
onClickQuickCreate: () => void;
showQuickCreateButton?: boolean;
}

export interface IMessageState {
Expand Down Expand Up @@ -34,6 +36,11 @@ export default class MessageBarControl extends React.Component<IMessageProps, IM
<div style={{marginTop: "5px"}}>
{this.state.showMessageBar &&
<MessageBar
actions={this.state.messageType == MessageBarType.info && this.props.showQuickCreateButton ? <div>
<MessageBarButton
onClick={this.props.onClickQuickCreate} >Open Quick Create Form
</MessageBarButton>
</div> : undefined}
messageBarType={this.state.messageType}
isMultiline={false}
dismissButtonAriaLabel="Close"
Expand Down
23 changes: 14 additions & 9 deletions QuickEditForm/QuickEditForm/components/TextFieldControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class TextFieldControl extends React.Component<ITextFieldControlP
super(props);
this.state = {
fieldDefinition: this.props.fieldDefinition,
type: props.icon === "Money" ? "number": "text",
type: props.icon === "NumberField" || props.icon === "Money" ? "number": "text",
};
}

Expand All @@ -46,7 +46,7 @@ export default class TextFieldControl extends React.Component<ITextFieldControlP
<Stack.Item grow={1} styles={{root : { alignItems: 'center' }}}>
<TextField
disabled={this.props.disabled!}
value={this.grabValueFromFieldDefinition(this.state.fieldDefinition)}
value={this.grabValueFromFieldDefinition()}
id={this.props.fieldDefinition.controlId}
multiline={(this.props.fieldDefinition?.fieldType == "memo")}
autoAdjustHeight={(this.props.fieldDefinition?.fieldType == "memo")}
Expand All @@ -68,24 +68,29 @@ export default class TextFieldControl extends React.Component<ITextFieldControlP
);
}

private grabValueFromFieldDefinition = (fieldDef : DataFieldDefinition | undefined) : string => {
if(this.state.fieldDefinition?.fieldValue?.Name !== undefined)
return this.state.fieldDefinition?.fieldValue?.Name;
private grabValueFromFieldDefinition = () : string => {
let result = "";
if(this.state.fieldDefinition?.fieldValue?.Name != undefined) {
result = this.state.fieldDefinition?.fieldValue?.Name;
}
else {
result = this.state.fieldDefinition?.fieldValue;
}

return this.state.fieldDefinition?.fieldValue;
return result;
}

private onDoubleClick = (event: React.MouseEvent<HTMLInputElement | HTMLTextAreaElement, MouseEvent>) : void => {

switch(this.props.icon){
case "EditMail":
this.props.context?.navigation.openUrl(`mailto:${this.grabValueFromFieldDefinition(this.state.fieldDefinition?.fieldValue)}`);
this.props.context?.navigation.openUrl(`mailto:${this.grabValueFromFieldDefinition()}`);
break;
case "Globe":
this.props.context?.navigation.openUrl(`${this.grabValueFromFieldDefinition(this.state.fieldDefinition?.fieldValue)}`);
this.props.context?.navigation.openUrl(`${this.grabValueFromFieldDefinition()}`);
break;
case "Phone":
this.props.context?.navigation.openUrl(`tel:${this.grabValueFromFieldDefinition(this.state.fieldDefinition?.fieldValue)}`);
this.props.context?.navigation.openUrl(`tel:${this.grabValueFromFieldDefinition()}`);
break;
}
}
Expand Down
Loading

0 comments on commit 217e6a8

Please sign in to comment.