Skip to content

Commit 70c03d5

Browse files
committed
WIP - Icon and structure css details
1 parent 65167bc commit 70c03d5

File tree

8 files changed

+166
-66
lines changed

8 files changed

+166
-66
lines changed

roda-ui/roda-wui/src/main/java/org/roda/wui/client/browse/BrowseAIP.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ public class BrowseAIP extends Composite {
144144

145145
// SIDEBAR
146146
@UiField
147-
FlowPanel representationCards;
147+
FlowPanel sidePanel;
148148
@UiField
149-
SimplePanel representationActions;
149+
FlowPanel representationCards;
150150
@UiField
151151
FlowPanel disseminationCards;
152152

@@ -275,14 +275,19 @@ public void onSuccess(Actionable.ActionImpact impact) {
275275
}
276276

277277
// Side panel representations
278-
this.representationCards.add(new AIPRepresentationCardList(aipId));
279-
this.disseminationCards.add(new AIPDisseminationCardList(aipId));
280-
this.representationActions.setWidget(new ActionableWidgetBuilder<>(representationActions).buildListWithObjects(
281-
new ActionableObject<>(IndexedRepresentation.class),
282-
Collections.singletonList(RepresentationActions.RepresentationAction.NEW)));
278+
if (response.getRepresentationCount().getResult() > 0 || response.getDipCount().getResult() > 0) {
279+
if (response.getRepresentationCount().getResult() > 0) {
280+
this.representationCards.add(new AIPRepresentationCardList(aipId));
281+
}
282+
if (response.getDipCount().getResult() > 0) {
283+
this.disseminationCards.add(new AIPDisseminationCardList(aipId));
284+
}
285+
}
286+
else {
287+
this.sidePanel.setVisible(false);
288+
}
283289

284290
keyboardFocus.setFocus(true);
285-
keyboardFocus.addStyleName("here");
286291
}
287292

288293
public static void getAndRefresh(String id, AsyncCallback<Widget> callback) {

roda-ui/roda-wui/src/main/java/org/roda/wui/client/browse/BrowseAIP.ui.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@
3232
</g:FlowPanel>
3333
</g:FlowPanel>
3434
</g:FocusPanel>
35-
<g:FlowPanel styleName="browseSidePanel">
35+
<g:FlowPanel styleName="browseSidePanel" ui:field="sidePanel">
3636
<g:FlowPanel>
3737
<g:FlowPanel ui:field="representationCards" addStyleNames="verticalThumbnailCardContainer"/>
38-
<g:SimplePanel ui:field="representationActions" />
3938
</g:FlowPanel>
4039
<g:FlowPanel>
4140
<g:FlowPanel ui:field="disseminationCards" addStyleNames="verticalThumbnailCardContainer"/>

roda-ui/roda-wui/src/main/java/org/roda/wui/client/browse/EditPermissionsTab.ui.xml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,27 @@
55

66
<ui:with field='messages' type='config.i18n.client.ClientMessages' />
77

8-
<g:FlowPanel styleName="permissionsTab" addStyleNames="wrapper skip_padding">
9-
<common:ActionsToolbar ui:field="actionsToolbar" />
10-
<g:FlowPanel addStyleNames="row full_width skip_padding">
11-
<g:FlowPanel addStyleNames="content">
12-
<labels:Header ui:field="title" />
8+
<g:FlowPanel styleName="permissionsTab roda6CardWithHeader" addStyleNames="wrapper skip_padding">
9+
<g:FlowPanel styleName="cardHeader">
10+
<common:ActionsToolbar ui:field="actionsToolbar" />
11+
</g:FlowPanel>
12+
<g:FlowPanel styleName="cardBody">
13+
<g:FlowPanel addStyleNames="row full_width">
14+
<g:FlowPanel addStyleNames="content">
15+
<labels:Header ui:field="title" />
1316

14-
<g:FlowPanel addStyleNames="page-description" ui:field="editPermissionsDescription" />
15-
<labels:Header ui:field="userPermissionsTitle" />
16-
<g:Label styleName="info-empty" ui:field="groupPermissionsEmpty">
17-
<ui:text from='{messages.permissionAssignedGroupsEmpty}' />
18-
</g:Label>
19-
<g:FlowPanel ui:field="groupPermissionsPanel" addStyleNames="plugin-category-padding" />
20-
<labels:Header ui:field="groupPermissionsTitle" />
21-
<g:Label styleName="info-empty" ui:field="userPermissionsEmpty">
22-
<ui:text from='{messages.permissionAssignedUsersEmpty}' />
23-
</g:Label>
24-
<g:FlowPanel ui:field="userPermissionsPanel" addStyleNames="permission-box-padding" />
17+
<g:FlowPanel addStyleNames="page-description" ui:field="editPermissionsDescription" />
18+
<labels:Header ui:field="userPermissionsTitle" />
19+
<g:Label styleName="info-empty" ui:field="groupPermissionsEmpty">
20+
<ui:text from='{messages.permissionAssignedGroupsEmpty}' />
21+
</g:Label>
22+
<g:FlowPanel ui:field="groupPermissionsPanel" addStyleNames="plugin-category-padding" />
23+
<labels:Header ui:field="groupPermissionsTitle" />
24+
<g:Label styleName="info-empty" ui:field="userPermissionsEmpty">
25+
<ui:text from='{messages.permissionAssignedUsersEmpty}' />
26+
</g:Label>
27+
<g:FlowPanel ui:field="userPermissionsPanel" addStyleNames="permission-box-padding" />
28+
</g:FlowPanel>
2529
</g:FlowPanel>
2630
</g:FlowPanel>
2731
</g:FlowPanel>

roda-ui/roda-wui/src/main/java/org/roda/wui/client/browse/tabs/AIPDescriptiveMetadataTabs.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,20 @@ public void init(IndexedAIP aip, DescriptiveMetadataInfos descriptiveMetadataInf
4545
SafeHtml buttonTitle = SafeHtmlUtils.fromString(metadataInfo.getLabel());
4646
// Content container
4747
FlowPanel content = new FlowPanel();
48-
content.addStyleName("descriptiveMetadataTabContainer");
48+
content.addStyleName("descriptiveMetadataTabContainer roda6CardWithHeader");
4949
// Create Toolbar
50+
FlowPanel cardHeader = new FlowPanel();
51+
cardHeader.setStyleName("cardHeader");
5052
String metadataID = SafeHtmlUtils.htmlEscape(metadataInfo.getId());
5153
ActionsToolbar descriptiveMetadataToolbar = new ActionsToolbar();
5254
descriptiveMetadataToolbar.setLabelVisible(false);
5355
descriptiveMetadataToolbar.setTagsVisible(false);
54-
content.add(descriptiveMetadataToolbar);
56+
cardHeader.add(descriptiveMetadataToolbar);
57+
content.add(cardHeader);
5558
// Get metadata and populate widget
59+
FlowPanel cardBody = new FlowPanel();
60+
content.add(cardBody);
61+
cardBody.setStyleName("cardBody");
5662
HTML metadataHTML = new HTML();
5763
SafeUri uri = RestUtils.createDescriptiveMetadataHTMLUri(aip.getId(), metadataID);
5864
RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, uri.asString());
@@ -134,7 +140,7 @@ public void onError(Request request, Throwable e) {
134140
Toast.showError(messages.errorLoadingDescriptiveMetadata(e.getMessage()));
135141
}
136142
}
137-
content.add(metadataHTML);
143+
cardBody.add(metadataHTML);
138144
// Create and add tab
139145
createAndAddTab(buttonTitle, content);
140146
}

roda-ui/roda-wui/src/main/java/org/roda/wui/client/common/ObjectActionsToolbar.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@ public void buildTags() {
5757
break;
5858
}
5959
// Disposal
60-
if (DisposalPolicyUtils.showDisposalPolicySummary(aip)) {
61-
Tag disposalTag = DisposalPolicyUtils.getDisposalPolicySummaryTag(aip);
62-
if (disposalTag != null) {
63-
disposalTag.addClickHandler(new ClickHandler() {
64-
@Override
65-
public void onClick(ClickEvent event) {
66-
HistoryUtils.newHistory(DisposalPolicyAssociationPanel.RESOLVER, aip.getId());
67-
}
68-
});
69-
tags.add(disposalTag);
70-
}
71-
}
60+
// if (DisposalPolicyUtils.showDisposalPolicySummary(aip)) {
61+
// Tag disposalTag = DisposalPolicyUtils.getDisposalPolicySummaryTag(aip);
62+
// if (disposalTag != null) {
63+
// disposalTag.addClickHandler(new ClickHandler() {
64+
// @Override
65+
// public void onClick(ClickEvent event) {
66+
// HistoryUtils.newHistory(DisposalPolicyAssociationPanel.RESOLVER, aip.getId());
67+
// }
68+
// });
69+
// tags.add(disposalTag);
70+
// }
71+
// }
7272
}
7373
}
7474

@@ -86,7 +86,7 @@ public void buildActions() {
8686
AIPToolbarActions.AIPAction.DOWNLOAD_DOCUMENTATION, AIPToolbarActions.AIPAction.DOWNLOAD_SUBMISSIONS,
8787
AIPToolbarActions.AIPAction.CHANGE_TYPE, AIPToolbarActions.AIPAction.MOVE_IN_HIERARCHY,
8888
AIPToolbarActions.AIPAction.REMOVE, AIPToolbarActions.AIPAction.NEW_PROCESS,
89-
AIPToolbarActions.AIPAction.NEW_CHILD_AIP_BELOW),
89+
AIPToolbarActions.AIPAction.NEW_CHILD_AIP_BELOW, AIPToolbarActions.AIPAction.NEW_REPRESENTATION),
9090
List.of(AIPToolbarActions.AIPAction.NEW_PROCESS)));
9191
}
9292
}

roda-ui/roda-wui/src/main/java/org/roda/wui/client/common/actions/AIPToolbarActions.java

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.roda.core.data.v2.ip.Permissions;
3838
import org.roda.core.data.v2.ip.disposalhold.DisassociateDisposalHoldRequest;
3939
import org.roda.core.data.v2.representation.ChangeTypeRequest;
40+
import org.roda.wui.client.browse.BrowseRepresentation;
4041
import org.roda.wui.client.browse.CreateDescriptiveMetadata;
4142
import org.roda.wui.client.browse.EditPermissions;
4243
import org.roda.wui.client.common.LastSelectedItemsSingleton;
@@ -94,7 +95,7 @@ public class AIPToolbarActions extends AbstractActionable<IndexedAIP> {
9495
AIPAction.MOVE_IN_HIERARCHY, AIPAction.UPDATE_PERMISSIONS, AIPAction.REMOVE, AIPAction.NEW_PROCESS,
9596
AIPAction.DOWNLOAD_EVENTS, AIPAction.DOWNLOAD_DOCUMENTATION, AIPAction.DOWNLOAD_SUBMISSIONS, AIPAction.CHANGE_TYPE,
9697
AIPAction.ASSOCIATE_DISPOSAL_SCHEDULE, AIPAction.ASSOCIATE_DISPOSAL_HOLD, AIPAction.SEARCH_DESCENDANTS,
97-
AIPAction.SEARCH_PACKAGE, AIPAction.NEW_CHILD_AIP_BELOW));
98+
AIPAction.SEARCH_PACKAGE, AIPAction.NEW_CHILD_AIP_BELOW, AIPAction.NEW_REPRESENTATION));
9899
private static final Set<AIPAction> POSSIBLE_ACTIONS_ON_MULTIPLE_AIPS = new HashSet<>(
99100
Arrays.asList(AIPAction.MOVE_IN_HIERARCHY, AIPAction.UPDATE_PERMISSIONS, AIPAction.REMOVE, AIPAction.NEW_PROCESS,
100101
AIPAction.CHANGE_TYPE, AIPAction.ASSOCIATE_DISPOSAL_SCHEDULE, AIPAction.ASSOCIATE_DISPOSAL_HOLD));
@@ -233,6 +234,8 @@ public void act(Action<IndexedAIP> action, IndexedAIP aip, AsyncCallback<ActionI
233234
manageDisposalHold(aip, callback);
234235
} else if (AIPAction.NEW_CHILD_AIP_TOP.equals(action) || AIPAction.NEW_CHILD_AIP_BELOW.equals(action)) {
235236
newChildAip(callback);
237+
} else if (AIPAction.NEW_REPRESENTATION.equals(action)) {
238+
newRepresentation(callback);
236239
} else {
237240
unsupportedAction(action, callback);
238241
}
@@ -319,6 +322,24 @@ private void newChildAip(final AsyncCallback<ActionImpact> callback) {
319322
});
320323
}
321324

325+
private void newRepresentation(final AsyncCallback<ActionImpact> callback) {
326+
Dialogs.showPromptDialog(messages.outcomeDetailTitle(), null, null, messages.outcomeDetailPlaceholder(),
327+
RegExp.compile(".*"), messages.cancelButton(), messages.confirmButton(), false, false,
328+
new ActionNoAsyncCallback<String>(callback) {
329+
@Override
330+
public void onSuccess(String details) {
331+
Services services = new Services("Create representation", "create");
332+
services.representationResource(s -> s.createRepresentation(parentAipId, "MIXED", details))
333+
.whenComplete((representation, error) -> {
334+
if (representation != null) {
335+
HistoryUtils.newHistory(BrowseRepresentation.RESOLVER, parentAipId, representation.getId());
336+
callback.onSuccess(ActionImpact.UPDATED);
337+
}
338+
});
339+
}
340+
});
341+
}
342+
322343
private void download(IndexedAIP aip, AsyncCallback<ActionImpact> callback) {
323344
SafeUri downloadUri = RestUtils.createAIPDownloadUri(aip.getId());
324345
callback.onSuccess(ActionImpact.NONE);
@@ -1101,11 +1122,13 @@ public ActionableBundle<IndexedAIP> createActionsBundle() {
11011122
"btn-plus-circle");
11021123
managementGroup.addButton(messages.newSublevel(), AIPAction.NEW_CHILD_AIP_BELOW, ActionImpact.UPDATED,
11031124
"btn-plus-circle");
1125+
managementGroup.addButton(messages.newRepresentationButton(), AIPAction.NEW_REPRESENTATION, ActionImpact.UPDATED,
1126+
"btn-plus-circle");
11041127
managementGroup.addButton(messages.changeTypeButton(), AIPAction.CHANGE_TYPE, ActionImpact.UPDATED, BTN_EDIT);
11051128
managementGroup.addButton(messages.moveArchivalPackage(), AIPAction.MOVE_IN_HIERARCHY, ActionImpact.UPDATED,
11061129
BTN_EDIT);
1107-
managementGroup.addButton(messages.editArchivalPackagePermissions(), AIPAction.UPDATE_PERMISSIONS, ActionImpact.UPDATED,
1108-
BTN_EDIT);
1130+
managementGroup.addButton(messages.editArchivalPackagePermissions(), AIPAction.UPDATE_PERMISSIONS,
1131+
ActionImpact.UPDATED, BTN_EDIT);
11091132
managementGroup.addButton(messages.removeArchivalPackage(), AIPAction.REMOVE, ActionImpact.DESTROYED, "btn-ban");
11101133

11111134
// PRESERVATION
@@ -1141,7 +1164,7 @@ public enum AIPAction implements Action<IndexedAIP> {
11411164
CHANGE_TYPE(RodaConstants.PERMISSION_METHOD_CHANGE_AIP_TYPE),
11421165
ASSOCIATE_DISPOSAL_SCHEDULE(RodaConstants.PERMISSION_METHOD_ASSOCIATE_DISPOSAL_SCHEDULE),
11431166
ASSOCIATE_DISPOSAL_HOLD(RodaConstants.PERMISSION_METHOD_ASSOCIATE_DISPOSAL_HOLD), SEARCH_DESCENDANTS(),
1144-
SEARCH_PACKAGE();
1167+
SEARCH_PACKAGE(), NEW_REPRESENTATION(RodaConstants.PERMISSION_METHOD_CREATE_REPRESENTATION);
11451168

11461169
private final List<String> methods;
11471170

0 commit comments

Comments
 (0)