Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#37] Gitlab Connector: Add activity part #299

Merged
merged 8 commits into from
Nov 1, 2023
Merged

Conversation

BeckerFrank
Copy link
Contributor

  • Separate Comments from other System Activity Events.
  • use StyledText to show the Activity Events with color Background
  • add Tooltip and open Action to the Design Events

if (states != null) {
for (JsonElement stateElem : states) {
JsonObject state = (JsonObject) stateElem;
Date date = GitlabTaskAttributeMapper.parseDate(state.get("created_at").getAsString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interval?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with new commit.

thread = Thread.currentThread();
System.out.println(
thread.getName() + " getTaskData start: " + repository.getRepositoryUrl() + " id " + taskId);
startTime = Calendar.getInstance().getTimeInMillis();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System.currentTimeMillis()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with new commit.

if (clientCache.getIfPresent(new RepositoryKey(repository)) == null) {
getClient(repository);
}
try {
if (TRACE) {
thread = Thread.currentThread();
startTime = Calendar.getInstance().getTimeInMillis();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System.currentTimeMillis()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with new commit.

if (added.size() > 0) {
text += "added ";
text += String.join(", ", added);
if (added.size() > 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text += added.size() == 1 ? "label" : "labels";

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with new commit.

}
}
if (removed.size() > 0) {
if (text.length() == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text += text.length() == 0 ? "removed" : "and removed"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with new commit.


TaskAttribute styleAttribute = taskAttribute.createAttribute(GitlabCoreActivator.ATTRIBUTE_TYPE_ACTIVITY_STYLE);
String resultText = "";
Pattern r = Pattern.compile("\\[(.+)\\]\\((.+)\\)");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private static final

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with new commit.


Label labelIcon = toolkit.createLabel(activityComposite, "");

switch (GitlabCoreActivator.ActivityType.valueOf(activityType)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undecided if something like:

labelIcon.setImage(
			GitlabUiActivator.getDefault().getImageRegistry().get(
			    switch(GitlabCoreActivator.ActivityType.valueOf(activityType)) {
			        CALENDAR: yield GitlabUiActivator.GITLAB_CALENDAR_FILE
			    ...
                          }
                        )
	);

would be easier?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with new commit.

@BeckerFrank BeckerFrank requested a review from gnl42 October 21, 2023 05:19
@BeckerFrank
Copy link
Contributor Author

@gnl42: can you please look if I fixed all your comments so that we can merge this?

@BeckerFrank
Copy link
Contributor Author

@gnl42, @wimjongman , @ruspl-afed: can I continue with the merge or should I wait for a review?

Copy link
Member

@wimjongman wimjongman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Frank.

@BeckerFrank BeckerFrank merged commit 0b76f1c into main Nov 1, 2023
1 check passed
@BeckerFrank BeckerFrank deleted the 37_Gitlab-ActivityPart branch November 5, 2023 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants