@undp/carbon-library 1.0.31 → 1.0.32
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +36 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Definitions/Definitions/programme.definitions.d.ts +7 -0
- package/dist/esm/index.js +36 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Definitions/Definitions/programme.definitions.d.ts +7 -0
- package/dist/index.d.ts +8 -1
- package/package.json +1 -1
@@ -5,6 +5,12 @@ export declare enum ProgrammeStage {
|
|
5
5
|
Authorised = "Authorised",
|
6
6
|
Rejected = "Rejected"
|
7
7
|
}
|
8
|
+
export declare enum ProgrammeStageMRV {
|
9
|
+
AwaitingAuthorization = "Pending",
|
10
|
+
Authorised = "Authorised",
|
11
|
+
Approved = "Approved",
|
12
|
+
Rejected = "Rejected"
|
13
|
+
}
|
8
14
|
export declare enum Role {
|
9
15
|
Root = "Root",
|
10
16
|
Admin = "Admin",
|
@@ -49,6 +55,7 @@ export declare const getStageEnumVal: (value: string) => string;
|
|
49
55
|
export declare const getCreditStageVal: (value: string) => string;
|
50
56
|
export declare const getStageTransferEnumVal: (value: string, transfer: ProgrammeTransfer) => string;
|
51
57
|
export declare const getStageTagType: (stage: ProgrammeStage) => "error" | "processing" | "default";
|
58
|
+
export declare const getStageTagTypeMRV: (stage: ProgrammeStageMRV) => "purple" | "error" | "processing" | "default";
|
52
59
|
export declare const getTransferStageTagType: (stage: CreditTransferStage, transfer: ProgrammeTransfer) => "orange" | "purple" | "error" | "processing" | "default" | "success";
|
53
60
|
export declare class UnitField {
|
54
61
|
unit: string;
|
package/dist/esm/index.js
CHANGED
@@ -155,6 +155,13 @@ var ProgrammeStage;
|
|
155
155
|
ProgrammeStage["Rejected"] = "Rejected";
|
156
156
|
// Frozen = 'Frozen',
|
157
157
|
})(ProgrammeStage || (ProgrammeStage = {}));
|
158
|
+
var ProgrammeStageMRV;
|
159
|
+
(function (ProgrammeStageMRV) {
|
160
|
+
ProgrammeStageMRV["AwaitingAuthorization"] = "Pending";
|
161
|
+
ProgrammeStageMRV["Authorised"] = "Authorised";
|
162
|
+
ProgrammeStageMRV["Approved"] = "Approved";
|
163
|
+
ProgrammeStageMRV["Rejected"] = "Rejected";
|
164
|
+
})(ProgrammeStageMRV || (ProgrammeStageMRV = {}));
|
158
165
|
// export enum ProgrammeTransferStage {
|
159
166
|
// APPROVED = 'Approved',
|
160
167
|
// REJECTED = 'Rejected',
|
@@ -248,6 +255,18 @@ var getStageTagType = function (stage) {
|
|
248
255
|
return "default";
|
249
256
|
}
|
250
257
|
};
|
258
|
+
var getStageTagTypeMRV = function (stage) {
|
259
|
+
switch (getStageEnumVal(stage)) {
|
260
|
+
case ProgrammeStageMRV.AwaitingAuthorization:
|
261
|
+
return "error";
|
262
|
+
case ProgrammeStageMRV.Authorised:
|
263
|
+
return "processing";
|
264
|
+
case ProgrammeStageMRV.Approved:
|
265
|
+
return "purple";
|
266
|
+
default:
|
267
|
+
return "default";
|
268
|
+
}
|
269
|
+
};
|
251
270
|
var getTransferStageTagType = function (stage, transfer) {
|
252
271
|
// if (transfer.isRetirement) {
|
253
272
|
// switch (getStageEnumVal(stage)) {
|
@@ -783,12 +802,19 @@ var AddNewCompanyComponent = function (props) {
|
|
783
802
|
return [4 /*yield*/, post("national/organisation/regions", {
|
784
803
|
page: 1,
|
785
804
|
size: 100,
|
805
|
+
filterAnd: [
|
806
|
+
{
|
807
|
+
key: "lang",
|
808
|
+
operation: "=",
|
809
|
+
value: "en",
|
810
|
+
},
|
811
|
+
],
|
786
812
|
})];
|
787
813
|
case 2:
|
788
814
|
response = _a.sent();
|
789
815
|
if (response.data) {
|
790
816
|
regionNames = response.data.map(function (item) { return item.regionName; });
|
791
|
-
setRegionsList(__spreadArray(["
|
817
|
+
setRegionsList(__spreadArray([t("national")], regionNames, true));
|
792
818
|
}
|
793
819
|
return [3 /*break*/, 5];
|
794
820
|
case 3:
|
@@ -836,9 +862,9 @@ var AddNewCompanyComponent = function (props) {
|
|
836
862
|
nextOne(values);
|
837
863
|
};
|
838
864
|
var onChangeRegion = function (values) {
|
839
|
-
if (values.includes("
|
865
|
+
if (values.includes(t("national"))) {
|
840
866
|
var buyerCountryValues = regionsList;
|
841
|
-
var newBuyerValues = buyerCountryValues === null || buyerCountryValues === void 0 ? void 0 : buyerCountryValues.filter(function (item) { return item !== "
|
867
|
+
var newBuyerValues = buyerCountryValues === null || buyerCountryValues === void 0 ? void 0 : buyerCountryValues.filter(function (item) { return item !== t("national"); });
|
842
868
|
formOne.setFieldValue("regions", __spreadArray([], newBuyerValues, true));
|
843
869
|
}
|
844
870
|
};
|
@@ -2114,7 +2140,7 @@ var UserManagementComponent = function (props) {
|
|
2114
2140
|
React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: handleOk, onActionCanceled: handleCancel, openModal: openDeleteConfirmationModal, errorMsg: errorMsg, loading: loading })));
|
2115
2141
|
};
|
2116
2142
|
|
2117
|
-
var css_248z$9 = ".programme-management .programme-title-bar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0px 0px 30px 0px; }\n .programme-management .programme-title-bar .title {\n display: flex;\n flex-direction: column;\n justify-content: space-between; }\n .programme-management .programme-title-bar .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n .programme-management .programme-title-bar .flex-display {\n margin-left: 15px; }\n\n.programme-management .certify-list {\n width: 110px;\n display: flex;\n align-items: center;\n flex-wrap: wrap; }\n .programme-management .certify-list .profile-icon {\n margin-bottom: 4px; }\n\n.programme-management .table-actions-section {\n margin-bottom: 0px; }\n .programme-management .table-actions-section input {\n font-family: \"Inter\";\n font-size: 0.8rem; }\n\n.programme-management .all-check {\n margin-right: 10px; }\n .programme-management .all-check .ant-checkbox-inner::after {\n background-color: rgba(58, 53, 65, 0.5); }\n .programme-management .all-check .ant-checkbox-checked .ant-checkbox-inner::after {\n background-color: transparent; }\n .programme-management .all-check .ant-checkbox-checked .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.5);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Retired\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"AwaitingAuthorization\"] + .ant-checkbox-inner {\n background-color: rgba(237, 77, 71, 0.6);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Rejected\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"
|
2143
|
+
var css_248z$9 = ".programme-management .programme-title-bar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0px 0px 30px 0px; }\n .programme-management .programme-title-bar .title {\n display: flex;\n flex-direction: column;\n justify-content: space-between; }\n .programme-management .programme-title-bar .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n .programme-management .programme-title-bar .flex-display {\n margin-left: 15px; }\n\n.programme-management .certify-list {\n width: 110px;\n display: flex;\n align-items: center;\n flex-wrap: wrap; }\n .programme-management .certify-list .profile-icon {\n margin-bottom: 4px; }\n\n.programme-management .table-actions-section {\n margin-bottom: 0px; }\n .programme-management .table-actions-section input {\n font-family: \"Inter\";\n font-size: 0.8rem; }\n\n.programme-management .all-check {\n margin-right: 10px; }\n .programme-management .all-check .ant-checkbox-inner::after {\n background-color: rgba(58, 53, 65, 0.5); }\n .programme-management .all-check .ant-checkbox-checked .ant-checkbox-inner::after {\n background-color: transparent; }\n .programme-management .all-check .ant-checkbox-checked .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.5);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Retired\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"AwaitingAuthorization\"] + .ant-checkbox-inner {\n background-color: rgba(237, 77, 71, 0.6);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Rejected\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Authorised\"] + .ant-checkbox-inner {\n background-color: #16b1ff;\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Approved\"] + .ant-checkbox-inner {\n background-color: rgba(145, 85, 253, 0.6);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Transferred\"] + .ant-checkbox-inner {\n background-color: rgba(118, 195, 39, 0.6);\n border: none; }\n";
|
2118
2144
|
styleInject(css_248z$9);
|
2119
2145
|
|
2120
2146
|
var ProgrammeManagementColumns;
|
@@ -2134,7 +2160,7 @@ var ProgrammeManagementColumns;
|
|
2134
2160
|
|
2135
2161
|
var Search = Input.Search;
|
2136
2162
|
var ProgrammeManagementComponent = function (props) {
|
2137
|
-
var t = props.t, visibleColumns = props.visibleColumns, useUserContext = props.useUserContext, useConnection = props.useConnection, onNavigateToProgrammeView = props.onNavigateToProgrammeView, onClickAddProgramme = props.onClickAddProgramme;
|
2163
|
+
var t = props.t, visibleColumns = props.visibleColumns, useUserContext = props.useUserContext, useConnection = props.useConnection, onNavigateToProgrammeView = props.onNavigateToProgrammeView, onClickAddProgramme = props.onClickAddProgramme, enableAddProgramme = props.enableAddProgramme;
|
2138
2164
|
var _a = useConnection(); _a.get; _a.delete; var post = _a.post;
|
2139
2165
|
var _b = useState(), totalProgramme = _b[0], setTotalProgramme = _b[1];
|
2140
2166
|
var _c = useState(false), loading = _c[0], setLoading = _c[1];
|
@@ -2148,8 +2174,9 @@ var ProgrammeManagementComponent = function (props) {
|
|
2148
2174
|
var _l = useState(), sortOrder = _l[0], setSortOrder = _l[1];
|
2149
2175
|
var _m = useState(), sortField = _m[0], setSortField = _m[1];
|
2150
2176
|
var userInfoState = useUserContext().userInfoState;
|
2151
|
-
var
|
2152
|
-
|
2177
|
+
var stageObject = enableAddProgramme ? ProgrammeStageMRV : ProgrammeStage;
|
2178
|
+
var statusOptions = Object.keys(stageObject).map(function (k, index) { return ({
|
2179
|
+
label: Object.values(stageObject)[index],
|
2153
2180
|
value: k,
|
2154
2181
|
}); });
|
2155
2182
|
var _o = useState(statusOptions.map(function (e) { return e.value; })), selectedStatus = _o[0], setSelectedStatus = _o[1];
|
@@ -2237,7 +2264,7 @@ var ProgrammeManagementComponent = function (props) {
|
|
2237
2264
|
sorter: true,
|
2238
2265
|
align: "center",
|
2239
2266
|
render: function (item) {
|
2240
|
-
return (React.createElement(Tag, { className: "clickable", color:
|
2267
|
+
return (React.createElement(Tag, { className: "clickable", color: getStageTagTypeMRV(item) }, getStageEnumVal(item)));
|
2241
2268
|
},
|
2242
2269
|
onCell: function (record, rowIndex) {
|
2243
2270
|
return {
|
@@ -5341,5 +5368,5 @@ var ProgrammeTransfer = /** @class */ (function () {
|
|
5341
5368
|
return ProgrammeTransfer;
|
5342
5369
|
}());
|
5343
5370
|
|
5344
|
-
export { AddNewCompanyComponent, AddNewUserComponent, BaseEntity, Company, CompanyManagementColumns, CompanyManagementComponent, CompanyProfileComponent, CompanyRole$1 as CompanyRole, ConfigurationSettingsType, CreditTransferStage, LegendItem, Loading, MapComponent, MapTypes, MapboxComponent, ProfileIcon, ProgrammeManagementColumns, ProgrammeManagementComponent, ProgrammeStage, ProgrammeTransfer, ProgrammeViewComponent, RetireType, Role, RoleIcon, SectoralScope, StasticCard, TxType, TypeOfMitigation, UnitField, User, UserManagementColumns, UserManagementComponent, UserProfileComponent, addCommSep, addCommSepRound, addRoundNumber, addSpaces, getCompanyBgColor, getCreditStageVal, getFinancialFields, getGeneralFields, getRetirementTypeString, getStageEnumVal, getStageTagType, getStageTransferEnumVal, getTransferStageTagType, isBase64, sumArray };
|
5371
|
+
export { AddNewCompanyComponent, AddNewUserComponent, BaseEntity, Company, CompanyManagementColumns, CompanyManagementComponent, CompanyProfileComponent, CompanyRole$1 as CompanyRole, ConfigurationSettingsType, CreditTransferStage, LegendItem, Loading, MapComponent, MapTypes, MapboxComponent, ProfileIcon, ProgrammeManagementColumns, ProgrammeManagementComponent, ProgrammeStage, ProgrammeStageMRV, ProgrammeTransfer, ProgrammeViewComponent, RetireType, Role, RoleIcon, SectoralScope, StasticCard, TxType, TypeOfMitigation, UnitField, User, UserManagementColumns, UserManagementComponent, UserProfileComponent, addCommSep, addCommSepRound, addRoundNumber, addSpaces, getCompanyBgColor, getCreditStageVal, getFinancialFields, getGeneralFields, getRetirementTypeString, getStageEnumVal, getStageTagType, getStageTagTypeMRV, getStageTransferEnumVal, getTransferStageTagType, isBase64, sumArray };
|
5345
5372
|
//# sourceMappingURL=index.js.map
|