tsv2-library 1.0.61-alpha.74 → 1.0.61-alpha.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@ interface TSFormContext<T> {
19
19
  declare const useForm: <T>() => TSFormContext<T>;
20
20
  declare const useField: <T>(path: MaybeRefOrGetter<string>, rules?: MaybeRef<RuleExpression<T>>, opts?: Partial<FieldOptions<T>> | undefined) => FieldContext<T>;
21
21
  import Presets from './presets';
22
- import { handleTokenExpiration, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, downloadFile, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, isValidJSONString, buildBodyParams, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole } from './utils';
22
+ import { handleTokenExpiration, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, downloadFile, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, isValidJSONString, buildBodyParams, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail } from './utils';
23
23
  import { flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys } from './components/v2/Tree/helpers';
24
24
  import useLoadingStore from './components/v2/Loading/store/loading.store';
25
25
  import Tooltip from '../node_modules/primevue/tooltip';
@@ -31,4 +31,4 @@ declare const _default: {
31
31
  install: (app: App) => void;
32
32
  };
33
33
  export default _default;
34
- export { LibConfig, TSToastService, TSi18n, VueHtmlToPaper, Tooltip, Focus, DialogDamageLog, DialogMissingLog, DialogTransferLog, TSAssetInfo, TSApproverInfo, TSBadge, TSBadgeGroup, TSBreadcrumb, TSButton, TSButtonAddByScan, TSButtonBulkAction, TSButtonCopy, TSButtonDownload, TSButtonFilter, TSButtonLogHistory, TSButtonRadio, TSButtonViewLog, TSButtonScan, TSButtonSearch, TSButtonSearchByScan, TSButtonSelectTree, TSButtonSelectUser, TSButtonSync, TSButtonToggle, TSCalendar, TSCard, TSCarousel, TSCheckbox, TSCustomColumn, TSDatePicker, TSDataTable, TSDayPicker, TSDialog, TSDialogApprovalList, TSDialogAssetNameDetail, TSDialogConfirm, TSDialogForm, TSDialogLinkedAsset, TSDialogPrintQR, TSDialogReportDamage, TSDialogReportMissing, TSDialogReportTag, TSDialogSelectTree, TSDialogSelectAsset, TSDialogSelectUser, TSDisposalReport, TSDropdown, TSFilterContainer, TSFileUpload, TSForm, TSIcon, TSImage, TSImageCompressor, TSInlineMessage, TSInputBadge, TSInputCurrency, TSInputEmail, TSInputNumber, TSInputOTP, TSInputPassword, TSInputPhoneNumber, TSInputRangeNumber, TSInputText, TSInputSearch, TSInputURL, TSLoading, TSMenu, TSMultiSelect, TSOverlayPanel, TSPaginator, TSProgressBar, TSSteps, TSTabMenu, TSTagType, TSTextarea, TSTimeline, TSToast, TSTransactionRoles, TSTree, TSTreeSearchInput, TSUserWithIcon, TSValidatorMessage, handleTokenExpiration, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, downloadFile, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n, useForm, useField, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, isValidJSONString, buildBodyParams, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys, TreeAPI, RoutineAPI, DisposalAPI, RoutineServices, AssetsServices, AssetNameService, AssetBrandService, DisposalServices, FilterMatchMode, useLoadingStore, Presets, };
34
+ export { LibConfig, TSToastService, TSi18n, VueHtmlToPaper, Tooltip, Focus, DialogDamageLog, DialogMissingLog, DialogTransferLog, TSAssetInfo, TSApproverInfo, TSBadge, TSBadgeGroup, TSBreadcrumb, TSButton, TSButtonAddByScan, TSButtonBulkAction, TSButtonCopy, TSButtonDownload, TSButtonFilter, TSButtonLogHistory, TSButtonRadio, TSButtonViewLog, TSButtonScan, TSButtonSearch, TSButtonSearchByScan, TSButtonSelectTree, TSButtonSelectUser, TSButtonSync, TSButtonToggle, TSCalendar, TSCard, TSCarousel, TSCheckbox, TSCustomColumn, TSDatePicker, TSDataTable, TSDayPicker, TSDialog, TSDialogApprovalList, TSDialogAssetNameDetail, TSDialogConfirm, TSDialogForm, TSDialogLinkedAsset, TSDialogPrintQR, TSDialogReportDamage, TSDialogReportMissing, TSDialogReportTag, TSDialogSelectTree, TSDialogSelectAsset, TSDialogSelectUser, TSDisposalReport, TSDropdown, TSFilterContainer, TSFileUpload, TSForm, TSIcon, TSImage, TSImageCompressor, TSInlineMessage, TSInputBadge, TSInputCurrency, TSInputEmail, TSInputNumber, TSInputOTP, TSInputPassword, TSInputPhoneNumber, TSInputRangeNumber, TSInputText, TSInputSearch, TSInputURL, TSLoading, TSMenu, TSMultiSelect, TSOverlayPanel, TSPaginator, TSProgressBar, TSSteps, TSTabMenu, TSTagType, TSTextarea, TSTimeline, TSToast, TSTransactionRoles, TSTree, TSTreeSearchInput, TSUserWithIcon, TSValidatorMessage, handleTokenExpiration, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, downloadFile, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n, useForm, useField, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, isValidJSONString, buildBodyParams, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail, flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys, TreeAPI, RoutineAPI, DisposalAPI, RoutineServices, AssetsServices, AssetNameService, AssetBrandService, DisposalServices, FilterMatchMode, useLoadingStore, Presets, };
@@ -4,7 +4,7 @@ import exportToExcel from './exportToExcel.util';
4
4
  import { formatGoDate, formatDate, formatDateReadable, getUserLocale } from './date.util';
5
5
  import useToast from './toast.util';
6
6
  import { getImageURL, downloadFile } from './getImageURL.util';
7
- import { getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasAnyMonitoringReportRole, hasMonitoringReportRole, hasStaffRole } from './role.util';
7
+ import { getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasAnyMonitoringReportRole, hasMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail } from './role.util';
8
8
  import { getCurrency, formatCurrency } from './currency.util';
9
9
  import { unListenSidebarChanges, listenSidebarChanges } from './listenSidebarChanges.util';
10
10
  import { getBaseURL, getHostName } from './getBaseURL.util';
@@ -17,4 +17,4 @@ import { isValidJSONString } from './json.util';
17
17
  import { buildBodyParams } from './request.util';
18
18
  declare const isObjectEmpty: (object: object) => boolean;
19
19
  declare const getNestedProperyValue: (object: object, property: string) => string | boolean | number | object;
20
- export { isObjectEmpty, getNestedProperyValue, handleTokenExpiration, getImageURL, downloadFile, formatUserName, formatVowelSoundLabel, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getBaseURL, getHostName, useI18n, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, isValidJSONString, buildBodyParams, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, };
20
+ export { isObjectEmpty, getNestedProperyValue, handleTokenExpiration, getImageURL, downloadFile, formatUserName, formatVowelSoundLabel, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getBaseURL, getHostName, useI18n, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, isValidJSONString, buildBodyParams, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail, };
@@ -29,4 +29,5 @@ declare const hasStaffRole: (name: TransactionAttribute) => boolean;
29
29
  declare const hasMonitoringReportRole: (name: TransactionAttribute) => boolean;
30
30
  declare const hasApprovalRole: (name: TransactionAttribute) => boolean;
31
31
  declare const checkRouteAccess: (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => void;
32
- export { getTransactionRole, getSystemRole, hasTransactionRole, hasApprovalRole, hasSystemRole, checkRouteAccess, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, };
32
+ declare const hasAccessToAssetDetail: () => boolean;
33
+ export { getTransactionRole, getSystemRole, hasTransactionRole, hasApprovalRole, hasSystemRole, checkRouteAccess, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail, };
@@ -19751,6 +19751,29 @@ const checkRouteAccess = (to, from, next) => {
19751
19751
  else
19752
19752
  navigateToUrl("/not-found");
19753
19753
  };
19754
+ const hasAccessToAssetDetail = () => {
19755
+ const systemRoles = [
19756
+ "depreciationGroup",
19757
+ "depreciationMethod",
19758
+ "purchaseDocument",
19759
+ "purchaseInformation",
19760
+ "tag",
19761
+ "registerAsset"
19762
+ ];
19763
+ const managerRoles = [
19764
+ "auditRole",
19765
+ "maintenanceRole",
19766
+ "borrowingRole",
19767
+ "disposalRole",
19768
+ "transferRole",
19769
+ "trackingRole",
19770
+ "repairRole"
19771
+ ];
19772
+ const hasSystemAccess = systemRoles.some((role) => hasSystemRole(role));
19773
+ const hasManagerAccess = managerRoles.some((role) => hasManagerRole(role));
19774
+ const hasStaffAccess = hasStaffRole("repairRole");
19775
+ return hasSystemAccess || hasManagerAccess || hasStaffAccess;
19776
+ };
19754
19777
  const currencies = [
19755
19778
  {
19756
19779
  label: "؋ - Afghan Afghani",
@@ -28028,7 +28051,7 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
28028
28051
  else
28029
28052
  asset.value = props.transactionDetail;
28030
28053
  });
28031
- const user = JSON.parse(localStorage.getItem("user") ?? "{}");
28054
+ JSON.parse(localStorage.getItem("user") ?? "{}");
28032
28055
  const asset = ref();
28033
28056
  const useStatusField = computed(() => {
28034
28057
  var _a;
@@ -28146,7 +28169,7 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
28146
28169
  createElementVNode("div", _hoisted_3$D, [
28147
28170
  createElementVNode("div", _hoisted_4$q, [
28148
28171
  createElementVNode("div", _hoisted_5$j, toDisplayString$1(nameWithSequence.value), 1),
28149
- unref(user).userType !== "Basic" ? (openBlock(), createElementBlock("a", {
28172
+ unref(hasAccessToAssetDetail)() ? (openBlock(), createElementBlock("a", {
28150
28173
  key: 0,
28151
28174
  href: `/assets/detail/${((_a = asset.value) == null ? void 0 : _a.asset) ?? ((_b = asset.value) == null ? void 0 : _b._id)}`,
28152
28175
  class: "text-primary-500",
@@ -74090,6 +74113,7 @@ export {
74090
74113
  getTransactionRole,
74091
74114
  getUserLocale,
74092
74115
  handleTokenExpiration,
74116
+ hasAccessToAssetDetail,
74093
74117
  hasAnyManagerRole,
74094
74118
  hasAnyMonitoringReportRole,
74095
74119
  hasApprovalRole,