Skip to content

Commit

Permalink
feat: finalize import dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG committed Feb 21, 2025
1 parent 28dcce6 commit a96e8d3
Show file tree
Hide file tree
Showing 15 changed files with 271 additions and 139 deletions.
58 changes: 27 additions & 31 deletions src/app/bookmark/bookmark-detail/bookmark-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
<input
pInputText
type="text"
id="bm_detail_form_display_name"
id="bm_detail_form_field_display_name"
class="w-full pt-3 pb-2"
formControlName="displayName"
[attr.aria-label]="'BOOKMARK.DISPLAY_NAME' | translate"
[pTooltip]="'BOOKMARK.TOOLTIPS.DISPLAY_NAME' | translate"
tooltipPosition="top"
tooltipEvent="hover"
/>
<label class="ocx-required-label" for="bm_detail_form_display_name">
<label class="ocx-required-label" for="bm_detail_form_field_display_name">
{{ 'BOOKMARK.DISPLAY_NAME' | translate }}</label
>
</span>
Expand All @@ -32,19 +32,19 @@
pInputTextarea
autoresize="true"
rows="3"
id="bm_detail_form_url"
id="bm_detail_form_field_url"
formControlName="url"
[attr.aria-label]="'BOOKMARK.URL' | translate"
[pTooltip]="'BOOKMARK.TOOLTIPS.URL' | translate"
tooltipPosition="top"
tooltipEvent="hover"
></textarea>
<label class="ocx-required-label" for="bm_detail_form_url">{{ 'BOOKMARK.URL' | translate }}</label>
<label class="ocx-required-label" for="bm_detail_form_field_url">{{ 'BOOKMARK.URL' | translate }}</label>
</span>
</div>
<p-checkbox
*ocxIfPermission="'BOOKMARK#ADMIN_EDIT'"
id="bm_detail_form_is_public"
id="bm_detail_form_field_is_public"
class="ml-3"
formControlName="is_public"
[binary]="true"
Expand Down Expand Up @@ -72,21 +72,21 @@
type="text"
readonly
[disabled]="true"
id="bm_detail_product"
id="bm_detail_form_field_product"
class="w-full pt-3 pb-2"
[value]="vm.initialBookmark?.productName"
[attr.aria-label]="'BOOKMARK.PRODUCT' | translate"
[pTooltip]="'BOOKMARK.TOOLTIPS.PRODUCT' | translate"
tooltipPosition="top"
tooltipEvent="hover"
/>
<label for="bm_detail_product">{{ 'BOOKMARK.PRODUCT' | translate }}</label>
<label for="bm_detail_form_field_product">{{ 'BOOKMARK.PRODUCT' | translate }}</label>
</span>
<span *ocxIfPermission="'BOOKMARK#ADMIN_EDIT'" class="p-float-label">
<input
pInputText
type="text"
id="bm_detail_app_id"
id="bm_detail_form_field_app_id"
class="w-full pt-3 pb-2"
[disabled]="true"
[value]="vm.initialBookmark?.appId"
Expand All @@ -95,7 +95,7 @@
tooltipPosition="top"
tooltipEvent="hover"
/>
<label for="bm_detail_app_id">{{ 'BOOKMARK.APP_ID' | translate }}</label>
<label for="bm_detail_form_field_app_id">{{ 'BOOKMARK.APP_ID' | translate }}</label>
</span>
</div>
</p-tabPanel>
Expand All @@ -112,15 +112,15 @@
<input
pInputText
type="text"
id="bm_detail_form_endpoint_name"
id="bm_detail_form_field_endpoint_name"
class="w-full pt-3 pb-2"
[value]="vm.initialBookmark?.endpointName"
[attr.aria-label]="'BOOKMARK.ENDPOINT' | translate"
[pTooltip]="'BOOKMARK.TOOLTIPS.ENDPOINT' | translate"
tooltipPosition="top"
tooltipEvent="hover"
/>
<label for="bm_detail_form_endpoint_name">{{ 'BOOKMARK.ENDPOINT' | translate }}</label>
<label for="bm_detail_form_field_endpoint_name">{{ 'BOOKMARK.ENDPOINT' | translate }}</label>
</span>
<div>
<div controlErrorAnchor>
Expand All @@ -130,14 +130,14 @@
pInputTextarea
autoresize="true"
rows="3"
id="bm_detail_form_endpoint_parameter"
id="bm_detail_form_field_endpoint_parameter"
formControlName="endpointParams"
[attr.aria-label]="'BOOKMARK.ENDPOINT_PARAMETER' | translate"
[pTooltip]="'BOOKMARK.TOOLTIPS.ENDPOINT_PARAMETER' | translate"
tooltipPosition="top"
tooltipEvent="hover"
></textarea>
<label for="bm_detail_form_endpoint_parameter">{{ 'BOOKMARK.ENDPOINT_PARAMETER' | translate }}</label>
<label for="bm_detail_form_field_endpoint_parameter">{{ 'BOOKMARK.ENDPOINT_PARAMETER' | translate }}</label>
</span>
<div class="text-xs">Format: {{ 'VALIDATION.JSON_FORMAT' | translate }}</div>
</div>
Expand Down Expand Up @@ -184,14 +184,14 @@
pInputTextarea
autoresize="true"
rows="3"
id="bm_detail_form_query"
id="bm_detail_form_field_query"
formControlName="query"
[attr.aria-label]="'BOOKMARK.QUERY' | translate"
[pTooltip]="'BOOKMARK.TOOLTIPS.QUERY' | translate"
tooltipPosition="top"
tooltipEvent="hover"
></textarea>
<label for="bm_detail_form_query">{{ 'BOOKMARK.QUERY' | translate }}</label>
<label for="bm_detail_form_field_query">{{ 'BOOKMARK.QUERY' | translate }}</label>
</span>
<div class="text-xs">Format: {{ 'VALIDATION.JSON_FORMAT' | translate }}</div>
</div>
Expand All @@ -202,14 +202,14 @@
pInputTextarea
autoresize="true"
rows="3"
id="bm_detail_form_fragment"
id="bm_detail_form_field_fragment"
formControlName="fragment"
[attr.aria-label]="'BOOKMARK.FRAGMENT' | translate"
[pTooltip]="'BOOKMARK.TOOLTIPS.FRAGMENT' | translate"
tooltipPosition="top"
tooltipEvent="hover"
></textarea>
<label for="bm_detail_form_hash">{{ 'BOOKMARK.FRAGMENT' | translate }}</label>
<label for="bm_detail_form_field_fragment">{{ 'BOOKMARK.FRAGMENT' | translate }}</label>
</span>
</div>
</p-tabPanel>
Expand All @@ -229,29 +229,29 @@
<input
pInputText
type="text"
id="ps_app_detail_form_field_creation_date"
id="bm_detail_form_field_creation_date"
class="w-full sm:w-13rem pt-3 pb-2 text-responsive"
[disabled]="true"
[value]="vm.initialBookmark?.creationDate ? (vm.initialBookmark?.creationDate | date: datetimeFormat) : ''"
[value]="vm.initialBookmark?.creationDate ? (vm.initialBookmark?.creationDate | date: dateFormat) : ''"
[pTooltip]="'INTERNAL.TOOLTIPS.CREATION_DATE' | translate"
tooltipPosition="top"
tooltipEvent="hover"
/>
<label for="ps_app_detail_form_field_creation_date">{{ 'INTERNAL.CREATION_DATE' | translate }}</label>
<label for="bm_detail_form_field_creation_date">{{ 'INTERNAL.CREATION_DATE' | translate }}</label>
</span>
<span class="flex-grow-1 p-float-label">
<input
pInputText
type="text"
id="ps_app_detail_form_field_creation_user"
id="bm_detail_form_field_creation_user"
class="w-full pt-3 pb-2 text-responsive"
[disabled]="true"
[value]="vm.initialBookmark?.creationUser"
[pTooltip]="'INTERNAL.TOOLTIPS.CREATION_USER' | translate"
tooltipPosition="top"
tooltipEvent="hover"
/>
<label for="ps_app_detail_form_field_creation_user"> {{ 'INTERNAL.CREATION_USER' | translate }} </label>
<label for="bm_detail_form_field_creation_user"> {{ 'INTERNAL.CREATION_USER' | translate }} </label>
</span>
</div>

Expand All @@ -261,33 +261,29 @@
<input
pInputText
type="text"
id="ps_app_detail_form_field_modification_date"
id="bm_detail_form_field_modification_date"
class="w-full sm:w-13rem pt-3 pb-2"
[disabled]="true"
[value]="vm.initialBookmark?.modificationDate ? (vm.initialBookmark?.modificationDate | date: datetimeFormat) : ''"
[value]="vm.initialBookmark?.modificationDate ? (vm.initialBookmark?.modificationDate | date: dateFormat) : ''"
[pTooltip]="'INTERNAL.TOOLTIPS.MODIFICATION_DATE' | translate"
tooltipPosition="top"
tooltipEvent="hover"
/>
<label for="ps_app_detail_form_field_modification_date">
{{ 'INTERNAL.MODIFICATION_DATE' | translate }}
</label>
<label for="bm_detail_form_field_modification_date"> {{ 'INTERNAL.MODIFICATION_DATE' | translate }} </label>
</span>
<span class="flex-grow-1 p-float-label">
<input
pInputText
type="text"
id="ps_app_detail_form_field_modification_user"
id="bm_detail_form_field_modification_user"
class="w-full pt-3 pb-2 text-responsive"
[disabled]="true"
[value]="vm.initialBookmark?.modificationUser"
[pTooltip]="'INTERNAL.TOOLTIPS.MODIFICATION_USER' | translate"
tooltipPosition="top"
tooltipEvent="hover"
/>
<label for="ps_app_detail_form_field_modification_user">
{{ 'INTERNAL.MODIFICATION_USER' | translate }}
</label>
<label for="bm_detail_form_field_modification_user"> {{ 'INTERNAL.MODIFICATION_USER' | translate }} </label>
</span>
</div>
</div>
Expand Down
12 changes: 3 additions & 9 deletions src/app/bookmark/bookmark-detail/bookmark-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export class BookmarkDetailComponent
OnInit
{
@Input() public workspaceName = ''
@Input() public dateFormat = 'medium'
@Input() public userId: string | undefined = undefined

@Input() public vm: BookmarkDetailViewModel = {
initialBookmark: undefined,
permissions: undefined,
Expand All @@ -70,17 +73,8 @@ export class BookmarkDetailComponent
public isPublicBookmark = false
private permissionKey = 'BOOKMARK#EDIT'
private hasPermission = false
public datetimeFormat: string
public userId: string | undefined

constructor(private readonly user: UserService) {
this.datetimeFormat = this.user.lang$.getValue() === 'de' ? 'dd.MM.yyyy HH:mm:ss' : 'M/d/yy, hh:mm:ss a'
// to be used if switching scope back to PRIVATE
this.user.profile$.subscribe({
next: (data) => {
this.userId = data.userId
}
})
// this is the universal form: used for specific URL bookmarks and other bookmarks
this.formGroup = new FormGroup({
is_public: new FormControl(false),
Expand Down
Loading

0 comments on commit a96e8d3

Please sign in to comment.