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

Release: 1.2.7 #10

Merged
merged 5 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "core-registry-cadt-ui",
"version": "1.2.6",
"version": "1.2.8",
"private": true,
"author": "Chia Network Inc. <[email protected]>",
"homepage": "./",
Expand Down
2 changes: 1 addition & 1 deletion src/components/blocks/APIDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const APIDataTable = withTheme(
let fullRecord = null;

if (actions === 'Projects') {
fullRecord = projects.filter(
fullRecord = projects?.filter(
project =>
project.warehouseProjectId === partialRecord.warehouseProjectId,
)[0];
Expand Down
3 changes: 1 addition & 2 deletions src/components/blocks/UnitsDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ const UnitsDetails = ({ data, stagingData, changeColor }) => {
<Body size="Bold" width="100%">
<FormattedMessage id="unit-block-start" />
</Body>
{data &&
detailsViewData('data', data, 'unitBlockStart', changeColor)}
{data && detailsViewData('data', data, 'unitBlockStart', false)}
{stagingData &&
detailsViewData(
'stagingData',
Expand Down
29 changes: 29 additions & 0 deletions src/components/forms/OrgCreateFormModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ const OrgCreateFormModal = ({ onClose }) => {
const [formData, setFormData] = useState({
name: '',
png: null,
prefix: '',
});
const [importedOrgUid, setImportedOrgUid] = useState('');
const [tabValue, setTabValue] = useState(0);

const nameIsValid = formData?.name?.length > 0;
const prefixIsValid = formData?.prefix?.length > 0;
const isOrgUidValid = importedOrgUid?.length > 4;

const handleTabChange = (event, newValue) => {
Expand Down Expand Up @@ -113,6 +115,33 @@ const OrgCreateFormModal = ({ onClose }) => {
</Body>
)}
</StyledFieldContainer>
<StyledFieldContainer>
<StyledLabelContainer>
<Body>
*<FormattedMessage id="organization-prefix" />
</Body>
</StyledLabelContainer>
<InputContainer>
<StandardInput
size={InputSizeEnum.large}
variant={InputVariantEnum.default}
value={formData.prefix}
onChange={value =>
setFormData(prevState => ({
...prevState,
prefix: value,
}))
}
/>
</InputContainer>
{!prefixIsValid && (
<Body size="Small" color="red">
{intl.formatMessage({
id: 'add-valid-organization-prefix',
})}
</Body>
)}
</StyledFieldContainer>
<StyledFieldContainer>
<StyledLabelContainer>
<Body>
Expand Down
30 changes: 29 additions & 1 deletion src/components/forms/OrgEditFormModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ import {
} from '..';
import { editExistingOrg } from '../../store/actions/climateWarehouseActions';

const OrgEditFormModal = ({ onClose, name, icon }) => {
const OrgEditFormModal = ({ onClose, name, prefix, icon }) => {
const intl = useIntl();
const dispatch = useDispatch();
const { notification } = useSelector(state => state.app);
const [formData, setFormData] = useState({
name,
prefix,
png: icon,
});

Expand Down Expand Up @@ -81,6 +82,33 @@ const OrgEditFormModal = ({ onClose, name, icon }) => {
</Body>
)}
</StyledFieldContainer>
<StyledFieldContainer>
<StyledLabelContainer>
<Body>
*<FormattedMessage id="organization-prefix" />
</Body>
</StyledLabelContainer>
<InputContainer>
<StandardInput
size={InputSizeEnum.large}
variant={InputVariantEnum.default}
value={formData.prefix}
onChange={value =>
setFormData(prevState => ({
...prevState,
prefix: value,
}))
}
/>
</InputContainer>
{!nameIsValid && (
<Body size="Small" color="red">
{intl.formatMessage({
id: 'add-valid-organization-prefix',
})}
</Body>
)}
</StyledFieldContainer>
<StyledFieldContainer>
<StyledLabelContainer>
<Body>
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/ProjectEditModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ProjectEditModal = ({
}) => {
const projectToBeEdited = useSelector(
state =>
state.climateWarehouse.projects.filter(
state?.climateWarehouse?.projects?.filter(
project => project.warehouseProjectId === record.warehouseProjectId,
)[0],
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/ProjectTransferModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ProjectTransferModal = ({
}) => {
const projectToBeTransferred = useSelector(
state =>
state.climateWarehouse.projects.filter(
state?.climateWarehouse?.projects?.filter(
project => project.warehouseProjectId === record.warehouseProjectId,
)[0],
);
Expand Down
2 changes: 0 additions & 2 deletions src/components/forms/UnitCreateModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ const emptyUnit = {
countryJurisdictionOfOwner: '',
inCountryJurisdictionOfOwner: '',
unitCount: 0,
unitBlockEnd: '',
unitBlockStart: '',
marketplace: '',
marketplaceLink: '',
marketplaceIdentifier: '',
Expand Down
Loading
Loading