Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
097a1a7
Update terminology from 'Select Many' to 'Select Multiple', 'Number' …
gushil Dec 8, 2025
4c2f281
Refactor button state management and update styles for form builder h…
gushil Dec 8, 2025
dfb0423
Brought back consent, oc_description, readonly, calculation, select_o…
gushil Dec 8, 2025
51a5d31
Add routes and functionality for creating new library templates and t…
gushil Dec 16, 2025
d733dc5
Update asset action buttons to conditionally display rename tooltip a…
gushil Dec 16, 2025
6514414
Fixed routing for file upload.
gushil Dec 16, 2025
4f65821
Refactor LibraryAssetForm to conditionally render fields based on ass…
gushil Dec 16, 2025
a80cb68
Enhance navigation logic to support parent asset routing and streamli…
gushil Dec 16, 2025
f32b472
Update label for Question Block in sidebar menu into Question
gushil Dec 18, 2025
1b5847b
Add capitalization style and adjust assets table row layout
gushil Dec 18, 2025
d99e424
Update button class for all-tags toggle in library actions
gushil Dec 18, 2025
daed8c6
Enhance AssetsTableRow: add modifyDetails method and update action bu…
gushil Dec 18, 2025
134f469
Refactor AssetActionButtons: enable collections related actions only
gushil Dec 18, 2025
46945ef
Update padding for k-drawer sidebar to improve layout
gushil Dec 19, 2025
6dc8b4b
Enhance event handling for consent row choices: trigger appropriate e…
gushil Dec 19, 2025
d7a2651
OC-26640 Remove Cascading Select functionality
gushil Dec 29, 2025
5ba60f8
OC-26641 LibrarySidebar: add collection management features
gushil Dec 31, 2025
177ebc4
OC-26641 Fix breadcrumbs rendering and take out collection type in as…
gushil Dec 31, 2025
f824499
OC-26641 Remove collection asset from library table
gushil Dec 31, 2025
167d0fd
OC-26641 Refactor navigation logic in LibraryAssetEditor to simplify …
gushil Dec 31, 2025
8fa184b
OC-26641 Update padding in k-drawer sidebar for improved layout
gushil Dec 31, 2025
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
1 change: 1 addition & 0 deletions jsapp/js/bemComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ bem.FormSidebar__label = makeBem(bem.FormSidebar, 'label');
bem.FormSidebar__labelText = makeBem(bem.FormSidebar, 'label-text');
bem.FormSidebar__labelCount = makeBem(bem.FormSidebar, 'label-count');
bem.FormSidebar__grouping = makeBem(bem.FormSidebar, 'grouping');
bem.FormSidebar__itemlink = makeBem(bem.FormSidebar, 'itemlink', 'a');

bem.KDrawer = makeBem(null, 'k-drawer');
bem.KDrawer__primaryIcons = makeBem(bem.KDrawer, 'primary-icons', 'nav');
Expand Down
65 changes: 33 additions & 32 deletions jsapp/js/components/assetsTable/assetActionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,40 +270,40 @@ class AssetActionButtons extends React.Component<
clearPopover={this.state.shouldHidePopover}
popoverSetVisible={this.onPopoverSetVisible}
>
{userCanEdit && isDeployable && (
{/* {userCanEdit && isDeployable && (
<bem.PopoverMenu__link onClick={this.deploy}>
<i className='k-icon k-icon-deploy' />
{t('Deploy')}
</bem.PopoverMenu__link>
)}
)} */}

{userCanEdit && assetType === ASSET_TYPES.survey.id && (
{/* {userCanEdit && assetType === ASSET_TYPES.survey.id && (
<bem.PopoverMenu__link onClick={this.replace}>
<i className='k-icon k-icon-replace' />
{t('Replace form')}
</bem.PopoverMenu__link>
)}
)} */}

{userCanEdit && assetType !== ASSET_TYPES.collection.id && (
{/* {userCanEdit && assetType !== ASSET_TYPES.collection.id && (
<bem.PopoverMenu__link onClick={this.editLanguages}>
<i className='k-icon k-icon-language' />
{t('Manage translations')}
</bem.PopoverMenu__link>
)}
)} */}

{userCanEdit && assetType === ASSET_TYPES.survey.id && (
{/* {userCanEdit && assetType === ASSET_TYPES.survey.id && (
<bem.PopoverMenu__link onClick={this.cloneAsTemplate}>
<i className='k-icon k-icon-template' />
{t('Create template')}
</bem.PopoverMenu__link>
)}
)} */}

{downloads.map((dl) => (
{/* {downloads.map((dl) => (
<bem.PopoverMenu__link href={dl.url} key={`dl-${dl.format}`}>
<i className={`k-icon k-icon-file-${dl.format}`} />
{t('Download')}&nbsp;{dl.format.toString().toUpperCase()}
</bem.PopoverMenu__link>
))}
))} */}

{userCanEdit &&
assetType !== ASSET_TYPES.survey.id &&
Expand Down Expand Up @@ -352,32 +352,32 @@ class AssetActionButtons extends React.Component<
</bem.PopoverMenu__moveTo>,
]}

{userCanEdit &&
{/* {userCanEdit &&
assetType === ASSET_TYPES.survey.id &&
this.props.has_deployment &&
!this.props.deployment__active && (
<bem.PopoverMenu__link onClick={this.unarchive}>
<i className='k-icon k-icon-archived' />
{t('Unarchive')}
</bem.PopoverMenu__link>
)}
)} */}

{userCanEdit &&
{/* {userCanEdit &&
assetType === ASSET_TYPES.survey.id &&
this.props.has_deployment &&
this.props.deployment__active && (
<bem.PopoverMenu__link onClick={this.archive}>
<i className='k-icon k-icon-archived' />
{t('Archive')}
</bem.PopoverMenu__link>
)}
)} */}

{userCanEdit && (
{/* {userCanEdit && (
<bem.PopoverMenu__link onClick={this.delete}>
<i className='k-icon k-icon-trash' />
{t('Delete')}
</bem.PopoverMenu__link>
)}
)} */}
</PopoverMenu>
);
}
Expand Down Expand Up @@ -438,6 +438,7 @@ class AssetActionButtons extends React.Component<
const hasDetailsEditable =
assetType === ASSET_TYPES.template.id ||
assetType === ASSET_TYPES.collection.id;
const isCollection = assetType === ASSET_TYPES.collection.id;

const routeAssetUid = getRouteAssetUid();

Expand All @@ -446,69 +447,69 @@ class AssetActionButtons extends React.Component<
onMouseLeave={this.onMouseLeave}
onMouseEnter={this.onMouseEnter}
>
{this.renderSubButton()}
{/* {this.renderSubButton()} */}

{userCanEdit && assetType !== ASSET_TYPES.collection.id && (
{/* {userCanEdit && assetType !== ASSET_TYPES.collection.id && (
<bem.AssetActionButtons__iconButton
href={this.getFormBuilderLink()}
data-tip={t('Edit in Form Builder')}
className='right-tooltip'
>
<i className='k-icon k-icon-edit' />
</bem.AssetActionButtons__iconButton>
)}
)} */}

{userCanEdit && hasDetailsEditable && (
{userCanEdit && hasDetailsEditable && isCollection && (
<bem.AssetActionButtons__iconButton
onClick={this.modifyDetails}
data-tip={t('Modify details')}
data-tip={t('Rename Collection')}
className='right-tooltip'
>
<i className='k-icon k-icon-settings' />
</bem.AssetActionButtons__iconButton>
)}

{userCanEdit && (
{/* {userCanEdit && (
<bem.AssetActionButtons__iconButton
onClick={this.showTagsModal}
data-tip={t('Edit Tags')}
className='right-tooltip'
>
<i className='k-icon k-icon-tag' />
</bem.AssetActionButtons__iconButton>
)}
)} */}

{userCanEdit && (
{/* {userCanEdit && !isCollection && (
<bem.AssetActionButtons__iconButton
onClick={this.share}
data-tip={t('Share')}
className='right-tooltip'
>
<i className='k-icon k-icon-user-share' />
</bem.AssetActionButtons__iconButton>
)}
)} */}

{assetType !== ASSET_TYPES.collection.id && (
{/* {assetType !== ASSET_TYPES.collection.id && (
<bem.AssetActionButtons__iconButton
onClick={this.clone}
data-tip={t('Clone')}
className='right-tooltip'
>
<i className='k-icon k-icon-duplicate' />
</bem.AssetActionButtons__iconButton>
)}
)} */}

{assetType === ASSET_TYPES.template.id && (
{/* {assetType === ASSET_TYPES.template.id && (
<bem.AssetActionButtons__iconButton
onClick={this.cloneAsSurvey}
data-tip={t('Create project')}
className='right-tooltip'
>
<i className='k-icon k-icon-projects' />
</bem.AssetActionButtons__iconButton>
)}
)} */}

{routeAssetUid &&
{/* {routeAssetUid &&
this.props.asset.parent !== null &&
!this.props.asset.parent.includes(routeAssetUid) && (
<bem.AssetActionButtons__iconButton
Expand All @@ -518,9 +519,9 @@ class AssetActionButtons extends React.Component<
>
<i className='k-icon k-icon-folder' />
</bem.AssetActionButtons__iconButton>
)}
)} */}

{this.renderMoreActions()}
{!isCollection && this.renderMoreActions()}
</bem.AssetActionButtons>
);
}
Expand Down
15 changes: 12 additions & 3 deletions jsapp/js/components/assetsTable/assetsTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,16 @@ $assets-table-hover-bg: colors.$kobo-gray-98;
* AssetsTableRow
* ========================================================================== */

.assets-table-row {
.capitalize {
text-transform: capitalize;
}

.assets-table-row {
display: flex;
flex-direction: row;
position: relative;
align-items: flex-start;
background-color: colors.$kobo-gray-96;

&.assets-table-row--asset {
&:hover {
Expand Down Expand Up @@ -352,14 +357,18 @@ $assets-table-hover-bg: colors.$kobo-gray-98;
}

&.assets-table-row__column--actions {
width: 17%;
width: 22%;
text-align: right;

.asset-action-buttons {
justify-content: flex-end;
justify-content: flex-start;
}
}

&.assets-table-row__column--actions.header {
text-align: center;
}

.k-icon {
vertical-align: middle;
}
Expand Down
2 changes: 1 addition & 1 deletion jsapp/js/components/assetsTable/assetsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export default class AssetsTable extends React.Component<
displayLabel = t('Questions');
}
return (
<bem.AssetsTableRow__column m={columnDef.id} disabled>
<bem.AssetsTableRow__column m={columnDef.id} className="header" disabled>
{displayLabel}
</bem.AssetsTableRow__column>
);
Expand Down
27 changes: 25 additions & 2 deletions jsapp/js/components/assetsTable/assetsTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class AssetsTableRow extends React.Component<AssetsTableRowProps> {
);
}

modifyDetails() {
assetUtils.modifyDetails(this.props.asset);
}

onDeleteComplete() {
// do nothing
}
Expand Down Expand Up @@ -117,7 +121,7 @@ class AssetsTableRow extends React.Component<AssetsTableRowProps> {
{settings_version}
</bem.AssetsTableRow__column>

<bem.AssetsTableRow__column m='item-type'>
<bem.AssetsTableRow__column m='item-type' className='capitalize'>
{ASSET_TYPES[this.props.asset.asset_type].label}
</bem.AssetsTableRow__column>

Expand All @@ -129,7 +133,16 @@ class AssetsTableRow extends React.Component<AssetsTableRowProps> {
{formatTime(this.props.asset.date_modified)}
</bem.AssetsTableRow__column>

<bem.AssetsTableRow__column m='actions'>
{ this.props.asset.asset_type !== ASSET_TYPES.collection.id && (
<bem.AssetsTableRow__buttons>
<AssetActionButtons asset={this.props.asset} />
</bem.AssetsTableRow__buttons>
)}

<bem.AssetsTableRow__column
m='actions'
className={this.props.asset.asset_type === ASSET_TYPES.collection.id ? 'no-actions-buttons' : 'with-actions-buttons' }
>

<bem.AssetActionButtons>

Expand All @@ -143,6 +156,16 @@ class AssetsTableRow extends React.Component<AssetsTableRowProps> {
</bem.AssetActionButtons__iconButton>
)}

{userCanEdit && this.props.asset.asset_type === ASSET_TYPES.collection.id && (
<bem.AssetActionButtons__iconButton
onClick={this.modifyDetails}
data-tip={t('Rename Collection')}
className='right-tooltip'
>
<i className='k-icon k-icon-edit' />
</bem.AssetActionButtons__iconButton>
)}

{userCanEdit && (
<bem.AssetActionButtons__iconButton
onClick={this.showTagsModal}
Expand Down
19 changes: 14 additions & 5 deletions jsapp/js/components/formEditors.es6
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Reflux from 'reflux';
import editableFormMixin from '../editorMixins/editableForm';
import {update_states} from 'js/constants';
import {ROUTES} from 'js/router/routerConstants';
import mixins from '../mixins';
import {withRouter} from 'js/router/legacy';
import { ASSET_TYPES } from '../constants';

/**
* These are the components that are used for Form Builder routes.
Expand Down Expand Up @@ -56,10 +56,19 @@ class LibraryAssetEditorComponent extends React.Component {
if (this.props.router.path === ROUTES.NEW_LIBRARY_CHILD) {
this.state.asset = false;
this.state.parentAsset = this.props.params.uid;
this.state.backRoute = ROUTES.LIBRARY_ITEM.replace(
':uid',
this.props.params.uid
);
this.state.backRoute = ROUTES.LIBRARY;
}

if (this.props.router.path === ROUTES.NEW_LIBRARY_TEMPLATE_ITEM) {
this.state.asset = false;
this.state.desiredAssetType = ASSET_TYPES.template.id;
}

if (this.props.router.path === ROUTES.NEW_LIBRARY_TEMPLATE_ITEM_CHILD) {
this.state.asset = false;
this.state.desiredAssetType = ASSET_TYPES.template.id;
this.state.parentAsset = this.props.params.uid;
this.state.backRoute = ROUTES.LIBRARY;
}

if (this.props.router.searchParams.get('back')) {
Expand Down
2 changes: 0 additions & 2 deletions jsapp/js/components/library/assetRoute.es6
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ class AssetRoute extends React.Component {
</bem.FormView__cell>
}

<AssetPublicButton asset={this.state.asset}/>

<AssetActionButtons asset={this.state.asset}/>
</bem.FormView__cell>

Expand Down
Loading
Loading